pt.ist.fenixframework.dml
Class DAPCodeGenerator
java.lang.Object
pt.ist.fenixframework.dml.CodeGenerator
pt.ist.fenixframework.dml.DefaultCodeGenerator
pt.ist.fenixframework.dml.DAPCodeGenerator
- Direct Known Subclasses:
- TxIntrospectorCodeGenerator
public class DAPCodeGenerator
- extends DefaultCodeGenerator
This code generator adds the possibility of collecting information about the data access
patterns performed by any target application built with the fenix-framework. To do so, it adds,
at the start of each setter and getter method an invocation to a static method in the DAP framework
that updates the statistical information regarding that particular read/write access operation.
- Author:
- syg
- See Also:
FFDAPConfig
Method Summary |
protected void |
generateBackEndIdClassBody(PrintWriter out)
|
protected void |
generateClasses(Iterator classesIter)
|
protected void |
generateGetterBody(String slotName,
String typeName,
PrintWriter out)
|
protected void |
generateGetterDAPStatement(DomainClass domainClass,
String slotName,
String typeName,
PrintWriter out)
|
protected void |
generateIteratorMethod(Role role,
PrintWriter out,
String slotAccessExpression)
|
protected void |
generateRelationAddMethodCall(Role role,
String otherArg,
String indexParam,
PrintWriter out)
|
protected void |
generateRelationGetter(String getterName,
String valueToReturn,
Role role,
String typeName,
PrintWriter out)
|
protected void |
generateRelationRemoveMethodCall(Role role,
String otherArg,
PrintWriter out)
|
protected void |
generateRoleSlotMethodsMultOneHas(Role role,
PrintWriter out)
|
protected void |
generateRoleSlotMethodsMultOneRemove(Role role,
PrintWriter out)
|
protected void |
generateRoleSlotMethodsMultStarCount(Role role,
PrintWriter out,
String methodModifiers,
String capitalizedSlotName,
String slotAccessExpression)
|
protected void |
generateRoleSlotMethodsMultStarHasAnyChild(Role role,
PrintWriter out,
String methodModifiers,
String capitalizedSlotName,
String slotAccessExpression)
|
protected void |
generateRoleSlotMethodsMultStarHasChild(Role role,
PrintWriter out,
String methodModifiers,
String capitalizedSlotName,
String slotAccessExpression,
String typeName,
String slotName,
boolean isIndexed,
String indexGetterCall)
|
protected void |
generateRoleSlotMethodsMultStarSet(Role role,
PrintWriter out,
String methodModifiers,
String capitalizedSlotName,
String slotAccessExpression,
String slotName,
String typeName)
|
protected void |
generateSetterBody(DomainClass domainClass,
String setterName,
Slot slot,
PrintWriter out)
|
protected void |
generateSetterDAPStatement(DomainClass domainClass,
String slotName,
String typeName,
PrintWriter out)
|
String |
getGetterDAPStatement(DomainClass domainClass,
String slotName,
String typeName)
|
String |
getSetterDAPStatement(DomainClass domainClass,
String slotName,
String typeName)
|
Methods inherited from class pt.ist.fenixframework.dml.CodeGenerator |
capitalize, closeBlock, closeBlock, comment, endMethodBody, findWrapperEntry, generateBackEndId, generateBaseClass, generateBaseClassBody, generateBaseClassConstructorsBody, generateCode, generateCurrentBackEndIdClass, generateDefaultRelationListeners, generateFilePreamble, generateGetter, generateInitInstance, generateInitInstanceInitializer, generateInitInstanceMethod, generateInitInstanceMethodBody, generateInitInstanceNoArg, generateInitRoleSlot, generateIteratorMethod, generateOneClass, generatePackageDecl, generatePublicClass, generatePublicClassConstructors, generatePublicFilePreamble, generateRelationGetter, generateRelationGetter, generateRoleGetter, generateRoleMethodGetInverseRole, generateRoleSlot, generateRoleSlotMethods, generateRoleSlotMethodsMultOne, generateRoleSlotMethodsMultOneGetter, generateRoleSlotMethodsMultOneSetter, generateRoleSlotMethodsMultStar, generateRoleSlotMethodsMultStarGettersAndIterators, generateRoleSlots, generateRoleSlotsMethods, generateSetter, generateSlot, generateSlotAccessors, generateSlotDeclaration, generateSlotGetter, generateSlots, generateSlotsAccessors, generateSlotSetter, generateStaticRelationSlots, generateStaticRoleSlots, generateStaticRoleSlotsMultOne, generateStaticRoleSlotsMultStar, generateStaticSlots, getAdderMethodName, getBaseDirectoryFor, getCollectionTypeFor, getConcreteSetTypeDeclarationFor, getDefaultCollectionFor, getDirectoryFor, getDirectRelationType, getDomainClassRoot, getDomainModel, getEntityFullName, getMethodModifiers, getNewRoleStarSlotExpression, getPackageName, getPackagePrefix, getReferenceType, getRelationAwareBaseTypeFor, getRelationAwareTypeFor, getRelationSlotNameFor, getRemoverMethodName, getRoleArgs, getRoleBaseType, getRoleHandlerName, getRoleManyBaseType, getRoleOneBaseType, getRoleType, getSetTypeDeclarationFor, getSlotExpression, getTypeFullName, makeArg, makeGenericType, newBlock, newline, onNewline, print, printFinalMethod, println, printMethod, printWords, setCollectionToUse, startMethodBody, writeToFile |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DAP_ON_CONFIG_KEY
public static final String DAP_ON_CONFIG_KEY
- See Also:
- Constant Field Values
DAP_ON_CONFIG_VALUE
public static final String DAP_ON_CONFIG_VALUE
- See Also:
- Constant Field Values
dC
protected static DomainClass dC
DAPCodeGenerator
public DAPCodeGenerator(CompilerArgs compArgs,
DomainModel domainModel)
getGetterDAPStatement
public final String getGetterDAPStatement(DomainClass domainClass,
String slotName,
String typeName)
getSetterDAPStatement
public final String getSetterDAPStatement(DomainClass domainClass,
String slotName,
String typeName)
generateGetterDAPStatement
protected final void generateGetterDAPStatement(DomainClass domainClass,
String slotName,
String typeName,
PrintWriter out)
generateSetterDAPStatement
protected final void generateSetterDAPStatement(DomainClass domainClass,
String slotName,
String typeName,
PrintWriter out)
generateClasses
protected void generateClasses(Iterator classesIter)
- Overrides:
generateClasses
in class CodeGenerator
generateGetterBody
protected void generateGetterBody(String slotName,
String typeName,
PrintWriter out)
- Overrides:
generateGetterBody
in class CodeGenerator
generateSetterBody
protected void generateSetterBody(DomainClass domainClass,
String setterName,
Slot slot,
PrintWriter out)
- Overrides:
generateSetterBody
in class CodeGenerator
generateRoleSlotMethodsMultOneHas
protected void generateRoleSlotMethodsMultOneHas(Role role,
PrintWriter out)
- Overrides:
generateRoleSlotMethodsMultOneHas
in class CodeGenerator
generateRoleSlotMethodsMultOneRemove
protected void generateRoleSlotMethodsMultOneRemove(Role role,
PrintWriter out)
- Overrides:
generateRoleSlotMethodsMultOneRemove
in class CodeGenerator
generateRoleSlotMethodsMultStarCount
protected void generateRoleSlotMethodsMultStarCount(Role role,
PrintWriter out,
String methodModifiers,
String capitalizedSlotName,
String slotAccessExpression)
- Overrides:
generateRoleSlotMethodsMultStarCount
in class CodeGenerator
generateRoleSlotMethodsMultStarHasAnyChild
protected void generateRoleSlotMethodsMultStarHasAnyChild(Role role,
PrintWriter out,
String methodModifiers,
String capitalizedSlotName,
String slotAccessExpression)
- Overrides:
generateRoleSlotMethodsMultStarHasAnyChild
in class CodeGenerator
generateRoleSlotMethodsMultStarHasChild
protected void generateRoleSlotMethodsMultStarHasChild(Role role,
PrintWriter out,
String methodModifiers,
String capitalizedSlotName,
String slotAccessExpression,
String typeName,
String slotName,
boolean isIndexed,
String indexGetterCall)
- Overrides:
generateRoleSlotMethodsMultStarHasChild
in class CodeGenerator
generateRoleSlotMethodsMultStarSet
protected void generateRoleSlotMethodsMultStarSet(Role role,
PrintWriter out,
String methodModifiers,
String capitalizedSlotName,
String slotAccessExpression,
String slotName,
String typeName)
- Overrides:
generateRoleSlotMethodsMultStarSet
in class CodeGenerator
generateRelationGetter
protected void generateRelationGetter(String getterName,
String valueToReturn,
Role role,
String typeName,
PrintWriter out)
- Overrides:
generateRelationGetter
in class CodeGenerator
generateIteratorMethod
protected void generateIteratorMethod(Role role,
PrintWriter out,
String slotAccessExpression)
- Overrides:
generateIteratorMethod
in class CodeGenerator
generateRelationAddMethodCall
protected void generateRelationAddMethodCall(Role role,
String otherArg,
String indexParam,
PrintWriter out)
- Overrides:
generateRelationAddMethodCall
in class CodeGenerator
generateRelationRemoveMethodCall
protected void generateRelationRemoveMethodCall(Role role,
String otherArg,
PrintWriter out)
- Overrides:
generateRelationRemoveMethodCall
in class CodeGenerator
generateBackEndIdClassBody
protected void generateBackEndIdClassBody(PrintWriter out)
- Overrides:
generateBackEndIdClassBody
in class CodeGenerator
Copyright © 2013. All Rights Reserved.