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

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

public class BindingGenerator
extends ObjectGenerator

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  MOP bmop
          The mapper specialization
 
Fields inherited from class org.objectweb.jorm.comp.generator.lib.ObjectGenerator
logger, loggerFactory, TEMPLATE_DIR
 
Constructor Summary
BindingGenerator(MOP _bmop)
          This constrcutor permits to specify which BindingMOP must be used
 
Method Summary
 void generate(MetaObject pod, org.objectweb.util.io.api.TargetHolder holder, CompilerParameter cp)
          This method generates a XPBinding file corresponding to the pod parameter in the directory parameter
 void setBindingMOP(MOP _bmop)
          This sette method permits to specify which BindingMOP must be used
 
Methods inherited from class org.objectweb.jorm.comp.generator.lib.ObjectGenerator
getLogger, getLoggerFactory, initVelocity, setLogger, setLoggerFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bmop

protected MOP bmop
The mapper specialization
Constructor Detail

BindingGenerator

public BindingGenerator(MOP _bmop)
                 throws java.lang.Exception
This constrcutor permits to specify which BindingMOP must be used
Method Detail

setBindingMOP

public void setBindingMOP(MOP _bmop)
This sette method permits to specify which BindingMOP must be used

generate

public void generate(MetaObject pod,
                     org.objectweb.util.io.api.TargetHolder holder,
                     CompilerParameter cp)
              throws java.lang.Exception
This method generates a XPBinding file corresponding to the pod parameter in the directory parameter
Overrides:
generate in class ObjectGenerator
Parameters:
pod - the meta object interface
holder - The target holder which allows to create files
cp - This parameter permits to reach the compilation parameters