javassist.bytecode.annotation
Class AnnotationImpl

java.lang.Object
  extended byjavassist.bytecode.annotation.AnnotationImpl
All Implemented Interfaces:
java.lang.reflect.InvocationHandler

public class AnnotationImpl
extends java.lang.Object
implements java.lang.reflect.InvocationHandler

Internal-use only. This is a helper class internally used for implementing toAnnotationType() in Annotation.


Method Summary
 Annotation getAnnotation()
          Obtains the internal data structure representing the annotation.
 java.lang.String getTypeName()
          Obtains the name of the annotation type.
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
          Executes a method invocation on a proxy instance.
static java.lang.Object make(java.lang.ClassLoader cl, java.lang.Class clazz, ClassPool cp, Annotation anon)
          Constructs an annotation object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

make

public static java.lang.Object make(java.lang.ClassLoader cl,
                                    java.lang.Class clazz,
                                    ClassPool cp,
                                    Annotation anon)
Constructs an annotation object.

Parameters:
cl - class loader for obtaining annotation types.
clazz - the annotation type.
cp - class pool for containing an annotation type (or null).
anon - the annotation.

getTypeName

public java.lang.String getTypeName()
Obtains the name of the annotation type.


getAnnotation

public Annotation getAnnotation()
Obtains the internal data structure representing the annotation.


invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Executes a method invocation on a proxy instance. The implementations of toString(), equals(), and hashCode() are directly supplied by the AnnotationImpl. The annotationType() method is also available on the proxy instance.

Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Throws:
java.lang.Throwable


Javassist, a Java-bytecode translator toolkit.
Copyright (C) 1999-2006 Shigeru Chiba. All Rights Reserved.