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

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
All Implemented Interfaces:
SupportedGenClass, GeneratorComponent, VelocityGenerator
Direct Known Subclasses:
FieldsGenerator, HomeGenerator

public abstract class AbstractSpeedoGenerator
extends AbstractVelocityGenerator
implements SupportedGenClass

Author:
S.Chassande-Barrioz

Nested Class Summary
 class AbstractSpeedoGenerator.FetchGroup
           
 class AbstractSpeedoGenerator.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, personality, scp
 
Fields inherited from interface org.objectweb.speedo.genclass.SupportedGenClass
GC_IMPL, GC_IMPL_PREFIX
 
Constructor Summary
AbstractSpeedoGenerator(Personality p)
           
 
Method Summary
protected  java.util.Map computeUserCaches(SpeedoClass sc)
           
protected  void computeUserCaches(SpeedoClass sc, java.util.Map userCaches, boolean addNew)
           
 void fillFetchGroupInfo(AbstractSpeedoGenerator.FetchGroup fg, SpeedoFetchGroup sfg)
           
 void fillFieldInfo(AbstractSpeedoGenerator.Field f, SpeedoField sp, int nbField, java.util.Map ctx)
           
 void fillFieldInfo4FetchGroup(AbstractSpeedoGenerator.Field f, SpeedoField sf)
           
 void fillReferenceInfo(AbstractSpeedoGenerator.Field f, SpeedoField sp, org.objectweb.jorm.metainfo.api.TypedElement te, java.util.Map ctx, org.objectweb.asm.Type asmType)
           
 void fillRelationInfo(AbstractSpeedoGenerator.Field f, SpeedoField sp, org.objectweb.jorm.metainfo.api.TypedElement te, java.util.Map ctx, org.objectweb.asm.Type asmType)
           
 void fillUserFieldMappingInfo(AbstractSpeedoGenerator.Field f, SpeedoField sp)
           
protected  org.objectweb.jorm.metainfo.api.NameDef getClassNameDef(org.objectweb.jorm.metainfo.api.Class clazz)
           
static org.objectweb.jorm.metainfo.api.NameDef getClassNameDef(org.objectweb.jorm.metainfo.api.Class clazz, SpeedoCompilerParameter scp)
           
protected  java.lang.String[] getCollectionClass(org.objectweb.asm.Type fieldtype, Personality pers)
           
protected  org.apache.velocity.context.Context getContext(SpeedoClass jdoClass)
           
 java.util.Map getContextAsMap(SpeedoClass moClass)
           
protected  java.lang.String getJavaLangType(java.lang.Class c)
           
protected  org.objectweb.jorm.metainfo.api.Mapping getMapping(org.objectweb.jorm.metainfo.api.Class clazz)
           
static org.objectweb.jorm.metainfo.api.Mapping getMapping(org.objectweb.jorm.metainfo.api.Class clazz, SpeedoCompilerParameter scp)
           
 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, 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

jormTools

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

PRIMITIVE_TYPES

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

AbstractSpeedoGenerator

public AbstractSpeedoGenerator(Personality p)
Method Detail

getContextAsMap

public java.util.Map getContextAsMap(SpeedoClass moClass)
                              throws SpeedoException
Throws:
SpeedoException

getContext

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

fillFetchGroupInfo

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

fillFieldInfo4FetchGroup

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

fillFieldInfo

public void fillFieldInfo(AbstractSpeedoGenerator.Field f,
                          SpeedoField sp,
                          int nbField,
                          java.util.Map ctx)
                   throws SpeedoException
Throws:
SpeedoException

fillReferenceInfo

public void fillReferenceInfo(AbstractSpeedoGenerator.Field f,
                              SpeedoField sp,
                              org.objectweb.jorm.metainfo.api.TypedElement te,
                              java.util.Map ctx,
                              org.objectweb.asm.Type asmType)
                       throws SpeedoException
Throws:
SpeedoException

fillRelationInfo

public void fillRelationInfo(AbstractSpeedoGenerator.Field f,
                             SpeedoField sp,
                             org.objectweb.jorm.metainfo.api.TypedElement te,
                             java.util.Map ctx,
                             org.objectweb.asm.Type asmType)
                      throws SpeedoException
Throws:
SpeedoException

fillUserFieldMappingInfo

public void fillUserFieldMappingInfo(AbstractSpeedoGenerator.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,
                                                Personality pers)

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

getMapping

public static org.objectweb.jorm.metainfo.api.Mapping getMapping(org.objectweb.jorm.metainfo.api.Class clazz,
                                                                 SpeedoCompilerParameter scp)
                                                          throws SpeedoException
Throws:
SpeedoException

getClassNameDef

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

getClassNameDef

public static org.objectweb.jorm.metainfo.api.NameDef getClassNameDef(org.objectweb.jorm.metainfo.api.Class clazz,
                                                                      SpeedoCompilerParameter scp)
                                                               throws SpeedoException
Throws:
SpeedoException

computeUserCaches

protected java.util.Map computeUserCaches(SpeedoClass sc)

computeUserCaches

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