org.objectweb.jorm.comp.generator.memory
Class MemoryMappingMOP

java.lang.Object
  |
  +--org.objectweb.jorm.comp.generator.lib.CommonHelper
        |
        +--org.objectweb.jorm.comp.generator.memory.MemoryMappingMOP
All Implemented Interfaces:
Loggable, MOP

public class MemoryMappingMOP
extends CommonHelper
implements MOP


Inner classes inherited from class org.objectweb.jorm.comp.generator.lib.CommonHelper
CommonHelper.PNGDesc
 
Fields inherited from class org.objectweb.jorm.comp.generator.lib.CommonHelper
logger, loggerFactory, PN_GET_TYPES
 
Constructor Summary
MemoryMappingMOP()
           
 
Method Summary
 java.lang.String[] getImplements(Class c, CompilerParameter cp)
          defines interfaces to implement by the generated mapping object.
 java.lang.String[] getImportedClassName(Class c, CompilerParameter cp)
          defines imports needed by the PMapping generation.
 java.lang.String[] getTemplateLibraries()
           
 void initContext(org.apache.velocity.context.Context ctx)
           
 void writeConstructorBody(org.objectweb.util.io.api.Block block, Class moc, CompilerParameter cp)
           
 void writeCreateFieldDescRefTop(java.lang.String varName, org.objectweb.util.io.api.Block block)
          This method generates the setting of the @varName with a PType equals to PTypeSpace.REFTOP.
 void writeFieldDescFilling(PrimitiveElement pe, java.lang.String varName, org.objectweb.util.io.api.Block block, CompilerParameter cp)
          This method generates the setting of the @varName varible with a Mapper specific FieldDesc either a PrimitiveElement.
 void writeInitGenClassMapping(GenClassRef gcr, java.lang.String gcVarName, Class sourceClass, java.lang.String fieldName, int level, org.objectweb.util.io.api.Block block, CompilerParameter cp)
           
 void writeinitMappingStructures(org.objectweb.util.io.api.Block block, Class moc, CompilerParameter cp)
          writes the body of method initStruct(Object conn) that will be used to build the persistence support for the object in the object store.
 void writeRemoveMappingStructures(org.objectweb.util.io.api.Block block, Class moc, CompilerParameter cp)
          writes the body of the removeStruct(Object conn) that will be used to remove the persistent support for the object int the data storage.
 void writeVariables(org.objectweb.util.io.api.Block block, Class moc, CompilerParameter cp)
          writes the definitions of all variables needed by a Binding object.
 
Methods inherited from class org.objectweb.jorm.comp.generator.lib.CommonHelper
canBeNullValue, containsCompositeName, containsCompositeReference, containsGenClassRef, containsReference, containsSerializedField, getCompositeNameDefEntries, getFQNOfCompositeName, getLogger, getLoggerFactory, getPaGetMethod, getPaSetMethod, getPNameDecodeFunction, getPNameEncodeFunction, getPNameGetterGetFunction, getPNGTypes, getPrimitiveElement, getProjectionField, getPType, getPTypeBigDecimal, getPTypeBoolean, getPTypeByte, getPTypeByteArray, getPTypeChar, getPTypeCharArray, getPTypeDate, getPTypeDouble, getPTypeFloat, getPTypeInt, getPTypeLong, getPTypeOboolean, getPTypeObyte, getPTypeOchar, getPTypeOdouble, getPTypeOfloat, getPTypeOint, getPTypeOlong, getPTypeOshort, getPTypeReference, getPTypeSerialized, getPTypeShort, getPTypeString, getSchemaName, isClass, isClassRef, isCompositeName, isFieldName, isGenClassRef, isHiddenField, isPrimitiveElement, isReference, isSerializedField, isSerializedType, isValidString, iterateCompositeName, iterateCompositeReference, setLogger, setLoggerFactory, upperFL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryMappingMOP

public MemoryMappingMOP()
Method Detail

initContext

public void initContext(org.apache.velocity.context.Context ctx)
Specified by:
initContext in interface MOP

getTemplateLibraries

public java.lang.String[] getTemplateLibraries()
Specified by:
getTemplateLibraries in interface MOP

writeVariables

public void writeVariables(org.objectweb.util.io.api.Block block,
                           Class moc,
                           CompilerParameter cp)
                    throws java.lang.Exception
writes the definitions of all variables needed by a Binding object.
Parameters:
block - The class definition block within which the variable definitions are written.

writeConstructorBody

public void writeConstructorBody(org.objectweb.util.io.api.Block block,
                                 Class moc,
                                 CompilerParameter cp)
                          throws java.lang.Exception
Parameters:
block - The class definition block within which the variable definitions are written.

writeinitMappingStructures

public void writeinitMappingStructures(org.objectweb.util.io.api.Block block,
                                       Class moc,
                                       CompilerParameter cp)
                                throws java.lang.Exception
writes the body of method initStruct(Object conn) that will be used to build the persistence support for the object in the object store.
Parameters:
block - The block within which the method's body has to be written.
moc - The meta object which represents a jorm class

writeRemoveMappingStructures

public void writeRemoveMappingStructures(org.objectweb.util.io.api.Block block,
                                         Class moc,
                                         CompilerParameter cp)
                                  throws java.lang.Exception
writes the body of the removeStruct(Object conn) that will be used to remove the persistent support for the object int the data storage.
Parameters:
block - The block within which the method's body has to be written.
moc - The meta object which represents a jorm class

getImplements

public java.lang.String[] getImplements(Class c,
                                        CompilerParameter cp)
                                 throws java.lang.Exception
defines interfaces to implement by the generated mapping object.
Returns:
A String tab representing the classes to implement. For mapping object, FileReader and FileWriter are implemented.

getImportedClassName

public java.lang.String[] getImportedClassName(Class c,
                                               CompilerParameter cp)
                                        throws java.lang.Exception
defines imports needed by the PMapping generation.
Returns:
A String tab representing the class names needed by the generated object.

writeFieldDescFilling

public void writeFieldDescFilling(PrimitiveElement pe,
                                  java.lang.String varName,
                                  org.objectweb.util.io.api.Block block,
                                  CompilerParameter cp)
                           throws java.lang.Exception
This method generates the setting of the @varName varible with a Mapper specific FieldDesc either a PrimitiveElement. The mapping of a primitive element depends on a mapper. The extension of the FieldDesc class contains specific fields to the mapper.

writeCreateFieldDescRefTop

public void writeCreateFieldDescRefTop(java.lang.String varName,
                                       org.objectweb.util.io.api.Block block)
                                throws java.lang.Exception
This method generates the setting of the @varName with a PType equals to PTypeSpace.REFTOP. This method depends on a mapper because the constructor of the FieldDesc extension is only known by the MOP objects.

writeInitGenClassMapping

public void writeInitGenClassMapping(GenClassRef gcr,
                                     java.lang.String gcVarName,
                                     Class sourceClass,
                                     java.lang.String fieldName,
                                     int level,
                                     org.objectweb.util.io.api.Block block,
                                     CompilerParameter cp)
                              throws java.lang.Exception