org.objectweb.jorm.comp.generator.lib
Class JormGeneratorImpl

java.lang.Object
  |
  +--org.objectweb.jorm.comp.generator.lib.JormGeneratorImpl
All Implemented Interfaces:
Generator, JormGenerator, Loggable

public class JormGeneratorImpl
extends java.lang.Object
implements JormGenerator, Loggable

This class start the generations of the jorm objects and user object. The jorm objects are the mapping, the binding and the accessor. It is needed to specify a MOPFactory before start the generation.The generate method starts the generation. To generate user objects it is necessary to specify their GeneratorFactory by the addGeneratorFactory method.


Constructor Summary
JormGeneratorImpl(MOPFactory mopf)
          This constructor allows to specify which MOPFactory must be used in this JormGenerator instance.
 
Method Summary
 void addGeneratorFactory(GeneratorFactory gf)
          This method permits to add GeneratorFactory instance.
 void generate(MetaObject mo, org.objectweb.util.io.api.TargetHolder holder, CompilerParameter cp)
          This method generates the jorm objects by delegation to the AccessorGenerator, the BindingGenerator and the MappingGenerator.
 org.objectweb.util.monolog.api.Logger getLogger()
          Returns a logger to an component that wants to log things.
 org.objectweb.util.monolog.api.LoggerFactory getLoggerFactory()
          Returns a logger factory that allows the creation of new loggers.
 void setLogger(org.objectweb.util.monolog.api.Logger _logger)
          defines the logger factory to obtain new logger.
 void setLoggerFactory(org.objectweb.util.monolog.api.LoggerFactory lf)
          Assigns a logger factory that allows the creation of new loggers.
 void setMOPFactory(MOPFactory mopf)
          This setter method permit to specify which MOPFactory must be used in this JormGenerator instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JormGeneratorImpl

public JormGeneratorImpl(MOPFactory mopf)
This constructor allows to specify which MOPFactory must be used in this JormGenerator instance.
Method Detail

setLogger

public void setLogger(org.objectweb.util.monolog.api.Logger _logger)
defines the logger factory to obtain new logger.
Specified by:
setLogger in interface Loggable
Parameters:
loggerFactory - the LoggerFactory object to obtain a logger object

getLogger

public org.objectweb.util.monolog.api.Logger getLogger()
Description copied from interface: Loggable
Returns a logger to an component that wants to log things.
Specified by:
getLogger in interface Loggable
Following copied from interface: org.objectweb.jorm.util.api.Loggable
Parameters:
logger - the logger object

getLoggerFactory

public org.objectweb.util.monolog.api.LoggerFactory getLoggerFactory()
Description copied from interface: Loggable
Returns a logger factory that allows the creation of new loggers.
Specified by:
getLoggerFactory in interface Loggable
Following copied from interface: org.objectweb.jorm.util.api.Loggable
Parameters:
loggerfactory - the LoggerFactory object to obtain new loggers

setLoggerFactory

public void setLoggerFactory(org.objectweb.util.monolog.api.LoggerFactory lf)
Description copied from interface: Loggable
Assigns a logger factory that allows the creation of new loggers.
Specified by:
setLoggerFactory in interface Loggable
Following copied from interface: org.objectweb.jorm.util.api.Loggable
Parameters:
loggerfactory - the LoggerFactory object to obtain new loggers

addGeneratorFactory

public void addGeneratorFactory(GeneratorFactory gf)
This method permits to add GeneratorFactory instance. This is the way to extend the JormGenerator to generate supplementary files.
Specified by:
addGeneratorFactory in interface JormGenerator

setMOPFactory

public void setMOPFactory(MOPFactory mopf)
This setter method permit to specify which MOPFactory must be used in this JormGenerator instance.
Specified by:
setMOPFactory in interface JormGenerator

generate

public void generate(MetaObject mo,
                     org.objectweb.util.io.api.TargetHolder holder,
                     CompilerParameter cp)
              throws java.lang.Exception
This method generates the jorm objects by delegation to the AccessorGenerator, the BindingGenerator and the MappingGenerator. Its second task is to launch the user objects generator.
Specified by:
generate in interface Generator
Parameters:
pod - This meta object must be a Class
th - The target holder which allows to create files
cp - The compiler parameter