org.objectweb.jorm.lib
Class JormConfiguratorImpl

java.lang.Object
  extended byorg.objectweb.jorm.lib.JormConfiguratorImpl
All Implemented Interfaces:
JormConfigurator
Direct Known Subclasses:
JormCompilerConfiguratorImpl

public class JormConfiguratorImpl
extends java.lang.Object
implements JormConfigurator

Used to hold the configuration information related to the JORM runtime.

Author:
P. Dechamboux

Field Summary
protected  java.lang.ClassLoader loader
           
protected  Logger logger
           
protected  LoggerFactory loggerFactory
           
protected  java.util.Properties logProperties
           
protected  java.util.HashMap mappers
           
protected  java.lang.String pathToJormcOpts
           
protected  java.util.Properties properties
           
 
Fields inherited from interface org.objectweb.jorm.api.JormConfigurator
DEFAULT_JORM_CONFIGURATION_FILE, LOGGER_NAME, USE_CONTEXT_CLASSLOADER
 
Constructor Summary
JormConfiguratorImpl()
           
 
Method Summary
 void addSubMapper(java.lang.String mn, java.lang.String smn)
          Adds this submapper to the list of the ones used for generation.
 void configure()
          Configures the JORM compiler by loading information related to the different mappers supported by this instance of JORM using the default property file.
 void configure(java.util.Properties p)
          Configures the JORM compiler by loading information related to the different mappers supported by this instance of JORM.
 void configure(java.lang.String propertyfile)
          Configures the JORM compiler by loading information related to the different mappers supported by this instance of JORM.
 void configureLog(java.lang.String propertyfile)
          Configures the logger factory object with a properties object.
 void configureMIManager(Manager miman)
          Configures the MI manager associated with either a JORM compiler or a simple mapper.
 void configureParser(Parser parser, java.util.ArrayList dtdlocs, PathExplorer pe, Manager miman)
          Configures the parser associated with either a JORM compiler or a simple mapper.
 java.lang.Class getGcmClass(java.lang.String mappername)
          Gets the class name of the GenClassMapping associated with the given mapper.
 LoggerFactory getLoggerFactory()
          Gets the logger factory associated with this instance of JORM.
 MappingDomtreeBuilder getMappingDomtreeBuilder(java.lang.String mappername)
          Gets the MappingDomTreeBuilder object associated with the given mapper.
 MappingParser getMappingParser(java.lang.String mappername)
          Gets the parser associated with the given mapper for mapping infos.
 MappingFactory getMIFactory(java.lang.String mappername)
          Gets the MI factory associated with the given mapper.
 Manager getMIManager()
          Gets the MI manager to be used by JORM.
 Parser getParser()
          Gets the parser to be used by JORM.
 PMappingStructuresManager getSchMgr(java.lang.String mappername)
          Gets the schema manager associated with the given mapper.
 java.util.Collection getSubMappers(java.lang.String mappername)
          Gets the submappers associated with a given mapper.
 Writer getWriter()
          Gets the BasicDomWriter object.
 java.util.Iterator knownMappers()
          Lists the names of supported mappers.
 void removeAllMappers()
          Removes all mappers from the list of the ones used for generation.
 void removeMapper(java.lang.String mn)
          Removes this mapper from the list of the ones used for generation.
 void removeSubMapper(java.lang.String mn, java.lang.String smn)
          Removes this submapper from the list of the ones used for generation.
 void setLoggerFactory(LoggerFactory lf)
          It assignes the logger factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

properties

protected java.util.Properties properties

logProperties

protected java.util.Properties logProperties

pathToJormcOpts

protected java.lang.String pathToJormcOpts

mappers

protected java.util.HashMap mappers

loggerFactory

protected LoggerFactory loggerFactory

logger

protected Logger logger

loader

protected java.lang.ClassLoader loader
Constructor Detail

JormConfiguratorImpl

public JormConfiguratorImpl()
Method Detail

configure

public void configure(java.lang.String propertyfile)
               throws PException
Configures the JORM compiler by loading information related to the different mappers supported by this instance of JORM.

Specified by:
configure in interface JormConfigurator
Throws:
PException

configure

public void configure()
               throws PException
Description copied from interface: JormConfigurator
Configures the JORM compiler by loading information related to the different mappers supported by this instance of JORM using the default property file.

Specified by:
configure in interface JormConfigurator
Throws:
PException

configure

public void configure(java.util.Properties p)
Configures the JORM compiler by loading information related to the different mappers supported by this instance of JORM.

Specified by:
configure in interface JormConfigurator
Parameters:
p - is the properties containing the jorm configuration

configureLog

public void configureLog(java.lang.String propertyfile)
                  throws PException
Configures the logger factory object with a properties object.

Specified by:
configureLog in interface JormConfigurator
Parameters:
propertyfile - a properties object
Throws:
PException

configureMIManager

public void configureMIManager(Manager miman)
                        throws PException
