org.objectweb.speedo.generation.generator.fields
Class FieldsGenerator

java.lang.Object
  extended by org.objectweb.speedo.generation.lib.AbstractGeneratorComponent
      extended by org.objectweb.speedo.generation.generator.lib.AbstractVelocityGenerator
          extended by org.objectweb.speedo.generation.generator.lib.AbstractSpeedoGenerator
              extended by org.objectweb.speedo.generation.generator.fields.FieldsGenerator
All Implemented Interfaces:
SupportedGenClass, GeneratorComponent, VelocityGenerator

public class FieldsGenerator
extends AbstractSpeedoGenerator

This class is used to generate accessor classes. This new file will manage status of persistent classes and values of persistent fields.

Author:
S.Chassande-Barrioz

Nested Class Summary
 
Nested classes/interfaces inherited from class org.objectweb.speedo.generation.generator.lib.AbstractSpeedoGenerator
AbstractSpeedoGenerator.FetchGroup, AbstractSpeedoGenerator.Field
 
Field Summary
static java.lang.String LOGGER_NAME
           
static java.lang.String TEMPLATE_NAME
           
 
Fields inherited from class org.objectweb.speedo.generation.generator.lib.AbstractSpeedoGenerator
jormTools, PRIMITIVE_TYPES
 
Fields inherited from class org.objectweb.speedo.generation.generator.lib.AbstractVelocityGenerator
fs, template, TEMPLATE_DIR, ve
 
Fields inherited from class org.objectweb.speedo.generation.lib.AbstractGeneratorComponent
debug, logger, personality, scp
 
Fields inherited from interface org.objectweb.speedo.genclass.SupportedGenClass
GC_IMPL, GC_IMPL_PREFIX
 
Constructor Summary
FieldsGenerator(Personality p)
           
 
Method Summary
 void generate(SpeedoClass sClass, java.lang.String fileName)
          This method generates the a file since a SpeedoClass meta object.
 java.util.Map getContextAsMap(SpeedoClass jdoClass)
          This method initialises the Velocity context.
 boolean init()
          Initializes the component
 boolean isNull(java.lang.Object o)
           
 boolean isParentField(SpeedoClass sc, java.lang.String fn)
           
 
Methods inherited from class org.objectweb.speedo.generation.generator.lib.AbstractSpeedoGenerator
computeUserCaches, computeUserCaches, fillFetchGroupInfo, fillFieldInfo, fillFieldInfo4FetchGroup, fillReferenceInfo, fillRelationInfo, fillUserFieldMappingInfo, getClassNameDef, getClassNameDef, getCollectionClass, getContext, getJavaLangType, getMapping, getMapping, getPNameGetter, getValueGetter
 
Methods inherited from class org.objectweb.speedo.generation.generator.lib.AbstractVelocityGenerator
computeTemplate, getExternalsTemplate, getVelocityEngine, isClassicalType, isContainerIdField, process, setVelocityEngine
 
Methods inherited from class org.objectweb.speedo.generation.lib.AbstractGeneratorComponent
getLogger, getSpeedoCompilerParameter, getSummary, getTitle, setLogger, setSpeedoCompilerParameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.speedo.generation.api.GeneratorComponent
getSpeedoCompilerParameter, getSummary, getTitle, setSpeedoCompilerParameter
 

Field Detail

LOGGER_NAME

public static final java.lang.String LOGGER_NAME
See Also:
Constant Field Values

TEMPLATE_NAME

public static final java.lang.String TEMPLATE_NAME
See Also:
Constant Field Values
Constructor Detail

FieldsGenerator

public FieldsGenerator(Personality p)
Method Detail

init

public boolean init()
             throws SpeedoException
Description copied from interface: GeneratorComponent
Initializes the component

Specified by:
init in interface GeneratorComponent
Specified by:
init in class AbstractVelocityGenerator
Returns:
boolean value indicating if the process method can be called.
Throws:
SpeedoException - if the component initialization fails

generate

public void generate(SpeedoClass sClass,
                     java.lang.String fileName)
              throws SpeedoException
This method generates the a file since a SpeedoClass meta object.

Specified by:
generate in interface VelocityGenerator
Specified by:
generate in class AbstractVelocityGenerator
Parameters:
sClass - is the speedo meta object.
fileName - name of the new file.
Throws:
SpeedoGenerationException - If there is a problem during writing the new file.
SpeedoException

isNull

public boolean isNull(java.lang.Object o)

getContextAsMap

public java.util.Map getContextAsMap(SpeedoClass jdoClass)
                              throws SpeedoException
This method initialises the Velocity context.

Overrides:
getContextAsMap in class AbstractSpeedoGenerator
Parameters:
jdoClass - the jdoClass which represents the class to generate.
Returns:
a Velocity context.
Throws:
SpeedoException

isParentField

public boolean isParentField(SpeedoClass sc,
                             java.lang.String fn)