org.objectweb.jorm.comp.generator.file
Class FileBindingMOP

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

public class FileBindingMOP
extends CommonHelper
implements MOP

Author:
Sebastien Chassande-Barrioz

Inner classes inherited from class org.objectweb.jorm.comp.generator.lib.CommonHelper
CommonHelper.PNGDesc
 
Field Summary
protected static java.lang.String PACCESSOR_VAR_NAME
           
protected static java.lang.String PACCESSORGEN_VAR_NAME
           
 
Fields inherited from class org.objectweb.jorm.comp.generator.lib.CommonHelper
logger, loggerFactory, PN_GET_TYPES
 
Constructor Summary
FileBindingMOP()
           
 
Method Summary
 java.lang.String[] getImplements(Class c, CompilerParameter cp)
          defines interfaces to implement by the current object.
 java.lang.String[] getImportedClassName(Class c, CompilerParameter cp)
          defines imports needed by the PBinding 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)
          This methods permits to specify initializations which must be done at the instanciation time.
 void writeCreate(org.objectweb.util.io.api.Block block, Class moc, CompilerParameter cp)
          To do nothing, because the code is common to the remove, create or update cases.
 void writeExistsBody(org.objectweb.util.io.api.Block block, Class moc, CompilerParameter cp)
          writes the code for the "exists" method needed by a Binding object.
 void writeExistsHeader(org.objectweb.util.io.api.Block block, Class moc, CompilerParameter cp)
          No specific header
 void writeExistsTail(org.objectweb.util.io.api.Block block, Class moc, CompilerParameter cp)
          No specific tail
 void writeOtherMethods(org.objectweb.util.io.api.Block block, Class moc, CompilerParameter cp)
          writes the code for other methods needed by a Binding object.
 void writeReadBody(org.objectweb.util.io.api.Block block, Class moc, CompilerParameter cp)
           
 void writeReadHeader(org.objectweb.util.io.api.Block block, Class moc, CompilerParameter cp)
          No specific header
 void writeReadTail(org.objectweb.util.io.api.Block block, Class moc, CompilerParameter cp)
          No specific tail
 void writeRemove(org.objectweb.util.io.api.Block block, Class moc, CompilerParameter cp)
          To do nothing, because the code is common to the remove, create or update cases.
 void writeUpdate(org.objectweb.util.io.api.Block block, Class moc, CompilerParameter cp)
          To do nothing, because the code is common to the remove, create or update cases.
 void writeVariables(org.objectweb.util.io.api.Block block, Class moc, CompilerParameter cp)
          writes the definitions of all variables needed by a Binding object.
 void writeWriteHeader(org.objectweb.util.io.api.Block block, Class moc, CompilerParameter cp)
          writes the code for the "write" header method needed by a Binding object.
 void writeWriteTail(org.objectweb.util.io.api.Block block, Class moc, CompilerParameter cp)
          writes the code for the "write" tail method 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
 

Field Detail

PACCESSOR_VAR_NAME

protected static final java.lang.String PACCESSOR_VAR_NAME

PACCESSORGEN_VAR_NAME

protected static final java.lang.String PACCESSORGEN_VAR_NAME
Constructor Detail

FileBindingMOP

public FileBindingMOP()
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
This methods permits to specify initializations which must be done at the instanciation time.
Parameters:
block - The class definition block within which the variable definitions are written.

writeWriteHeader

public void writeWriteHeader(org.objectweb.util.io.api.Block block,
                             Class moc,
                             CompilerParameter cp)
                      throws java.lang.Exception
writes the code for the "write" header method needed by a Binding object.
Parameters:
block - The block within which the code is written.
moc - The meta object which represents the jorm class

writeWriteTail

public void writeWriteTail(org.objectweb.util.io.api.Block block,
                           Class moc,
                           CompilerParameter cp)
                    throws java.lang.Exception
writes the code for the "write" tail method needed by a Binding object.
Parameters:
block - The block within which the code is written.
moc - The meta object which represents the jorm class

writeRemove

public void writeRemove(org.objectweb.util.io.api.Block block,
                        Class moc,
                        CompilerParameter cp)
                 throws java.lang.Exception
To do nothing, because the code is common to the remove, create or update cases. Then the code is written by the writeWriteTail method.

writeCreate

public void writeCreate(org.objectweb.util.io.api.Block block,
                        Class moc,
                        CompilerParameter cp)
                 throws java.lang.Exception
To do nothing, because the code is common to the remove, create or update cases. Then the code is written by the writeWriteTail method.

writeUpdate

public void writeUpdate(org.objectweb.util.io.api.Block block,
                        Class moc,
                        CompilerParameter cp)
                 throws java.lang.Exception
To do nothing, because the code is common to the remove, create or update cases. Then the code is written by the writeWriteTail method.

writeReadHeader

public void writeReadHeader(org.objectweb.util.io.api.Block block,
                            Class moc,
                            CompilerParameter cp)
                     throws java.lang.Exception
No specific header

writeReadBody

public void writeReadBody(org.objectweb.util.io.api.Block block,
                          Class moc,
                          CompilerParameter cp)
                   throws java.lang.Exception

writeReadTail

public void writeReadTail(org.objectweb.util.io.api.Block block,
                          Class moc,
                          CompilerParameter cp)
                   throws java.lang.Exception
No specific tail

writeExistsHeader

public void writeExistsHeader(org.objectweb.util.io.api.Block block,
                              Class moc,
                              CompilerParameter cp)
                       throws java.lang.Exception
No specific header

writeExistsBody

public void writeExistsBody(org.objectweb.util.io.api.Block block,
                            Class moc,
                            CompilerParameter cp)
                     throws java.lang.Exception
writes the code for the "exists" method needed by a Binding object.
Parameters:
block - The block within which the code is written.

writeExistsTail

public void writeExistsTail(org.objectweb.util.io.api.Block block,
                            Class moc,
                            CompilerParameter cp)
                     throws java.lang.Exception
No specific tail

getImplements

public java.lang.String[] getImplements(Class c,
                                        CompilerParameter cp)
                                 throws java.lang.Exception
defines interfaces to implement by the current object.
Returns:
A String tab representing the classes to implement. For binding 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 PBinding generation.
Returns:
A String tab representing the class names needed by the generated object.

writeOtherMethods

public void writeOtherMethods(org.objectweb.util.io.api.Block block,
                              Class moc,
                              CompilerParameter cp)
                       throws java.lang.Exception
writes the code for other methods needed by a Binding object.
Parameters:
block - The block within which the code is written.