org.objectweb.jorm.metainfo.lib
Class BasicClassMapping

java.lang.Object
  extended byorg.objectweb.jorm.metainfo.lib.BasicMetaObject
      extended byorg.objectweb.jorm.metainfo.lib.BasicMappingStructure
          extended byorg.objectweb.jorm.metainfo.lib.BasicHelperClassMapping
              extended byorg.objectweb.jorm.metainfo.lib.BasicClassMapping
All Implemented Interfaces:
ClassMapping, HelperClassMapping, Loggable, MappingStructure, MetaObject, java.io.Serializable
Direct Known Subclasses:
FosClassMapping, RdbClassMapping

public class BasicClassMapping
extends BasicHelperClassMapping
implements ClassMapping

BasicClassMapping is THE basic implementation of the ClassMapping interface. * Its defines basic methods, and must be extended to different mappers.

Author:
X. Spengler
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.objectweb.jorm.metainfo.lib.BasicMappingStructure
logger
 
Constructor Summary
BasicClassMapping(java.lang.String ruleName, MetaObject linkedMO, MetaObject parent)
          Builds a new BasicClassMapping.
 
Method Summary
 void addReferenceMapping(ReferenceMapping refMapping)
          Adds a ReferenceMapping object.
 ReferenceMapping createReferenceMapping(java.lang.String ruleName, NameDef nd)
          Creates a new ReferenceMapping object.
 ReferenceMapping getReferenceMapping(java.lang.String referenceName)
          Retrieves the ReferenceMapping instance corresponding to the name of a reference field.
 java.util.Collection getReferenceMappings()
          Returns a collection of ReferenceMapping objects.
 java.util.Iterator iterateReferenceMappings()
          Returns an Iterator over ReferenceMapping objects.
 
Methods inherited from class org.objectweb.jorm.metainfo.lib.BasicHelperClassMapping
addDependency, addPrimitiveElementMapping, addPrimitiveElementMapping, createIdentifierMapping, getDependencies, getIdentifierMapping, getPrimitiveElementMapping, getPrimitiveElementMappings, getRuleName, iteratePrimitiveElementMappings, removeDependency, setIdentifierMapping, setRuleName
 
Methods inherited from class org.objectweb.jorm.metainfo.lib.BasicMappingStructure
getLinkedMO, getLogger, getLoggerFactory, getMapperName, getProjectName, setLinkedMO, setLogger, setLoggerFactory
 
Methods inherited from class org.objectweb.jorm.metainfo.lib.BasicMetaObject
getManager, getParent, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.jorm.metainfo.api.HelperClassMapping
addDependency, addPrimitiveElementMapping, addPrimitiveElementMapping, createIdentifierMapping, getDependencies, getIdentifierMapping, getPrimitiveElementMapping, getPrimitiveElementMappings, getRuleName, iteratePrimitiveElementMappings, removeDependency, setIdentifierMapping, setRuleName
 
Methods inherited from interface org.objectweb.jorm.metainfo.api.MappingStructure
getLinkedMO, getLogger, getLoggerFactory, getMapperName, getProjectName, setLinkedMO, setLogger, setLoggerFactory
 
Methods inherited from interface org.objectweb.jorm.metainfo.api.MetaObject
getParent, setParent
 

Constructor Detail

BasicClassMapping

public BasicClassMapping(java.lang.String ruleName,
                         MetaObject linkedMO,
                         MetaObject parent)
Builds a new BasicClassMapping.

Parameters:
ruleName - the name of the rule used to map the class, linkedMO the object referenced by the current object, parent the parent of the current object.
Method Detail

addReferenceMapping

public void addReferenceMapping(ReferenceMapping refMapping)
Adds a ReferenceMapping object.

Specified by:
addReferenceMapping in interface ClassMapping
Parameters:
refMapping - the ReferenceMapping object to add to the list.

createReferenceMapping

public ReferenceMapping createReferenceMapping(java.lang.String ruleName,
                                               NameDef nd)
Description copied from interface: HelperClassMapping
Creates a new ReferenceMapping object.

Specified by:
createReferenceMapping in interface HelperClassMapping
Overrides:
createReferenceMapping in class BasicHelperClassMapping
Parameters:
ruleName - the name of the rule used to map the reference, nd the NameDef object that defines an object reference.
Returns:
a ReferenceMapping object.

getReferenceMapping

public ReferenceMapping getReferenceMapping(java.lang.String referenceName)
Description copied from interface: ClassMapping
Retrieves the ReferenceMapping instance corresponding to the name of a reference field.

Specified by:
getReferenceMapping in interface ClassMapping
Parameters:
referenceName - is the name of a reference field
Returns:
a ReferenceMapping instance or a null value if no mapping is defined for the reference name

iterateReferenceMappings

public java.util.Iterator iterateReferenceMappings()
Returns an Iterator over ReferenceMapping objects.

Specified by:
iterateReferenceMappings in interface ClassMapping
Returns:
an Iterator.

getReferenceMappings

public java.util.Collection getReferenceMappings()
Returns a collection of ReferenceMapping objects.

Specified by:
getReferenceMappings in interface ClassMapping
Returns:
a collection.