org.spicefactory.cinnamon.io
Interface MappedObjectFactory<T>


public interface MappedObjectFactory<T>

Factory that creates new instances of mapped objects. If you specify a factory for a class mapping (no matter if it's a bean class mapping or an externalizable class mapping) the AMF3 object will be deserialized to an instance of this factory. The facory is then responsible for creating the actual instance of the mapped object. This may be useful if the mapped Java class does not have a default no-args constructor for example.

For a bean class mapping the properties of the ActionScript 3 class will be mapped to the properties of this factory, not to the properties of the target bean instance. The factory may use these properties any way it wants to create a new bean instance.

For an externalizable class mapping this factory must implement org.spicefactory.cinnamon.io.Externalizable or must be used together with a separate Externalizer that reads an instance of this factory from a AMF3 DataInput.

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

Author:
Jens Halm

Method Summary
 T createInstance()
          Creates and returns a new instance of the mapped object.
 

Method Detail

createInstance

T createInstance()
Creates and returns a new instance of the mapped object.

Returns:
a new instance of the mapped object