com.caucho.hessian.io

Class SerializerFactory

Known Direct Subclasses:
BeanSerializerFactory

public class SerializerFactory
extends java.lang.Object

Factory for returning serialization methods.

Field Summary

private HashMap
_cachedDeserializerMap
private HashMap
_cachedSerializerMap
private HashMap
_cachedTypeDeserializerMap
protected Serializer
_defaultSerializer
private static HashMap
_deserializerMap
private Deserializer
_hashMapDeserializer
private static HashMap
_serializerMap
private static HashMap
_typeMap

Method Summary

private static void
addBasic(Class cl, String typeName, int type)
protected Deserializer
getDefaultDeserializer(Class cl)
Returns the default serializer for a class that isn't matched directly.
protected Serializer
getDefaultSerializer(Class cl)
Returns the default serializer for a class that isn't matched directly.
Deserializer
getDeserializer(Class cl)
Returns the deserializer for a class.
Deserializer
getDeserializer(String type)
Returns a deserializer based on a string type.
Deserializer
getObjectDeserializer(String type)
Reads the object as a map.
Serializer
getSerializer(Class cl)
Returns the serializer for a class.
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.

Field Details

_cachedDeserializerMap

private HashMap _cachedDeserializerMap

_cachedSerializerMap

private HashMap _cachedSerializerMap

_cachedTypeDeserializerMap

private HashMap _cachedTypeDeserializerMap

_defaultSerializer

protected Serializer _defaultSerializer

_deserializerMap

private static HashMap _deserializerMap

_hashMapDeserializer

private Deserializer _hashMapDeserializer

_serializerMap

private static HashMap _serializerMap

_typeMap

private static HashMap _typeMap

Method Details

addBasic

private static void addBasic(Class cl,
                             String typeName,
                             int type)

getDefaultDeserializer

protected Deserializer getDefaultDeserializer(Class cl)
Returns the default serializer for a class that isn't matched directly. Application can override this method to produce bean-style serialization instead of field serialization.
Parameters:
cl - the class of the object that needs to be serialized.
Returns:
a serializer object for the serialization.

getDefaultSerializer

protected Serializer getDefaultSerializer(Class cl)
Returns the default serializer for a class that isn't matched directly. Application can override this method to produce bean-style serialization instead of field serialization.
Parameters:
cl - the class of the object that needs to be serialized.
Returns:
a serializer object for the serialization.

getDeserializer

public Deserializer getDeserializer(Class cl)
            throws HessianProtocolException
Returns the deserializer for a class.
Parameters:
cl - the class of the object that needs to be deserialized.
Returns:
a deserializer object for the serialization.

getDeserializer

public Deserializer getDeserializer(String type)
            throws HessianProtocolException
Returns a deserializer based on a string type.

getObjectDeserializer

public Deserializer getObjectDeserializer(String type)
            throws HessianProtocolException
Reads the object as a map.

getSerializer

public Serializer getSerializer(Class cl)
            throws HessianProtocolException
Returns the serializer for a class.
Parameters:
cl - the class of the object that needs to be serialized.
Returns:
a serializer object for the serialization.

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.