Class AnnotationProxy<A extends Annotation>
java.lang.Object
jnr.ffi.util.AnnotationProxy<A>
- Type Parameters:
A- The annotation type has to be proxed.
- All Implemented Interfaces:
Annotation, InvocationHandler
public final class AnnotationProxy<A extends Annotation>
extends Object
implements Annotation, InvocationHandler
- Version:
- $Id$
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe annotation type class has to be proxed.private static final intThe multiplicator required in the hash code calculation.private final Map<String, AnnotationProperty> The annotation properties registry.private final AThe proxed annotation. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateAnnotationProxy(Class<A> annotationType) Build a new proxy annotation given the annotation type. -
Method Summary
Modifier and TypeMethodDescriptionClass<? extends Annotation> booleanprivate static AnnotationProxy<?> getAnnotationProxy(Object obj) Retrieves the annotation proxy, if any, given the annotation.private static <A extends Annotation>
Method[]getDeclaredMethods(Class<A> annotationType) Access to the declared methods of an annotation, given the type.getProperty(String name) Returns the property value, given the name, if present.Returns the proxed annotation.inthashCode()static <A extends Annotation>
AnnotationProxy<A> Creates a new annotation proxy.voidsetProperty(String name, Object value) Set a property value.toString()
-
Field Details
-
MEMBER_NAME_MULTIPLICATOR
private static final int MEMBER_NAME_MULTIPLICATORThe multiplicator required in the hash code calculation.- See Also:
-
annotationType
The annotation type class has to be proxed. -
properties
The annotation properties registry. -
proxedAnnotation
The proxed annotation.
-
-
Constructor Details
-
AnnotationProxy
-
-
Method Details
-
newProxy
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.
-
getAnnotationProxy
Retrieves the annotation proxy, if any, given the annotation.- Parameters:
obj- the annotation.- Returns:
- the annotation proxy, if any, given the annotation.
-
getDeclaredMethods
Access to the declared methods of an annotation, given the type.- Type Parameters:
A- the annotation type.- Parameters:
annotationType- the annotation type class.- Returns:
- the declared methods of an annotation, given the type.
-
setProperty
-
getProperty
-
invoke
-
annotationType
- Specified by:
annotationTypein interfaceAnnotation
-
getProxedAnnotation
-
equals
- Specified by:
equalsin interfaceAnnotation- Overrides:
equalsin classObject
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceAnnotation- Overrides:
hashCodein classObject
-
toString
- Specified by:
toStringin interfaceAnnotation- Overrides:
toStringin classObject
-