org.objectweb.jorm.generator.lib
Class BindingGenerator

java.lang.Object
  |
  +--org.objectweb.jorm.generator.lib.CommonGenerator
        |
        +--org.objectweb.jorm.generator.lib.BindingGenerator
All Implemented Interfaces:
Loggable

public class BindingGenerator
extends CommonGenerator

This class is a generator of XXXBinding objects. It is generic either the mapper type. This generator use the velocity tools. The used template is Binding.vm . Associated to this template this generator builds a velocity context which contains the following information:
KeyValue
"class"The reference to the Class meta object
"tools" The reference to the CommonHelper
"header" The file name of the common template which contains the header of the generate files.
"bindingTools" The reference to current instance of BindingGenerator.
"cparam" The reference to a CompilerParameter instance. This instance describes the user compilation parameter.
As a XXXBinding class is specific to a mapper, the Binding.vm template uses externals macros which must be defined as an external template library in the velocity tools.


Field Summary
protected  java.util.HashMap bmops
          The mapper generation specializations (some MOP objects)
 
Fields inherited from class org.objectweb.jorm.generator.lib.CommonGenerator
GEN_TEMPLATE_DIR, logger, loggerFactory, MAPPER_TEMPLATE_DIR, velocityEngine
 
Constructor Summary
BindingGenerator(JormConfigurator jcc, JormCompilerParameter cp)
          This constrcutor permits to specify which BindingMOP must be used
 
Method Summary
 void generate(Class co, TargetHolder holder, JormCompilerParameter cp, JormConfigurator jcc, java.util.Map genctxts)
          This method generates a XPBinding file corresponding to the pod parameter in the directory parameter
 java.lang.String[][] getTemplateLibraries()
           
 
Methods inherited from class org.objectweb.jorm.generator.lib.CommonGenerator
getLogger, getLoggerFactory, setLogger, setLoggerFactory, setVelocityEngine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bmops

protected java.util.HashMap bmops
The mapper generation specializations (some MOP objects)

Constructor Detail

BindingGenerator

public BindingGenerator(JormConfigurator jcc,
                        JormCompilerParameter cp)
                 throws PException
This constrcutor permits to specify which BindingMOP must be used

Method Detail

getTemplateLibraries

public java.lang.String[][] getTemplateLibraries()
Overrides:
getTemplateLibraries in class CommonGenerator

generate

public void generate(Class co,
                     TargetHolder holder,
                     JormCompilerParameter cp,
                     JormConfigurator jcc,
                     java.util.Map genctxts)
              throws PException
This method generates a XPBinding file corresponding to the pod parameter in the directory parameter

Parameters:
co - the class meta object interface
holder - The target holder which allows to create files
cp - This parameter permits to reach the compilation parameters
genctxts - The context variables used by the velocity template engine.
PException