tagtraum industries: SIXBS - Simple XML Bean Serialization: Interface Adapter

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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. form an adapter between the actual object and the format SIXBS can process.

If you try to write an object that has an adapter, this 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 arg constructor and a one arg constructor. The arg must be of the type the adapter is adapting to. The adapter class must be named `[classname]Adapt` and has to be present 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 have to have a no arg constructor.

Version:
  $Id: Adapter.java,v 1.1 2001/05/06 14:55:01 Hendrik Exp $
Author:
  Hendrik Schreiber
See Also:
  `AdapterFinder`

Field Summary
`static String` | `vcid` Source-Version

Method Summary
`Object` | `deserialize()` 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`.

Field Detail

### vcid

    public static final String vcid

  Source-Version

Method Detail

### deserialize

    public 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`.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001 tagtraum industries.