Package javassist.bytecode.annotation
Class AnnotationImpl
- java.lang.Object
-
- javassist.bytecode.annotation.AnnotationImpl
-
- All Implemented Interfaces:
java.lang.reflect.InvocationHandler
public class AnnotationImpl extends java.lang.Object implements java.lang.reflect.InvocationHandlerInternal-use only. This is a helper class internally used for implementingtoAnnotationType()inAnnotation.- Author:
- Shigeru Chiba, Bill Burke, Adrian Brock
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AnnotationgetAnnotation()Obtains the internal data structure representing the annotation.java.lang.StringgetTypeName()Obtains the name of the annotation type.inthashCode()Returns a hash code value for this object.java.lang.Objectinvoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)Executes a method invocation on a proxy instance.static java.lang.Objectmake(java.lang.ClassLoader cl, java.lang.Class<?> clazz, ClassPool cp, Annotation anon)Constructs an annotation object.
-
-
-
Method Detail
-
make
public static java.lang.Object make(java.lang.ClassLoader cl, java.lang.Class<?> clazz, ClassPool cp, Annotation anon) throws java.lang.IllegalArgumentExceptionConstructs 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.- Returns:
- the annotation
- Throws:
java.lang.IllegalArgumentException
-
getTypeName
public java.lang.String getTypeName()
Obtains the name of the annotation type.- Returns:
- the type name
-
getAnnotation
public Annotation getAnnotation()
Obtains the internal data structure representing the annotation.- Returns:
- the annotation
-
invoke
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.ThrowableExecutes a method invocation on a proxy instance. The implementations oftoString(),equals(), andhashCode()are directly supplied by theAnnotationImpl. TheannotationType()method is also available on the proxy instance.- Specified by:
invokein interfacejava.lang.reflect.InvocationHandler- Throws:
java.lang.Throwable
-
hashCode
public int hashCode()
Returns a hash code value for this object.- Overrides:
hashCodein classjava.lang.Object
-
-