org.objectweb.jorm.metainfo.lib
Class BasicCommonClassMapping

java.lang.Object
  extended byorg.objectweb.jorm.metainfo.lib.BasicMetaObject
      extended byorg.objectweb.jorm.metainfo.lib.BasicMappingStructure
          extended byorg.objectweb.jorm.metainfo.lib.BasicCommonClassMapping
All Implemented Interfaces:
CommonClassMapping, Loggable, MappingStructure, MetaObject, java.io.Serializable
Direct Known Subclasses:
BasicClassMapping, BasicGenClassMapping

public class BasicCommonClassMapping
extends BasicMappingStructure
implements CommonClassMapping

Description

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.objectweb.jorm.metainfo.lib.BasicMappingStructure
linkedMO
 
Fields inherited from class org.objectweb.jorm.metainfo.lib.BasicMetaObject
debug, logger, loggerFactory, parent
 
Constructor Summary
BasicCommonClassMapping(java.lang.String ruleName, MetaObject linkedMO, MetaObject parent)
          Builds a new BasicCommonClassMapping object.
 
Method Summary
 void addDependency(java.lang.String jormClassName)
          add a dependency to a given jorm class
 void addPrimitiveElementMapping(PrimitiveElementMapping peMapping)
          Adds a PrimitiveElementMapping object.
 void addPrimitiveElementMapping(java.lang.String fieldName, PrimitiveElementMapping peMapping)
          Adds a PrimitiveElementMapping object.
 IdentifierMapping createIdentifierMapping(NameDef nd)
          Creates a new IdentifierMapping object.
 ReferenceMapping createReferenceMapping(java.lang.String ruleName, NameDef nd)
          Creates a new ReferenceMapping object.
 java.util.List getAllPrimitiveElementMappings()
          Important: This method returns only the PrimitiveElementMapping objects of the class.
protected  java.util.Collection getChildren()
           
 java.util.Collection getDependencies()
          Returns the set of class names (Strings) of which the class mapping is dependent
 IdentifierMapping getIdentifierMapping()
          Returns the IdentifierMapping object.
 PrimitiveElementMapping getPrimitiveElementMapping(java.lang.String fieldName)
          Returns the PrimitiveElementMapping objects (hidden or not) matching a given fieldName.
 java.util.Collection getPrimitiveElementMappings()
          Returns a collection of PrimitiveElementMapping objects.
 java.lang.String getRuleName()
          Returns the name of the rule used to map the class.
 java.util.Iterator primitiveElementMappingsIterator()
          Returns an Iterator over PrimitiveElementMapping objects.
 void removeDependency(java.lang.String jormClassName)
          remove a dependency to a given jorm class
 void setIdentifierMapping(IdentifierMapping idmapping)
          Sets the IdentifierMapping object.
 void setRuleName(java.lang.String rulename)
          Sets the name of the rule used to map the class.
 
Methods inherited from class org.objectweb.jorm.metainfo.lib.BasicMappingStructure
getLinkedMO, getMapperName, getProjectName, setLinkedMO
 
Methods inherited from class org.objectweb.jorm.metainfo.lib.BasicMetaObject
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.MappingStructure
getLinkedMO, getMapperName, getProjectName, setLinkedMO
 
Methods inherited from interface org.objectweb.jorm.metainfo.api.MetaObject
getParent, setParent
 

Constructor Detail

BasicCommonClassMapping

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

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

getRuleName

public java.lang.String getRuleName()
Returns the name of the rule used to map the class.

Specified by:
getRuleName in interface CommonClassMapping
Returns:
the name of the rule.

setRuleName

public void setRuleName(java.lang.String rulename)
Sets the name of the rule used to map the class.

Specified by:
setRuleName in interface CommonClassMapping
Parameters:
rulename - the name of the rule.

getIdentifierMapping

public IdentifierMapping getIdentifierMapping()
Returns the IdentifierMapping object.

Specified by:
getIdentifierMapping in interface CommonClassMapping
Returns:
an IdentifierMapping object.

setIdentifierMapping

public void setIdentifierMapping(IdentifierMapping idmapping)
Sets the IdentifierMapping object.

Specified by:
setIdentifierMapping in interface CommonClassMapping
Parameters:
idmapping - the IdentifierMapping object.

getPrimitiveElementMappings

public java.util.Collection getPrimitiveElementMappings()
Returns a collection of PrimitiveElementMapping objects.

Specified by:
getPrimitiveElementMappings in interface CommonClassMapping
Returns:
a collection.

getAllPrimitiveElementMappings

public java.util.List getAllPrimitiveElementMappings()
Important: This method returns only the PrimitiveElementMapping objects of the class.

Specified by:
getAllPrimitiveElementMappings in interface CommonClassMapping
Returns:
a collection.

getPrimitiveElementMapping

public PrimitiveElementMapping getPrimitiveElementMapping(java.lang.String fieldName)
Description copied from interface: CommonClassMapping
Returns the PrimitiveElementMapping objects (hidden or not) matching a given fieldName.

Specified by:
getPrimitiveElementMapping in interface CommonClassMapping
Parameters:
fieldName - the name of the primitivite field (hidden or not) of the class of which the PEM must be returned
Returns:
the PEM matching the given field name

addPrimitiveElementMapping

public void addPrimitiveElementMapping(PrimitiveElementMapping peMapping)
Adds a PrimitiveElementMapping object.

Specified by:
addPrimitiveElementMapping in interface CommonClassMapping
Parameters:
peMapping - the PrimitiveElementMapping object to add to the list.

addPrimitiveElementMapping

public void addPrimitiveElementMapping(java.lang.String fieldName,
                                       PrimitiveElementMapping peMapping)
Adds a PrimitiveElementMapping object.

Specified by:
addPrimitiveElementMapping in interface CommonClassMapping
Parameters:
peMapping - the PrimitiveElementMapping object to add to the list.

primitiveElementMappingsIterator

public java.util.Iterator primitiveElementMappingsIterator()
Returns an Iterator over PrimitiveElementMapping objects.

Specified by:
primitiveElementMappingsIterator in interface CommonClassMapping
Returns:
an Iterator.

createIdentifierMapping

public IdentifierMapping createIdentifierMapping(NameDef nd)
Creates a new IdentifierMapping object.

Specified by:
createIdentifierMapping in interface CommonClassMapping
Parameters:
nd - the NameDef object that defines an object identifier.
Returns:
an IdentifierMapping object.

createReferenceMapping

public ReferenceMapping createReferenceMapping(java.lang.String ruleName,
                                               NameDef nd)
Creates a new ReferenceMapping object.

Specified by:
createReferenceMapping in interface CommonClassMapping
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.

addDependency

public void addDependency(java.lang.String jormClassName)
Description copied from interface: CommonClassMapping
add a dependency to a given jorm class

Specified by:
addDependency in interface CommonClassMapping
Parameters:
jormClassName - the name of the class to which depends the class mapping

removeDependency

public void removeDependency(java.lang.String jormClassName)
Description copied from interface: CommonClassMapping
remove a dependency to a given jorm class

Specified by:
removeDependency in interface CommonClassMapping
Parameters:
jormClassName - the name of the class to which the class mapping does not depend anymore

getDependencies

public java.util.Collection getDependencies()
Description copied from interface: CommonClassMapping
Returns the set of class names (Strings) of which the class mapping is dependent

Specified by:
getDependencies in interface CommonClassMapping
Returns:
the set of class names (Strings) of which the class mapping is dependent

getChildren

protected java.util.Collection getChildren()
Overrides:
getChildren in class BasicMetaObject