org.objectweb.jorm.mapper.fos.metainfo
Class FosClassMapping

java.lang.Object
  extended byorg.objectweb.jorm.metainfo.lib.BasicMetaObject
      extended byorg.objectweb.jorm.metainfo.lib.BasicMappingStructure
          extended byorg.objectweb.jorm.metainfo.lib.BasicCommonClassMapping
              extended byorg.objectweb.jorm.metainfo.lib.BasicClassMapping
                  extended byorg.objectweb.jorm.mapper.fos.metainfo.FosClassMapping
All Implemented Interfaces:
ClassMapping, CommonClassMapping, FosMappingInfos, Loggable, MappingStructure, MetaObject, java.io.Serializable

public class FosClassMapping
extends BasicClassMapping
implements FosMappingInfos

Author:
P. Dechamboux
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.objectweb.jorm.metainfo.lib.BasicClassMapping
parentClassMappings
 
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
FosClassMapping(MetaObject linkedMO, MetaObject parent)
          Builds a new BasicFosClassMapping.
 
Method Summary
 void addFieldMapping(java.lang.String fn)
          Adds a field mapping for this field with the given name.
 void addImplicitDependencies()
          Add implicit dependencies of mapping structure creation to mapping structure definition.
 ParentClassMapping createImplicitParentClassMapping(Class superClass)
          Creates a implicit parent class mapping.
 java.lang.String getDirName()
          Retrieves the name of the directory where class objects are stored.
 PrimitiveElementMapping getPrimitiveElementMapping(java.lang.String fieldName, boolean searchInSuper)
          Get the primitive element mapping corresponding to a field name by searching recursively in the super classes until it is found (if requested)
 void setDirName(java.lang.String dirname)
          Assigns the name of the directory where class objects are stored.
 void setLogger(Logger logger)
          Assigns a logger to an component that wants to log things.
 void setLoggerFactory(LoggerFactory loggerfactory)
          Assigns a logger factory that allows the creation of new loggers.
 
Methods inherited from class org.objectweb.jorm.metainfo.lib.BasicClassMapping
addParentClassMapping, addReferenceMapping, createParentClassMapping, createReferenceMapping, getChildren, getJormClass, getParentClassMapping, getParentClassMappings, getReferenceMapping, getReferenceMappings, iterateParentClassMappings, iterateReferenceMappings
 
Methods inherited from class org.objectweb.jorm.metainfo.lib.BasicCommonClassMapping
addDependency, addPrimitiveElementMapping, addPrimitiveElementMapping, createIdentifierMapping, getAllPrimitiveElementMappings, getDependencies, getIdentifierMapping, getPrimitiveElementMapping, getPrimitiveElementMappings, getRuleName, primitiveElementMappingsIterator, 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
getLogger, getLoggerFactory, getManager, getParent, 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.CommonClassMapping
addDependency, addPrimitiveElementMapping, addPrimitiveElementMapping, createIdentifierMapping, getAllPrimitiveElementMappings, getDependencies, getIdentifierMapping, getPrimitiveElementMapping, getPrimitiveElementMappings, getRuleName, primitiveElementMappingsIterator, 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

FosClassMapping

public FosClassMapping(MetaObject linkedMO,
                       MetaObject parent)
Builds a new BasicFosClassMapping.

Parameters:
linkedMO - the object referenced by the current object,
parent - the parent of the current object.
Method Detail

getDirName

public java.lang.String getDirName()
Retrieves the name of the directory where class objects are stored.

Specified by:
getDirName in interface FosMappingInfos
Returns:
The directory name.

setDirName

public void setDirName(java.lang.String dirname)
Assigns the name of the directory where class objects are stored.

Specified by:
setDirName in interface FosMappingInfos
Parameters:
dirname - The directory name.

addFieldMapping

public void addFieldMapping(java.lang.String fn)
Adds a field mapping for this field with the given name.

Parameters:
fn - A field name (hidden or not).

createImplicitParentClassMapping

public ParentClassMapping createImplicitParentClassMapping(Class superClass)
Description copied from interface: ClassMapping
Creates a implicit parent class mapping. This method is called to create parent class mapping to super classes for which there is no parent class mapping defined, which means that an implicit inheritance rule of mapping should be applied. For example, with the rdb mapper, this implicit rule is to inherit all the mappings defined in the super class.

Specified by:
createImplicitParentClassMapping in interface ClassMapping
Parameters:
superClass - the super class that will be referenced by this parent class mapping
Returns:
a parent class mapping with in implicit rule to the super class

addImplicitDependencies

public void addImplicitDependencies()
Description copied from interface: ClassMapping
Add implicit dependencies of mapping structure creation to mapping structure definition. For example, in the case of relational mappings, the creation of tables cannot be known until all the columns of the table is known and those columns may not be known until the mapping of super/sub classes is known.

Specified by:
addImplicitDependencies in interface ClassMapping

getPrimitiveElementMapping

public PrimitiveElementMapping getPrimitiveElementMapping(java.lang.String fieldName,
                                                          boolean searchInSuper)
Description copied from interface: ClassMapping
Get the primitive element mapping corresponding to a field name by searching recursively in the super classes until it is found (if requested)

Specified by:
getPrimitiveElementMapping in interface ClassMapping
Parameters:
fieldName - the name of the field of which the primitive element mapping must be returned
searchInSuper - if true search recursively in super classes
Returns:
the primitive element mapping if found, null otherwise

setLogger

public void setLogger(Logger logger)
Description copied from interface: Loggable
Assigns a logger to an component that wants to log things.

Specified by:
setLogger in interface Loggable
Overrides:
setLogger in class BasicMetaObject

setLoggerFactory

public void setLoggerFactory(LoggerFactory loggerfactory)
Description copied from interface: Loggable
Assigns a logger factory that allows the creation of new loggers.

Specified by:
setLoggerFactory in interface Loggable
Overrides:
setLoggerFactory in class BasicMetaObject