类 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)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddFactory(AbstractSerializerFactory factory)Adds a factory.ClassFactorygetClassFactory()ClassLoadergetClassLoader()DeserializergetDeserializer(Class cl)Returns the deserializer for a class.DeserializergetDeserializer(String type)Returns a deserializer based on a string type.DeserializergetListDeserializer(String type)Reads the object as a map.DeserializergetListDeserializer(String type, Class cl)Reads the object as a map.DeserializergetObjectDeserializer(String type)Reads the object as a map.DeserializergetObjectDeserializer(String type, Class cl)Reads the object as a map.SerializergetSerializer(Class cl)Returns the serializer for a class.booleanisAllowNonSerializable()If true, non-serializable objects are allowed.Class<?>loadSerializedClass(String className)ObjectreadList(AbstractHessianInput in, int length, String type)Reads the object as a list.ObjectreadMap(AbstractHessianInput in, String type)Reads the object as a map.ObjectreadMap(AbstractHessianInput in, String type, Class<?> expectKeyType, Class<?> expectValueType)Reads the object as a map.ObjectreadObject(AbstractHessianInput in, String type, String[] fieldNames)Reads the object as a map.voidsetAllowNonSerializable(boolean allow)If true, non-serializable objects are allowed.voidsetSendCollectionType(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.
-
-