Package jnr.ffi.util
Class AnnotationProxy<A extends java.lang.annotation.Annotation>
- java.lang.Object
-
- jnr.ffi.util.AnnotationProxy<A>
-
- Type Parameters:
A- The annotation type has to be proxed.
- All Implemented Interfaces:
java.lang.annotation.Annotation,java.lang.reflect.InvocationHandler
public final class AnnotationProxy<A extends java.lang.annotation.Annotation> extends java.lang.Object implements java.lang.annotation.Annotation, java.lang.reflect.InvocationHandler- Version:
- $Id$
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<? extends java.lang.annotation.Annotation>annotationType()booleanequals(java.lang.Object obj)java.lang.ObjectgetProperty(java.lang.String name)Returns the property value, given the name, if present.AgetProxedAnnotation()Returns the proxed annotation.inthashCode()java.lang.Objectinvoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)static <A extends java.lang.annotation.Annotation>
AnnotationProxy<A>newProxy(java.lang.Class<A> annotationType)Creates a new annotation proxy.voidsetProperty(java.lang.String name, java.lang.Object value)Set a property value.java.lang.StringtoString()
-
-
-
Method Detail
-
newProxy
public static <A extends java.lang.annotation.Annotation> AnnotationProxy<A> newProxy(java.lang.Class<A> annotationType)
Creates a new annotation proxy.- Type Parameters:
A- the annotation type has to be proxed.- Parameters:
annotationType- the annotation type class has to be proxed.- Returns:
- a new annotation proxy.
-
setProperty
public void setProperty(java.lang.String name, java.lang.Object value)Set a property value.- Parameters:
name- the property name.value- the property value.
-
getProperty
public java.lang.Object getProperty(java.lang.String name)
Returns the property value, given the name, if present.- Parameters:
name- the property name.- Returns:
- the property value, given the name, if present.
-
invoke
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable- Specified by:
invokein interfacejava.lang.reflect.InvocationHandler- Throws:
java.lang.Throwable
-
annotationType
public java.lang.Class<? extends java.lang.annotation.Annotation> annotationType()
- Specified by:
annotationTypein interfacejava.lang.annotation.Annotation
-
getProxedAnnotation
public A getProxedAnnotation()
Returns the proxed annotation.- Returns:
- the proxed annotation.
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equalsin interfacejava.lang.annotation.Annotation- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacejava.lang.annotation.Annotation- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Specified by:
toStringin interfacejava.lang.annotation.Annotation- Overrides:
toStringin classjava.lang.Object
-
-