org.objectweb.speedo.generation.generator.lib
Class SpeedoGenerator

java.lang.Object
  extended byorg.objectweb.speedo.generation.lib.AbstractGeneratorComponent
      extended byorg.objectweb.speedo.generation.generator.lib.AbstractVelocityGenerator
          extended byorg.objectweb.speedo.generation.generator.lib.SpeedoGenerator
All Implemented Interfaces:
GeneratorComponent, SupportedGenClass, VelocityGenerator
Direct Known Subclasses:
FieldsGenerator, HomeGenerator, ProxyGenerator

public abstract class SpeedoGenerator
extends AbstractVelocityGenerator
implements SupportedGenClass

Author:
S.Chassande-Barrioz

Nested Class Summary
 class SpeedoGenerator.FetchGroup
           
 class SpeedoGenerator.Field
           
 
Field Summary
protected static org.objectweb.jorm.generator.lib.CommonHelper jormTools
           
 java.lang.Class[][] 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, scp
 
Fields inherited from interface org.objectweb.speedo.genclass.SupportedGenClass
GC_IMPL, GC_IMPL_PREFIX
 
Constructor Summary
SpeedoGenerator()
           
 
Method Summary
protected  java.util.Map computeUserCaches(SpeedoClass sc)
           
protected  void computeUserCaches(SpeedoClass sc, java.util.Map userCaches, boolean addNew)
           
 void fillFetchGroupInfo(SpeedoGenerator.FetchGroup fg, SpeedoFetchGroup sfg)
           
 void fillFieldInfo(SpeedoGenerator.Field f, SpeedoField sp, int nbField, org.apache.velocity.context.Context ctx)
           
 void fillFieldInfo4FetchGroup(SpeedoGenerator.Field f, SpeedoField sf)
           
 void fillReferenceInfo(SpeedoGenerator.Field f, SpeedoField sp, org.objectweb.jorm.metainfo.api.TypedElement te, org.apache.velocity.context.Context ctx, org.objectweb.asm.Type asmType)
           
 void fillRelationInfo(SpeedoGenerator.Field f, SpeedoField sp, org.objectweb.jorm.metainfo.api.TypedElement te, org.apache.velocity.context.Context ctx, org.objectweb.asm.Type asmType)
           
 void fillUserFieldMappingInfo(SpeedoGenerator.Field f, SpeedoField sp)
           
protected  org.objectweb.jorm.metainfo.api.NameDef getClassNameDef(org.objectweb.jorm.metainfo.api.Class clazz)
           
protected  java.lang.String[] getCollectionClass(org.objectweb.asm.Type fieldtype)
           
protected  org.apache.velocity.context.Context getContext(SpeedoClass jdoClass)
           
protected  java.lang.String getJavaLangType(java.lang.Class c)
           
protected  org.objectweb.jorm.metainfo.api.Mapping getMapping(org.objectweb.jorm.metainfo.api.Class clazz)
           
 java.lang.String getPNameGetter(org.objectweb.jorm.type.api.PType type)
           
protected  java.lang.String getValueGetter(java.lang.Class c)
           
 
Methods inherited from class org.objectweb.speedo.generation.generator.lib.AbstractVelocityGenerator
computeTemplate, generate, getExternalsTemplate, getVelocityEngine, init, isClassicalType, isContainerIdField, process, setVelocityEngine
 
Methods inherited from class org.objectweb.speedo.generation.lib.AbstractGeneratorComponent
getLogger, getSpeedoCompilerParameter, 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, setSpeedoCompilerParameter
 

Field Detail

jormTools

protected static org.objectweb.jorm.generator.lib.CommonHelper jormTools

PRIMITIVE_TYPES

public final java.lang.Class[][] PRIMITIVE_TYPES
Constructor Detail

SpeedoGenerator

public SpeedoGenerator()
Method Detail

getContext

protected org.apache.velocity.context.Context getContext(SpeedoClass jdoClass)
                                                  throws SpeedoException
Throws:
SpeedoException

fillFetchGroupInfo

public void fillFetchGroupInfo(SpeedoGenerator.FetchGroup fg,
                               SpeedoFetchGroup sfg)
                        throws SpeedoException
Throws:
SpeedoException

fillFieldInfo4FetchGroup

public void fillFieldInfo4FetchGroup(SpeedoGenerator.Field f,
                                     SpeedoField sf)

fillFieldInfo

public void fillFieldInfo(SpeedoGenerator.Field f,
                          SpeedoField sp,
                          int nbField,
                          org.apache.velocity.context.Context ctx)
                   throws SpeedoException
Throws:
SpeedoException

fillReferenceInfo

public void fillReferenceInfo(SpeedoGenerator.Field f,
                              SpeedoField sp,
                              org.objectweb.jorm.metainfo.api.TypedElement te,
                              org.apache.velocity.context.Context ctx,
                              org.objectweb.asm.Type asmType)
                       throws SpeedoException
Throws:
SpeedoException

fillRelationInfo

public void fillRelationInfo(SpeedoGenerator.Field f,
                             SpeedoField sp,
                             org.objectweb.jorm.metainfo.api.TypedElement te,
                             org.apache.velocity.context.Context ctx,
                             org.objectweb.asm.Type asmType)
                      throws SpeedoException
Throws:
SpeedoException

fillUserFieldMappingInfo

public void fillUserFieldMappingInfo(SpeedoGenerator.Field f,
                                     SpeedoField sp)
                              throws SpeedoException
Throws:
SpeedoException

getValueGetter

protected java.lang.String getValueGetter(java.lang.Class c)

getJavaLangType

protected java.lang.String getJavaLangType(java.lang.Class c)

getCollectionClass

protected java.lang.String[] getCollectionClass(org.objectweb.asm.Type fieldtype)

getPNameGetter

public java.lang.String getPNameGetter(org.objectweb.jorm.type.api.PType type)

getMapping

protected org.objectweb.jorm.metainfo.api.Mapping getMapping(org.objectweb.jorm.metainfo.api.Class clazz)
                                                      throws SpeedoException
Throws:
SpeedoException

getClassNameDef

protected org.objectweb.jorm.metainfo.api.NameDef getClassNameDef(org.objectweb.jorm.metainfo.api.Class clazz)
                                                           throws SpeedoException
Throws:
SpeedoException

computeUserCaches

protected java.util.Map computeUserCaches(SpeedoClass sc)

computeUserCaches

protected void computeUserCaches(SpeedoClass sc,
                                 java.util.Map userCaches,
                                 boolean addNew)