An interface to be implemented by classes which are capable of converting an instance of a supported class into a state representation of the object which is serializable. Supported classes may in fact be classes or interfaces.
When possible, classes (not interfaces) should be supported explicitly, i.e., the getObjectClass()
method of the SerializableState
returned by getState(Object)
should return the same value which would be returned by invoking getClass()
on the object passed to getState(Object)
. In particular, whenever feasible a Serializer
should not be used to serialize a given object into a form which when deserialized would yield an instance of the superclass of the class of which the object is an instance. When it is not possible to provide a class-specific Serializer
, such as when a factory class generate subclasses of itself via factory methods, then permitsSubclasses()
should return true
; in the case of class-specific Serializer
s it should return false
.
@see SerializableState
@see java.io.Serializable
@since JAI 1.1