类 SerializerFactory
- java.lang.Object
-
- com.alibaba.com.caucho.hessian.io.AbstractSerializerFactory
-
- com.alibaba.com.caucho.hessian.io.SerializerFactory
-
public class SerializerFactory extends AbstractSerializerFactory
Factory for returning serialization methods.
-
-
构造器概要
构造器 构造器 说明 SerializerFactory()
SerializerFactory(ClassLoader loader)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
addFactory(AbstractSerializerFactory factory)
Adds a factory.ClassFactory
getClassFactory()
ClassLoader
getClassLoader()
Deserializer
getDeserializer(Class cl)
Returns the deserializer for a class.Deserializer
getDeserializer(String type)
Returns a deserializer based on a string type.Deserializer
getListDeserializer(String type)
Reads the object as a map.Deserializer
getListDeserializer(String type, Class cl)
Reads the object as a map.Deserializer
getObjectDeserializer(String type)
Reads the object as a map.Deserializer
getObjectDeserializer(String type, Class cl)
Reads the object as a map.Serializer
getSerializer(Class cl)
Returns the serializer for a class.boolean
isAllowNonSerializable()
If true, non-serializable objects are allowed.Class<?>
loadSerializedClass(String className)
Object
readList(AbstractHessianInput in, int length, String type)
Reads the object as a list.Object
readMap(AbstractHessianInput in, String type)
Reads the object as a map.Object
readMap(AbstractHessianInput in, String type, Class<?> expectKeyType, Class<?> expectValueType)
Reads the object as a map.Object
readObject(AbstractHessianInput in, String type, 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.
-
-
-
构造器详细资料
-
SerializerFactory
public SerializerFactory()
-
SerializerFactory
public SerializerFactory(ClassLoader loader)
-
-
方法详细资料
-
loadSerializedClass
public Class<?> loadSerializedClass(String className) throws ClassNotFoundException
-
getClassFactory
public ClassFactory getClassFactory()
-
getClassLoader
public ClassLoader getClassLoader()
-
setSendCollectionType
public void setSendCollectionType(boolean isSendType)
Set true if the collection serializer should send the java type.
-
addFactory
public void addFactory(AbstractSerializerFactory factory)
Adds a factory.
-
isAllowNonSerializable
public boolean isAllowNonSerializable()
If true, non-serializable objects are allowed.
-
setAllowNonSerializable
public void setAllowNonSerializable(boolean allow)
If true, non-serializable objects are allowed.
-
getSerializer
public Serializer getSerializer(Class cl) throws HessianProtocolException
Returns the serializer for a class.- 指定者:
getSerializer
在类中AbstractSerializerFactory
- 参数:
cl
- the class of the object that needs to be serialized.- 返回:
- a serializer object for the serialization.
- 抛出:
HessianProtocolException
-
getDeserializer
public Deserializer getDeserializer(Class cl) throws HessianProtocolException
Returns the deserializer for a class.- 指定者:
getDeserializer
在类中AbstractSerializerFactory
- 参数:
cl
- the class of the object that needs to be deserialized.- 返回:
- a deserializer object for the serialization.
- 抛出:
HessianProtocolException
-
readList
public Object readList(AbstractHessianInput in, int length, String type) throws HessianProtocolException, IOException
Reads the object as a list.
-
readMap
public Object readMap(AbstractHessianInput in, String type) throws HessianProtocolException, IOException
Reads the object as a map.
-
readMap
public Object readMap(AbstractHessianInput in, String type, Class<?> expectKeyType, Class<?> expectValueType) throws HessianProtocolException, IOException
Reads the object as a map.
-
readObject
public Object readObject(AbstractHessianInput in, String type, String[] fieldNames) throws HessianProtocolException, IOException
Reads the object as a map.
-
getObjectDeserializer
public Deserializer getObjectDeserializer(String type, Class cl) throws HessianProtocolException
Reads the object as a map.
-
getObjectDeserializer
public Deserializer getObjectDeserializer(String type) throws HessianProtocolException
Reads the object as a map.
-
getListDeserializer
public Deserializer getListDeserializer(String type, Class cl) throws HessianProtocolException
Reads the object as a map.
-
getListDeserializer
public Deserializer getListDeserializer(String type) throws HessianProtocolException
Reads the object as a map.
-
getDeserializer
public Deserializer getDeserializer(String type) throws HessianProtocolException
Returns a deserializer based on a string type.
-
-