com.tagtraum.sixbs
Interface Adapter

All Known Implementing Classes:
AbstractAdapter

public interface Adapter

If you want to serialize objects that do not comply to the java beans conventions or objects that were provided by a third party, you should write an Adapter.

Adapters are classes that hold the object you want to serialize. They expose properties through methods, that are easily serializable by SIXBS. I.e. they form an adapter between the actual object and the format SIXBS can process.

If you are serializing an object that has an adapter, the adapter is instantiated and then the Adapter is written, not the object. When you read a serialized Adapter, it instantiates the original object, sets all necessary properties and returns the object, not the adapter.

A class implementing this interface must have a no-argument constructor and a one argument constructor. The argument must be of the type the adapter is adapting to. The adapter class must be named [classname]Adapt and has to be located in the adapter searchpath (see AdapterFinder).

SIXBS will use the get and set methods of the adapter to (de)serialize the bean. Beans using this mechanism must have a no argument constructor.

Version:
$Id: Adapter.java,v 1.2 2001/08/06 16:46:42 Hendrik Exp $
Author:
Hendrik Schreiber
See Also:
AdapterFinder

Field Summary
static java.lang.String vcid
          Source-Version
 
Method Summary
 java.lang.Object deserialize()
          Returns the object that has been initialized from XML by calling the setter methods of a class implementing this interface.
 

Field Detail

vcid

public static final java.lang.String vcid
Source-Version

See Also:
Constant Field Values
Method Detail

deserialize

public java.lang.Object deserialize()
                             throws SIXBSException
Returns the object that has been initialized from XML by calling the setter methods of a class implementing this interface.

Example:

In ArrayListAdapt this method returns an initialized ArrayList. The ArrayList has been initialized by the Adapter, when the ListAdapt.setList(Object[]) method was called by SIXBSReader.

Throws:
SIXBSException