org.objectweb.jorm.lib
Class JormConfigurator

java.lang.Object
  |
  +--org.objectweb.jorm.lib.JormConfigurator

public class JormConfigurator
extends java.lang.Object

Used to hold the configuration information related to a JORM compiler instance. The configuration is loaded from the

Author:
P. Dechamboux

Field Summary
static java.lang.String DEFAULT_JORM_CONFIGURATION_FILE
           
static java.lang.String LOGGER_NAME
           
 
Constructor Summary
JormConfigurator()
           
 
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()
           
 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.
 java.lang.Class getGcmClass(java.lang.String mappername)
          Gets the class name of the GenClassMapping associated with the given mapper.
 Generator getGenerator()
          Gets the generator to be used by JORM.
 java.io.InputStream getGlobalJormcOptsFile()
          Gets an InputStream for reading the global compiler parameters.
 java.lang.String getJormcOptsFile()
          Gets the name to be used for the compiler options file.
 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.
 MappingVerifier getMappingVerifier(java.lang.String mappername)
          Gets the verifier associated with the given mapper.
 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.
 MOPFactory getMOPFactory(java.lang.String mappername)
          Gets the MOP factory associated with the given mapper.
 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.
 Verifier getVerifier()
          Gets the verifier to be used by JORM.
 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

LOGGER_NAME

public static final java.lang.String LOGGER_NAME
See Also:
Constant Field Values

DEFAULT_JORM_CONFIGURATION_FILE

public static final java.lang.String DEFAULT_JORM_CONFIGURATION_FILE
See Also:
Constant Field Values
Constructor Detail

JormConfigurator

public JormConfigurator()
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.

Throws:
PException

configure

public void configure()
               throws PException
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.

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.

Parameters:
propertyfile - a properties object
PException

knownMappers

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

Returns:
This list Iterator.
PException

setLoggerFactory

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

Parameters:
lf -

getLoggerFactory

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

Returns:
The logger factory.
PException

getMIManager

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

Returns:
That MI manager.
PException

getParser

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

Returns:
That parser.
PException

getVerifier

public Verifier getVerifier()
                     throws PException
Gets the verifier to be used by JORM.

Returns:
That verifier.
PException

getGenerator

public Generator getGenerator()
                       throws PException
Gets the generator to be used by JORM.

Returns:
That generator.
PException

getJormcOptsFile

public java.lang.String getJormcOptsFile()
                                  throws PException
Gets the name to be used for the compiler options file.

Returns:
That name.
PException

getMIFactory

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

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.

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.

Parameters:
mappername - The name of the concerned mapper.
Returns:
The string giving the class name.
Throws:
PException

getMOPFactory

public MOPFactory getMOPFactory(java.lang.String mappername)
                         throws PException
Gets the MOP factory associated with the given mapper.

Parameters:
mappername - The name of the concerned mapper.
Returns:
The MOPFactory object.
Throws:
PException

getGlobalJormcOptsFile

public java.io.InputStream getGlobalJormcOptsFile()
                                           throws PException
Gets an InputStream for reading the global compiler parameters.

Returns:
The allocated InputStream.
Throws:
PException

getMappingParser

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

Parameters:
mappername - The name of the concerned mapper.
Returns:
The MappingParser object.
Throws:
PException

getMappingVerifier

public MappingVerifier getMappingVerifier(java.lang.String mappername)
                                   throws PException
Gets the verifier associated with the given mapper.

Parameters:
mappername - The name of the concerned mapper.
Returns:
The MappingVerifier object.
Throws:
PException

getWriter

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

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.

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.

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.

Parameters:
mn - The name of the concerned mapper.

removeAllMappers

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


removeSubMapper

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

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.

Parameters:
mn - The concerned mapper.
smn - The submapper to be added.