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.BasicMetaObject
logger, loggerFactory, parent
 
Constructor Summary
BasicClassMapping(java.lang.String ruleName, MetaObject linkedMO, MetaObject parent)
          Builds a new BasicClassMapping.
 
Method Summary
 void addParentClassMapping(ParentClassMapping pcm)
          Adds a ParentClassMapping object.
 void addReferenceMapping(ReferenceMapping refMapping)
          Adds a ReferenceMapping object.
 ParentClassMapping createParentClassMapping(java.lang.String ruleName, Extension parentClass)
          Creates a new ParentClassMapping object.
 ReferenceMapping createReferenceMapping(java.lang.String ruleName, NameDef nd)
          Creates a new ReferenceMapping object.
 java.util.Collection getParentClassMappings()
          Returns a collection of ParentClassMapping objects.
 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 iterateParentClassMappings()
          Returns an Iterator over ParentClassMapping 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, getMapperName, getProjectName, setLinkedMO
 
Methods inherited from class org.objectweb.jorm.metainfo.lib.BasicMetaObject
getChildren, getLogger, getLoggerFactory, getManager, getParent, setLogger, setLoggerFactory, setLoggingOnChild, 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, getMapperName, getProjectName, setLinkedMO
 
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.

addParentClassMapping

public void addParentClassMapping(ParentClassMapping pcm)
Adds a ParentClassMapping object.

Parameters:
pcm - the ParentClassMapping object to add to the list.

createParentClassMapping

public ParentClassMapping createParentClassMapping(java.lang.String ruleName,
                                                   Extension parentClass)
Creates a new ParentClassMapping object.

Parameters:
ruleName - the name of the rule used to map the reference, parentClass the name of a parent class.
Returns:
a ParentClassMapping object.

iterateParentClassMappings

public java.util.Iterator iterateParentClassMappings()
Returns an Iterator over ParentClassMapping objects.

Returns:
an Iterator.

getParentClassMappings

public java.util.Collection getParentClassMappings()
Returns a collection of ParentClassMapping objects.

Returns:
a collection.