org.objectweb.jorm.generator.lib
Class PNameGenerator

java.lang.Object
  extended byorg.objectweb.jorm.generator.lib.CommonHelper
      extended byorg.objectweb.jorm.generator.lib.CommonGenerator
          extended byorg.objectweb.jorm.generator.lib.PNameGenerator
All Implemented Interfaces:
Loggable

public class PNameGenerator
extends CommonGenerator

This class is a generator of XXXBinder objects. It is generic either the mapper type. This generator use the velocity tools. The used template is Binder.vm . Associated to this template this generator builds a velocity context which contains the following information:

KeyValue
"compositename"The reference to the compositename meta object
"tools" The reference to the CommonHelper
"header" The file name of the common template which contains the header of the generate files.


Field Summary
 CommonHelper helper
           
 
Fields inherited from class org.objectweb.jorm.generator.lib.CommonGenerator
GEN_TEMPLATE_DIR, logger, loggerFactory, MAPPER_TEMPLATE_DIR, velocityEngine
 
Fields inherited from class org.objectweb.jorm.generator.lib.CommonHelper
PN_GET_TYPES
 
Constructor Summary
PNameGenerator()
           
 
Method Summary
 void generate(CompositeName co, TargetHolder holder, JormCompilerParameter cp)
          This method generates a XPName file corresponding to the pod parameter in the directory parameter.
 java.lang.String getCnEquals(CompositeName cn)
          It compute the equality test for the equals method for pname.
 java.lang.String getCnHashCode(CompositeName cn)
          It compute the hashcode method for a composite pname.
 java.lang.String getNullValue(CompositeName cn, ScalarField f)
           
 java.lang.String getPNameNullTest(CompositeName cn)
          It compute the test used to know if a pname is null.
 java.lang.String getPNameNullValue(CompositeName cn, java.lang.String pncVal)
          It compute the constructor parameter used to instanciate a null pname.
 
Methods inherited from class org.objectweb.jorm.generator.lib.CommonGenerator
getLogger, getLoggerFactory, getTemplateLibraries, setLogger, setLoggerFactory, setVelocityEngine
 
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
 

Field Detail

helper

public CommonHelper helper
Constructor Detail

PNameGenerator

public PNameGenerator()
Method Detail

generate

public void generate(CompositeName co,
                     TargetHolder holder,
                     JormCompilerParameter cp)
              throws PException
This method generates a XPName file corresponding to the pod parameter in the directory parameter.

Parameters:
co - The meta object interface.
holder - The target holder which allows to create files.
cp - This parameter permits to reach the compilation parameters.
Throws:
PException

getCnHashCode

public java.lang.String getCnHashCode(CompositeName cn)
                               throws PException
It compute the hashcode method for a composite pname.

Throws:
PException

getCnEquals

public java.lang.String getCnEquals(CompositeName cn)
                             throws PException
It compute the equality test for the equals method for pname.

Throws:
PException

getPNameNullTest

public java.lang.String getPNameNullTest(CompositeName cn)
                                  throws PException
It compute the test used to know if a pname is null.

Throws:
PException

getPNameNullValue

public java.lang.String getPNameNullValue(CompositeName cn,
                                          java.lang.String pncVal)
                                   throws PException
It compute the constructor parameter used to instanciate a null pname.

Throws:
PException

getNullValue

public java.lang.String getNullValue(CompositeName cn,
                                     ScalarField f)
                              throws PException
Throws:
PException