org.exolab.castor.mapping.handlers | |
org.exolab.castor.mapping.loader | Implementations for mapping interfaces and the default mapping loader. Version: $Revision: 5951 $ $Date: 2003-03-03 00:05:44 -0700 (Mon, 03 Mar 2003) $ Author: Assaf Arkin |
org.exolab.castor.mapping.xml | XML objects for loading the mapping file. The source in this package is generated using the Castor Source Generator , the schema src/main/resources/org/exolab/castor/mapping/mapping.xsd , and the mapping file src/main/resources/org/exolab/castor/mapping/mapping-binding.xml . |
org.exolab.castor.mapping.xml.descriptors | |
org.exolab.castor.mapping.xml.types | |
org.exolab.castor.mapping.xml.types.descriptors |
ClassDescriptor | Describes the properties of a class and its fields. | code | html |
CollectionHandler | Collection handler for adding/listing elements of a collection. | code | html |
ConfigurableFieldHandler | A FieldHandler that can be configured with any kind of data. | code | html |
FieldDescriptor | Describes the properties of a field. | code | html |
FieldHandler | A field handler knows how to perform various operations on the field that require access to the field value. | code | html |
MapHandler | A Map handler for adding and retreiving key-value pairs from A map. | code | html |
MappingLoader | Provides the mapping descriptor for Java classes. | code | html |
TypeConvertor | Interface for a type convertor. | code | html |
AbstractFieldHandler | An extended version of the FieldHandler interface which is used for adding additional functionality while preserving backward compatability. | code | html |
ExtendedFieldHandler | An extended version of the FieldHandler interface which is used for adding additional functionality while preserving backward compatability. | code | html |
FieldHandlerFactory | An abstract factory class for creating GeneralizedFieldHandlers. | code | html |
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. | code | html |
AccessMode | The access mode for a class. | code | html |
GeneralizedFieldHandler.GFHConverterEnumeration | code | html | |
MapItem | Represents a Mapped Object. | code | html |
Mapping | Utility class for loading mapping files and providing them to the XML marshaller, JDO engine etc. | code | html |
MappingException | An exception indicating an invalid mapping error. | code | html |
MappingRuntimeException | An exception indicating an invalid mapping error. | code | html |
ValidityException | An exception indicating an integrity violation. | code | html |
The Class Mapping API
This package provides a common base for the class mapping descriptors and tools to generate mapping descriptors from a mapping file. The Java objects for the XML-based mapping file are contained in the sub-package xml and the DTD and XML schema originate in this package. The sub-package loader implements a mapping loader.
org.exolab.castor.mapping.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.
org.exolab.castor.mapping.ClassDescriptor is a mapping descriptor for a Java class, consisting of any number of fields. org.exolab.castor.mapping.FieldDescriptor is a mapping descriptor for a Java field within that class. Access to the field value is granted through a org.exolab.castor.mapping.FieldHandler , obtained from the field descriptor.
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 );