Configures the MI manager associated with either a JORM compiler or a simple mapper.

Specified by:
configureMIManager in interface JormConfigurator
Parameters:
miman - The MI manager to be configured
Throws:
PException

configureParser

public void configureParser(Parser parser,
                            java.util.ArrayList dtdlocs,
                            PathExplorer pe,
                            Manager miman)
                     throws PException
Configures the parser associated with either a JORM compiler or a simple mapper.

Specified by:
configureParser in interface JormConfigurator
Parameters:
parser - The parser to be configured
dtdlocs - Possible locations of DTDs
pe - Path explorer to be used
miman - The MI manager to be used by the parser
Throws:
PException

knownMappers

public java.util.Iterator knownMappers()
                                throws PException
Lists the names of supported mappers.

Specified by:
knownMappers in interface JormConfigurator
Returns:
This list Iterator.
Throws:
PException

setLoggerFactory

public void setLoggerFactory(LoggerFactory lf)
It assignes the logger factory.

Specified by:
setLoggerFactory in interface JormConfigurator
Parameters:
lf -

getLoggerFactory

public LoggerFactory getLoggerFactory()
                               throws PException
Gets the logger factory associated with this instance of JORM.

Specified by:
getLoggerFactory in interface JormConfigurator
Returns:
The logger factory.
Throws:
PException

getMIManager

public Manager getMIManager()
                     throws PException
Gets the MI manager to be used by JORM.

Specified by:
getMIManager in interface JormConfigurator
Returns:
That MI manager.
Throws:
PException

getParser

public Parser getParser()
                 throws PException
Gets the parser to be used by JORM.

Specified by:
getParser in interface JormConfigurator
Returns:
That parser.
Throws:
PException

getMIFactory

public MappingFactory getMIFactory(java.lang.String mappername)
                            throws PException
Gets the MI factory associated with the given mapper.

Specified by:
getMIFactory in interface JormConfigurator
Parameters:
mappername - The name of the concerned mapper.
Returns:
The MappingFactory object.
Throws:
PException

getSchMgr

public PMappingStructuresManager getSchMgr(java.lang.String mappername)
                                    throws PException
Gets the schema manager associated with the given mapper.

Specified by:
getSchMgr in interface JormConfigurator
Parameters:
mappername - The name of the concerned mapper.
Returns:
The PMappingStructuresManager object.
Throws:
PException

getGcmClass

public java.lang.Class getGcmClass(java.lang.String mappername)
                            throws PException
Gets the class name of the GenClassMapping associated with the given mapper.

Specified by:
getGcmClass in interface JormConfigurator
Parameters:
mappername - The name of the concerned mapper.
Returns:
The string giving the class name.
Throws:
PException

getMappingParser

public MappingParser getMappingParser(java.lang.String mappername)
                               throws PException
Gets the parser associated with the given mapper for mapping infos.

Specified by:
getMappingParser in interface JormConfigurator
Parameters:
mappername - The name of the concerned mapper.
Returns:
The MappingParser object.
Throws:
PException

getWriter

public Writer getWriter()
                 throws PException
Gets the BasicDomWriter object.

Specified by:
getWriter in interface JormConfigurator
Returns:
The BasicDomWriter object.
Throws:
PException

getMappingDomtreeBuilder

public MappingDomtreeBuilder getMappingDomtreeBuilder(java.lang.String mappername)
                                               throws PException
Gets the MappingDomTreeBuilder object associated with the given mapper.

Specified by:
getMappingDomtreeBuilder in interface JormConfigurator
Parameters:
mappername - The name of the concerned mapper.
Returns:
The MappingDomTreeBuilder object.
Throws:
PException

getSubMappers

public java.util.Collection getSubMappers(java.lang.String mappername)
                                   throws PException
Gets the submappers associated with a given mapper.

Specified by:
getSubMappers in interface JormConfigurator
Parameters:
mappername - The concerned mapper.
Returns:
The collection of the names of submappers.
Throws:
PException

removeMapper

public void removeMapper(java.lang.String mn)
Removes this mapper from the list of the ones used for generation.

Specified by:
removeMapper in interface JormConfigurator
Parameters:
mn - The name of the concerned mapper.

removeAllMappers

public void removeAllMappers()
Removes all mappers from the list of the ones used for generation.

Specified by:
removeAllMappers in interface JormConfigurator

removeSubMapper

public void removeSubMapper(java.lang.String mn,
                            java.lang.String smn)
Removes this submapper from the list of the ones used for generation.

Specified by:
removeSubMapper in interface JormConfigurator
Parameters:
mn - The concerned mapper.
smn - The submapper to be removed.

addSubMapper

public void addSubMapper(java.lang.String mn,
                         java.lang.String smn)
Adds this submapper to the list of the ones used for generation.

Specified by:
addSubMapper in interface JormConfigurator
Parameters:
mn - The concerned mapper.
smn - The submapper to be added.