public class SerializerFactory extends AbstractSerializerFactory
Modifier and Type | Field and Description |
---|---|
protected CollectionSerializer |
_collectionSerializer |
protected Serializer |
_defaultSerializer |
protected java.util.ArrayList |
_factories |
protected MapSerializer |
_mapSerializer |
Constructor and Description |
---|
SerializerFactory() |
SerializerFactory(java.lang.ClassLoader loader) |
Modifier and Type | Method and Description |
---|---|
void |
addFactory(AbstractSerializerFactory factory)
Adds a factory.
|
static SerializerFactory |
createDefault() |
ClassFactory |
getClassFactory() |
java.lang.ClassLoader |
getClassLoader() |
protected Deserializer |
getCustomDeserializer(java.lang.Class cl)
Returns a custom serializer the class
|
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 |
getListDeserializer(java.lang.String type)
Reads the object as a map.
|
Deserializer |
getListDeserializer(java.lang.String type,
java.lang.Class cl)
Reads the object as a map.
|
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 |
getObjectSerializer(java.lang.Class<?> cl)
Returns the serializer for a class.
|
Serializer |
getSerializer(java.lang.Class cl)
Returns the serializer for a class.
|
boolean |
isAllowNonSerializable()
If true, non-serializable objects are allowed.
|
protected Deserializer |
loadDeserializer(java.lang.Class cl) |
java.lang.Class<?> |
loadSerializedClass(java.lang.String className) |
protected Serializer |
loadSerializer(java.lang.Class<?> cl) |
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.
|
protected Serializer _defaultSerializer
protected java.util.ArrayList _factories
protected CollectionSerializer _collectionSerializer
protected MapSerializer _mapSerializer
public SerializerFactory()
public SerializerFactory(java.lang.ClassLoader loader)
public static SerializerFactory createDefault()
public java.lang.ClassLoader getClassLoader()
public void setSendCollectionType(boolean isSendType)
public void addFactory(AbstractSerializerFactory factory)
public void setAllowNonSerializable(boolean allow)
public boolean isAllowNonSerializable()
public Serializer getObjectSerializer(java.lang.Class<?> cl) throws HessianProtocolException
cl
- the class of the object that needs to be serialized.HessianProtocolException
public java.lang.Class<?> loadSerializedClass(java.lang.String className) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public ClassFactory getClassFactory()
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 loadSerializer(java.lang.Class<?> cl) throws HessianProtocolException
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 loadDeserializer(java.lang.Class cl) throws HessianProtocolException
HessianProtocolException
protected Deserializer getCustomDeserializer(java.lang.Class cl)
cl
- the class of the object that needs to be serialized.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 getListDeserializer(java.lang.String type, java.lang.Class cl) throws HessianProtocolException
HessianProtocolException
public Deserializer getListDeserializer(java.lang.String type) throws HessianProtocolException
HessianProtocolException
public Deserializer getDeserializer(java.lang.String type) throws HessianProtocolException
HessianProtocolException