org.objectweb.jorm.metainfo.lib
Class JormManager

java.lang.Object
  extended byorg.objectweb.jorm.metainfo.lib.BasicMetaObject
      extended byorg.objectweb.jorm.metainfo.lib.JormManager
All Implemented Interfaces:
Loggable, Manager, MetaObject, java.io.Serializable

public class JormManager
extends BasicMetaObject
implements Manager

Implementation object of the Manager interface. This interface defines methods to create or find objects which construct the meta information from the description files. This object is managed by the parser system.

Author:
X. Spengler
See Also:
Serialized Form

Field Summary
protected  java.util.Map mappingFactories
          this structure defines all the mapping factories declared in the meta information manager.
protected  java.util.Map packages
          this structure defines all declared schema in the current manager.
protected  PTypeSpace ptypeSpace
          TBD
 
Fields inherited from class org.objectweb.jorm.metainfo.lib.BasicMetaObject
debug, logger, loggerFactory, parent
 
Constructor Summary
JormManager()
           
 
Method Summary
 void addMappingFactory(java.lang.String mapperName, MappingFactory factory)
          Adds a mapping factory to the current metainformation manager.
 Class createClass(java.lang.String fqclassName)
           
 CompositeName createCompositeName(java.lang.String fqcompositeNameName)
           
 Package createPackage(java.lang.String schemaName)
          Returns a new schema.
protected  java.util.Collection getChildren()
           
 Class getClass(java.lang.String className)
          searches a class into all the declared schemas and returns it.
 java.util.Collection getClasses()
          build an iterator to iterates all classes of the meta-info
 CompositeName getCompositeName(java.lang.String fqcompositeNameName)
           
 java.util.Collection getCompositeNames()
          build an iterator to iterates all classes of the meta-info
 java.util.Collection getJormObjects()
           
 java.util.Collection getMappingFactories()
           
 MappingFactory getMappingFactory(java.lang.String mapperName)
          Returns a mapping factory corresponding to a mapper name.
 Package getPackage(java.lang.String schemaName)
          Returns an existing schema.
 java.util.Collection getPackages()
          Allows to know all the declared schemas into the current metainformation manager.
 PTypeSpace getPTypeSpace()
          TBD
 void init()
          Initializes the current Manager.
 
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.MetaObject
getParent, setParent
 

Field Detail

packages

protected java.util.Map packages
this structure defines all declared schema in the current manager. key: the name of the schema value: a Package object


mappingFactories

protected java.util.Map mappingFactories
this structure defines all the mapping factories declared in the meta information manager. key: the name of the mapper value: a MappingFactory object


ptypeSpace

protected PTypeSpace ptypeSpace
TBD

Constructor Detail

JormManager

public JormManager()
Method Detail

init

public void init()
Initializes the current Manager. This method replaces the constructor method.

Specified by:
init in interface Manager

getPackage

public Package getPackage(java.lang.String schemaName)
Returns an existing schema. If no Package corresponds to the given name, null is returned.

Specified by:
getPackage in interface Manager
Parameters:
schemaName - the name of the schema
Returns:
a Package object. If the schema does not exist, null is returned.

createPackage

public Package createPackage(java.lang.String schemaName)
Returns a new schema. This method is the factory method to create schema object. If the schemaName schema already exists, it is returned.

Specified by:
createPackage in interface Manager
Parameters:
schemaName - the name of the schema
Returns:
a new schema object, or the existing one if already defined

getPackages

public java.util.Collection getPackages()
Allows to know all the declared schemas into the current metainformation manager. This iterator contains Package object.

Specified by:
getPackages in interface Manager
Returns:
an iterator on registered Package object. If there is no schema, an empty iterator is returned.

addMappingFactory

public void addMappingFactory(java.lang.String mapperName,
                              MappingFactory factory)
Adds a mapping factory to the current metainformation manager. A mapping factory is a factory to map object (class, field, ...).

Specified by:
addMappingFactory in interface Manager
Parameters:
mapperName - the name of the mapper (i.e: OR for rdb)
factory - the mapping factory to add to the list of existing mapping factories

getMappingFactory

public MappingFactory getMappingFactory(java.lang.String mapperName)
Returns a mapping factory corresponding to a mapper name. If no MappingFactory corresponds to the mapper name, null is returned.

Specified by:
getMappingFactory in interface Manager
Parameters:
mapperName - the name of the mapper to obtain
Returns:
a mapping factory. If the mapping factory does not exist for the mapper, null is returned.

getMappingFactories

public java.util.Collection getMappingFactories()
Specified by:
getMappingFactories in interface Manager

getPTypeSpace

public PTypeSpace getPTypeSpace()
TBD

Specified by:
getPTypeSpace in interface Manager

getClasses

public java.util.Collection getClasses()
build an iterator to iterates all classes of the meta-info

Specified by:
getClasses in interface Manager
Returns:
a new iterator

getCompositeNames

public java.util.Collection getCompositeNames()
build an iterator to iterates all classes of the meta-info

Specified by:
getCompositeNames in interface Manager
Returns:
a new iterator

getJormObjects

public java.util.Collection getJormObjects()
Specified by:
getJormObjects in interface Manager

getClass

public Class getClass(java.lang.String className)
searches a class into all the declared schemas and returns it. If no class corresponds to this name, null is returned.

Specified by:
getClass in interface Manager
Parameters:
className - the name of the class to search
Returns:
the Class object found, null if not found.

createClass

public Class createClass(java.lang.String fqclassName)
Specified by:
createClass in interface Manager

getCompositeName

public CompositeName getCompositeName(java.lang.String fqcompositeNameName)
Specified by:
getCompositeName in interface Manager

createCompositeName

public CompositeName createCompositeName(java.lang.String fqcompositeNameName)
Specified by:
createCompositeName in interface Manager

getChildren

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