public abstract class Enhancer extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Enhancer.ApplicationClassesClasspath
Dumb classpath implementation for javassist hacking
|
Modifier and Type | Field and Description |
---|---|
protected javassist.ClassPool |
classPool |
Constructor and Description |
---|
Enhancer() |
Modifier and Type | Method and Description |
---|---|
protected static void |
createAnnotation(javassist.bytecode.AnnotationsAttribute attribute,
Class<? extends Annotation> annotationType)
Create a new annotation to be dynamically inserted in the byte code.
|
protected static void |
createAnnotation(javassist.bytecode.AnnotationsAttribute attribute,
Class<? extends Annotation> annotationType,
Map<String,javassist.bytecode.annotation.MemberValue> members)
Create a new annotation to be dynamically inserted in the byte code.
|
abstract void |
enhanceThisClass(ApplicationClasses.ApplicationClass applicationClass)
The magic happen here...
|
protected static javassist.bytecode.AnnotationsAttribute |
getAnnotations(javassist.CtClass ctClass)
Retrieve all class annotations.
|
protected static javassist.bytecode.AnnotationsAttribute |
getAnnotations(javassist.CtField ctField)
Retrieve all field annotations.
|
protected static javassist.bytecode.AnnotationsAttribute |
getAnnotations(javassist.CtMethod ctMethod)
Retrieve all method annotations.
|
protected boolean |
hasAnnotation(javassist.CtClass ctClass,
String annotation)
Test if a class has the provided annotation
|
protected boolean |
hasAnnotation(javassist.CtField ctField,
String annotation)
Test if a field has the provided annotation
|
protected boolean |
hasAnnotation(javassist.CtMethod ctMethod,
String annotation)
Test if a method has the provided annotation
|
javassist.CtClass |
makeClass(ApplicationClasses.ApplicationClass applicationClass)
Construct a javassist CtClass from an application class.
|
static javassist.ClassPool |
newClassPool() |
public static javassist.ClassPool newClassPool()
public javassist.CtClass makeClass(ApplicationClasses.ApplicationClass applicationClass) throws IOException
IOException
public abstract void enhanceThisClass(ApplicationClasses.ApplicationClass applicationClass) throws Exception
Exception
protected boolean hasAnnotation(javassist.CtClass ctClass, String annotation) throws ClassNotFoundException
ctClass
- the javassist class representationannotation
- fully qualified name of the annotation class eg."javax.persistence.Entity"ClassNotFoundException
protected boolean hasAnnotation(javassist.CtField ctField, String annotation) throws ClassNotFoundException
ctField
- the javassist field representationannotation
- fully qualified name of the annotation class eg."javax.persistence.Entity"ClassNotFoundException
protected boolean hasAnnotation(javassist.CtMethod ctMethod, String annotation) throws ClassNotFoundException
ctMethod
- the javassist method representationannotation
- fully qualified name of the annotation class eg."javax.persistence.Entity"ClassNotFoundException
protected static void createAnnotation(javassist.bytecode.AnnotationsAttribute attribute, Class<? extends Annotation> annotationType, Map<String,javassist.bytecode.annotation.MemberValue> members)
protected static void createAnnotation(javassist.bytecode.AnnotationsAttribute attribute, Class<? extends Annotation> annotationType)
protected static javassist.bytecode.AnnotationsAttribute getAnnotations(javassist.CtClass ctClass)
protected static javassist.bytecode.AnnotationsAttribute getAnnotations(javassist.CtField ctField)
protected static javassist.bytecode.AnnotationsAttribute getAnnotations(javassist.CtMethod ctMethod)
Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly