org.objectweb.jorm.generator.lib
Class BindingGenerator
java.lang.Object
org.objectweb.jorm.generator.lib.CommonHelper
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:
Key | Value |
"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) |
Methods inherited from class org.objectweb.jorm.generator.lib.CommonHelper |
buildPemList, canBeNullValue, comparePE, containsCharArrayField, containsCompositeName, containsFieldWhichCanBeNull, containsGenClassRef, containsReference, containsSerializedField, getCNPackageName, getCoderName, getCompositeNameDefEntries, getCompositeReferences, getCTDeclaration, getCTDeclaration, getFQNOfCompositeName, getInheritedClasses, getPaGetMethod, getPaSetMethod, getPemPos, getPNameDecodeFunction, getPNameEncodeFunction, getPNameGetterGetFunction, getPNGTypes, getPrimitiveElement, getPrimitiveElement, getProjectionField, getPType, getPTypeBigDecimal, getPTypeBigInteger, getPTypeBoolean, getPTypeByte, getPTypeByteArray, getPTypeChar, getPTypeCharArray, getPTypeDate, getPTypeDouble, getPTypeFloat, getPTypeInt, getPTypeLong, getPTypeOboolean, getPTypeObyte, getPTypeOchar, getPTypeOdouble, getPTypeOfloat, getPTypeOint, getPTypeOlong, getPTypeOshort, getPTypeReference, getPTypeSerialized, getPTypeShort, getPTypeString, getTupleDecoding, getTupleGetter, isCharArrayType, isClass, isClassRef, isCompositeName, isFieldName, isGenClassRef, isHiddenField, isNull, isObjectType, isPrimitiveElement, isReference, isSerializedField, isSerializedType, isValidString, log, not, upperFL |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
bmops
protected java.util.HashMap bmops
- The mapper generation specializations (some MOP objects)
BindingGenerator
public BindingGenerator(JormCompilerConfigurator jcc,
JormCompilerParameter cp)
throws PException
- This constrcutor permits to specify which BindingMOP must be used
getTemplateLibraries
public java.lang.String[][] getTemplateLibraries()
- Overrides:
getTemplateLibraries
in class CommonGenerator
generate
public void generate(Class co,
TargetHolder holder,
JormCompilerParameter cp,
JormCompilerConfigurator 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 interfaceholder
- The target holder which allows to create filescp
- This parameter permits to reach the compilation parametersgenctxts
- The context variables used by the velocity template engine.
- Throws:
PException