play.classloading.enhancers
类 Enhancer

java.lang.Object
  继承者 play.classloading.enhancers.Enhancer
直接已知子类:
ContinuationEnhancer, ControllersEnhancer, JPAEnhancer, LVEnhancer, MailerEnhancer, PropertiesEnhancer, SigEnhancer

public abstract class Enhancer
extends java.lang.Object

Enhancer support


嵌套类摘要
static class Enhancer.ApplicationClassesClasspath
          Dumb classpath implementation for javassist hacking
 
字段摘要
protected  javassist.ClassPool classPool
           
 
构造方法摘要
Enhancer()
           
 
方法摘要
protected static void createAnnotation(javassist.bytecode.AnnotationsAttribute attribute, java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Create a new annotation to be dynamically inserted in the byte code.
protected static void createAnnotation(javassist.bytecode.AnnotationsAttribute attribute, java.lang.Class<? extends java.lang.annotation.Annotation> annotationType, java.util.Map<java.lang.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, java.lang.String annotation)
          Test if a class has the provided annotation
protected  boolean hasAnnotation(javassist.CtField ctField, java.lang.String annotation)
          Test if a field has the provided annotation
protected  boolean hasAnnotation(javassist.CtMethod ctMethod, java.lang.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()
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

classPool

protected javassist.ClassPool classPool
构造方法详细信息

Enhancer

public Enhancer()
方法详细信息

newClassPool

public static javassist.ClassPool newClassPool()

makeClass

public javassist.CtClass makeClass(ApplicationClasses.ApplicationClass applicationClass)
                            throws java.io.IOException
Construct a javassist CtClass from an application class.

抛出:
java.io.IOException

enhanceThisClass

public abstract void enhanceThisClass(ApplicationClasses.ApplicationClass applicationClass)
                               throws java.lang.Exception
The magic happen here...

抛出:
java.lang.Exception

hasAnnotation

protected boolean hasAnnotation(javassist.CtClass ctClass,
                                java.lang.String annotation)
                         throws java.lang.ClassNotFoundException
Test if a class has the provided annotation

参数:
ctClass - the javassist class representation
annotation - fully qualified name of the annotation class eg."javax.persistence.Entity"
返回:
true if class has the annotation
抛出:
java.lang.ClassNotFoundException

hasAnnotation

protected boolean hasAnnotation(javassist.CtField ctField,
                                java.lang.String annotation)
                         throws java.lang.ClassNotFoundException
Test if a field has the provided annotation

参数:
ctField - the javassist field representation
annotation - fully qualified name of the annotation class eg."javax.persistence.Entity"
返回:
true if field has the annotation
抛出:
java.lang.ClassNotFoundException

hasAnnotation

protected boolean hasAnnotation(javassist.CtMethod ctMethod,
                                java.lang.String annotation)
                         throws java.lang.ClassNotFoundException
Test if a method has the provided annotation

参数:
ctMethod - the javassist method representation
annotation - fully qualified name of the annotation class eg."javax.persistence.Entity"
返回:
true if field has the annotation
抛出:
java.lang.ClassNotFoundException

createAnnotation

protected static void createAnnotation(javassist.bytecode.AnnotationsAttribute attribute,
                                       java.lang.Class<? extends java.lang.annotation.Annotation> annotationType,
                                       java.util.Map<java.lang.String,javassist.bytecode.annotation.MemberValue> members)
Create a new annotation to be dynamically inserted in the byte code.


createAnnotation

protected static void createAnnotation(javassist.bytecode.AnnotationsAttribute attribute,
                                       java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Create a new annotation to be dynamically inserted in the byte code.


getAnnotations

protected static javassist.bytecode.AnnotationsAttribute getAnnotations(javassist.CtClass ctClass)
Retrieve all class annotations.


getAnnotations

protected static javassist.bytecode.AnnotationsAttribute getAnnotations(javassist.CtField ctField)
Retrieve all field annotations.


getAnnotations

protected static javassist.bytecode.AnnotationsAttribute getAnnotations(javassist.CtMethod ctMethod)
Retrieve all method annotations.



Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly