Prev Package | Next Package | Frames | No Frames |
Interface Summary | |
ClassDescriptor | Describes the properties of a class and its fields. |
CollectionHandler | Collection handler for adding/listing elements of a collection. |
FieldDescriptor | Describes the properties of a field. |
FieldHandler | A field handler knows how to perform various operations on the field that require access to the field value. |
MapHandler | A Map handler for adding and retreiving key-value pairs from A map. |
MappingResolver | Provides the mapping descriptor for Java classes. |
TypeConvertor | Interface for a type convertor. |
Class Summary | |
AbstractFieldHandler | An extended version of the FieldHandler interface which is used for adding additional functionality while preserving backward compatability. |
AccessMode | The access mode for a class. |
ExtendedFieldHandler | An extended version of the FieldHandler interface which is used for adding additional functionality while preserving backward compatability. |
GeneralizedFieldHandler | An extended version of the FieldHandler interface which is used for making generic libraries of FieldHandlers which can be used for more than one field or class, but have similar conversion algorithms. |
MapItem | Represents a Mapped Object. |
Mapping | Utility class for loading mapping files and providing them to the XML marshaller, JDO engine etc. |
Mapping.ClassMappingResolver | An IDResolver to allow us to resolve ClassMappings from included Mapping files |
Mapping.EngineMapping | Associates engine name (XML, JDO, etc) with the class of its mapping loader. |
Mapping.MappingState | A class to keep track of the loaded mapping. |
MappingException | An exception indicating an invalid mapping error. |
MappingRuntimeException | An exception indicating an invalid mapping error. |
ValidityException | An exception indicating an integrity violation. |
Mapping
serves as a generic mapping loader that can
be used to load multiple mapping files and feed them to the XML marshaller, JDO engine,
and DAX engine.
ClassDescriptor
is a mapping descriptor for a Java class,
consisting of any number of fields. FieldDescriptor
is a
mapping descriptor for a Java field within that class. Access to the field value is granted
through a FieldHandler
, obtained from the field descriptor.
MappingResolver
is an interface to a collection of class
mapping that can provide the mapping descriptor for a particular Java class. A MappingResolver
is constructed using a mapping loader, see the loader package.
The following example illustrates how to load a mapping file with the current class
loader and use it to marshal an object:
Mapping map; Marshaller mar; // Load the specified mapping file map = new Mapping( getClass().getClassLoader() ); map.loadMapping( "mapping.xml" ); // Marshal the object into a document mar = new Marshaller( output ); mar.setMapping( mapping ); mar.marshal( object );