org.spicefactory.cinnamon.io
Interface Externalizer<R,W>


public interface Externalizer<R,W>

Controls the serialization and deserialization of objects to/from AMF3 binary data. Implementations of this interface may be used in cases where the target class cannot implement the Externalizable interface.

The interface is parameterized with two TypeVariables since the object passed to readExternal might be an instance implementing MappedObjectFactory and not the target instance itself. For externalizable class mappings for which no factory is configured the implementation should declare the same class for both TypeVariables.

Any implementation of this interface must be explicitly declared for each class mapping it should be used for, no matter whether you are using Spring or Cinnamons own XML configuration file for framework configuration.

Implementations of this interface must have a default no-args constructor.

Author:
Jens Halm

Method Summary
 void readExternal(R object, DataInput in)
          Restores the content of the given object from the DataInput instance.
 void writeExternal(W object, DataOutput out)
          Saves the content of the given object to the DataOutput instance.
 

Method Detail

readExternal

void readExternal(R object,
                  DataInput in)
Restores the content of the given object from the DataInput instance. Values must be read in the same sequence as they were written on the client side.

Parameters:
object - the object to be restored
in - the AMF3 data to read from

writeExternal

void writeExternal(W object,
                   DataOutput out)
Saves the content of the given object to the DataOutput instance.

Parameters:
object - the object to be serialized
out - the output to write to