com.metaparadigm.jsonrpc.serializer
Class AbstractSerializer

java.lang.Object
  extended by com.metaparadigm.jsonrpc.serializer.AbstractSerializer
All Implemented Interfaces:
Serializer, java.io.Serializable
Direct Known Subclasses:
ArraySerializer, BeanSerializer, BooleanSerializer, DateSerializer, DictionarySerializer, ListSerializer, MapSerializer, NumberSerializer, PrimitiveSerializer, RawJSONArraySerializer, RawJSONObjectSerializer, ReferenceSerializer, SetSerializer, StringSerializer

public abstract class AbstractSerializer
extends java.lang.Object
implements Serializer

Convenience class for implementing Serializers providing default setOwner and canSerialize implementations.

See Also:
Serialized Form

Constructor Summary
AbstractSerializer()
           
 
Method Summary
 boolean canSerialize(java.lang.Class clazz, java.lang.Class jsonClazz)
          Default check that simply tests the given serializeable class arrays to determine if the pair of classes can be serialized/deserialized from this Serializer.
 void setOwner(JSONSerializer ser)
          Set the owning JSONSerializer of this Serializer instance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.metaparadigm.jsonrpc.serializer.Serializer
getJSONClasses, getSerializableClasses, marshall, tryUnmarshall, unmarshall
 

Constructor Detail

AbstractSerializer

public AbstractSerializer()
Method Detail

canSerialize

public boolean canSerialize(java.lang.Class clazz,
                            java.lang.Class jsonClazz)
Default check that simply tests the given serializeable class arrays to determine if the pair of classes can be serialized/deserialized from this Serializer.

Specified by:
canSerialize in interface Serializer
Parameters:
clazz - java type to check if this Serializer can handle.
jsonClazz - json type to check this Serializer can handle.
Returns:
true if this Serializer can serialize/deserialize the given java,json pair.

setOwner

public void setOwner(JSONSerializer ser)
Description copied from interface: Serializer
Set the owning JSONSerializer of this Serializer instance.

Specified by:
setOwner in interface Serializer
Parameters:
ser - the owning JSONSerializer of this Serializer instance.


Copyright © 2005 Metaparadigm Pte Ltd.