|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpt.digitalis.dif.codegen.util.ClassEnhancementContext
public class ClassEnhancementContext
Holds the information needed to enhance a set of classes.
Constructor Summary | |
---|---|
ClassEnhancementContext(pt.digitalis.utils.bytecode.holders.ClassHolder classHolder)
Builds a class enhancement context from a class holder. |
|
ClassEnhancementContext(String originalClassID)
Builds a class enhancement context from a class ID. |
Method Summary | |
---|---|
void |
addEnhancement(String className,
ClassMethodEnhancement enhancement)
Adds an enhancement to a given class method. |
void |
addEnhancement(String methodName,
String enhancement)
Adds an enhancement to a given class method. |
void |
addEnhancement(String className,
String methodName,
String enhancement)
Adds an enhancement to a given class method. |
void |
addEnhancementTerminatorCode(String className,
String methodName,
String terminator)
Adds an enhancement to a given class method. |
void |
commitEnhancements()
Commits all the enhancements to a class file and returns the class holder object. |
boolean |
containsEnhancement(String methodName)
Inspects the enhancement map to see of the given method has been inserted for enhancement |
boolean |
containsEnhancement(String className,
String methodName)
Inspects the enhancement map to see of the given method has been inserted for enhancement |
Map<String,ClassEnhancements> |
getClassEnhancements()
Returns the class enhancements map. |
pt.digitalis.utils.bytecode.holders.ClassHolder |
getEntityClass()
Return the enriched entity class holder. |
String |
getOriginalClassName()
Returns the original class name. |
pt.digitalis.utils.bytecode.holders.ClassHolder |
getOriginalClassObject()
Return the original POJO class holder. |
void |
setEnhancements(String className,
String methodName,
String enhancement)
Adds an enhancement to a given class method. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ClassEnhancementContext(pt.digitalis.utils.bytecode.holders.ClassHolder classHolder) throws pt.digitalis.utils.inspection.exception.ResourceNotFoundException, pt.digitalis.utils.bytecode.exceptions.CodeGenerationException
classHolder
- the class holder for the class to enhance
pt.digitalis.utils.inspection.exception.ResourceNotFoundException
- if the class annotations can't be read
pt.digitalis.utils.bytecode.exceptions.CodeGenerationException
- if the passed class holder isn't a valid DEM entity or the class holder's target semantics is
incorrectpublic ClassEnhancementContext(String originalClassID) throws pt.digitalis.utils.inspection.exception.ResourceNotFoundException, pt.digitalis.utils.bytecode.exceptions.CodeGenerationException
originalClassID
- the original annotated class
pt.digitalis.utils.inspection.exception.ResourceNotFoundException
- if the class with the given id can't be found
pt.digitalis.utils.bytecode.exceptions.CodeGenerationException
- if the code can't be compiledMethod Detail |
---|
public void addEnhancement(String className, ClassMethodEnhancement enhancement) throws DIFCodeGenerationException
className
- the name of the class to add the enhancement toenhancement
- the enhancement to add
DIFCodeGenerationException
public void addEnhancement(String methodName, String enhancement) throws DIFCodeGenerationException
methodName
- the name of the method to add the enhancement toenhancement
- the enhancement to add
DIFCodeGenerationException
public void addEnhancement(String className, String methodName, String enhancement) throws DIFCodeGenerationException
className
- the name of the class to add the enhancement tomethodName
- the name of the method to add the enhancement toenhancement
- the enhancement to add
DIFCodeGenerationException
public void addEnhancementTerminatorCode(String className, String methodName, String terminator) throws DIFCodeGenerationException
className
- the name of the class to add the enhancement tomethodName
- the name of the method to add the enhancement toterminator
- the finalize code for the method
DIFCodeGenerationException
public void commitEnhancements() throws pt.digitalis.utils.inspection.exception.ResourceNotFoundException, pt.digitalis.utils.bytecode.exceptions.CodeGenerationException
pt.digitalis.utils.inspection.exception.ResourceNotFoundException
- if the class can't be found
pt.digitalis.utils.bytecode.exceptions.CodeGenerationException
- if the code can't be compiledpublic boolean containsEnhancement(String methodName)
methodName
- the name of the method to add the enhancement to
public boolean containsEnhancement(String className, String methodName)
className
- the name of the class to add the enhancement tomethodName
- the name of the method to add the enhancement to
public Map<String,ClassEnhancements> getClassEnhancements()
public pt.digitalis.utils.bytecode.holders.ClassHolder getEntityClass()
public pt.digitalis.utils.bytecode.holders.ClassHolder getOriginalClassObject()
public String getOriginalClassName()
public void setEnhancements(String className, String methodName, String enhancement)
className
- the name of the class to add the enhancement tomethodName
- the name of the method to add the enhancement toenhancement
- the enhancement to addpublic String toString()
toString
in class Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |