public class SerializerFactory extends AbstractSerializerFactory
Modifier and Type | Field and Description |
---|---|
private java.util.HashMap |
_cachedDeserializerMap |
private java.util.HashMap |
_cachedSerializerMap |
private java.util.HashMap |
_cachedTypeDeserializerMap |
protected CollectionSerializer |
_collectionSerializer |
protected Serializer |
_defaultSerializer |
protected java.util.ArrayList |
_factories |
private Deserializer |
_hashMapDeserializer |
private boolean |
_isAllowNonSerializable |
private static java.util.HashMap |
_staticDeserializerMap |
private static java.util.HashMap |
_staticSerializerMap |
private static java.util.HashMap |
_staticTypeMap |
private static java.util.logging.Logger |
log |
private static Deserializer |
OBJECT_DESERIALIZER |
Constructor and Description |
---|
SerializerFactory() |
Modifier and Type | Method and Description |
---|---|
private static void |
addBasic(java.lang.Class cl,
java.lang.String typeName,
int type) |
void |
addFactory(AbstractSerializerFactory factory)
Adds a factory.
|
protected Deserializer |
getDefaultDeserializer(java.lang.Class cl)
Returns the default serializer for a class that isn't matched
directly.
|
protected Serializer |
getDefaultSerializer(java.lang.Class cl)
Returns the default serializer for a class that isn't matched
directly.
|
Deserializer |
getDeserializer(java.lang.Class cl)
Returns the deserializer for a class.
|
Deserializer |
getDeserializer(java.lang.String type)
Returns a deserializer based on a string type.
|
Deserializer |
getObjectDeserializer(java.lang.String type)
Reads the object as a map.
|
Deserializer |
getObjectDeserializer(java.lang.String type,
java.lang.Class cl)
Reads the object as a map.
|
Serializer |
getSerializer(java.lang.Class cl)
Returns the serializer for a class.
|
boolean |
isAllowNonSerializable()
If true, non-serializable objects are allowed.
|
java.lang.Object |
readList(AbstractHessianInput in,
int length,
java.lang.String type)
Reads the object as a list.
|
java.lang.Object |
readMap(AbstractHessianInput in,
java.lang.String type)
Reads the object as a map.
|
java.lang.Object |
readObject(AbstractHessianInput in,
java.lang.String type,
java.lang.String[] fieldNames)
Reads the object as a map.
|
void |
setAllowNonSerializable(boolean allow)
If true, non-serializable objects are allowed.
|
void |
setSendCollectionType(boolean isSendType)
Set true if the collection serializer should send the java type.
|
private static final java.util.logging.Logger log
private static Deserializer OBJECT_DESERIALIZER
private static java.util.HashMap _staticSerializerMap
private static java.util.HashMap _staticDeserializerMap
private static java.util.HashMap _staticTypeMap
protected Serializer _defaultSerializer
protected java.util.ArrayList _factories
protected CollectionSerializer _collectionSerializer
private Deserializer _hashMapDeserializer
private java.util.HashMap _cachedSerializerMap
private java.util.HashMap _cachedDeserializerMap
private java.util.HashMap _cachedTypeDeserializerMap
private boolean _isAllowNonSerializable
public void setSendCollectionType(boolean isSendType)
public void addFactory(AbstractSerializerFactory factory)
public void setAllowNonSerializable(boolean allow)
public boolean isAllowNonSerializable()
public Serializer getSerializer(java.lang.Class cl) throws HessianProtocolException
getSerializer
in class AbstractSerializerFactory
cl
- the class of the object that needs to be serialized.HessianProtocolException
protected Serializer getDefaultSerializer(java.lang.Class cl)
cl
- the class of the object that needs to be serialized.public Deserializer getDeserializer(java.lang.Class cl) throws HessianProtocolException
getDeserializer
in class AbstractSerializerFactory
cl
- the class of the object that needs to be deserialized.HessianProtocolException
protected Deserializer getDefaultDeserializer(java.lang.Class cl)
cl
- the class of the object that needs to be serialized.public java.lang.Object readList(AbstractHessianInput in, int length, java.lang.String type) throws HessianProtocolException, java.io.IOException
HessianProtocolException
java.io.IOException
public java.lang.Object readMap(AbstractHessianInput in, java.lang.String type) throws HessianProtocolException, java.io.IOException
HessianProtocolException
java.io.IOException
public java.lang.Object readObject(AbstractHessianInput in, java.lang.String type, java.lang.String[] fieldNames) throws HessianProtocolException, java.io.IOException
HessianProtocolException
java.io.IOException
public Deserializer getObjectDeserializer(java.lang.String type, java.lang.Class cl) throws HessianProtocolException
HessianProtocolException
public Deserializer getObjectDeserializer(java.lang.String type) throws HessianProtocolException
HessianProtocolException
public Deserializer getDeserializer(java.lang.String type) throws HessianProtocolException
HessianProtocolException
private static void addBasic(java.lang.Class cl, java.lang.String typeName, int type)