A
- The annotation type has to be proxed.public final class AnnotationProxy<A extends java.lang.annotation.Annotation>
extends java.lang.Object
implements java.lang.annotation.Annotation, java.lang.reflect.InvocationHandler
Modifier and Type | Field and Description |
---|---|
private java.lang.Class<A> |
annotationType
The annotation type class has to be proxed.
|
private static int |
MEMBER_NAME_MULTIPLICATOR
The multiplicator required in the hash code calculation.
|
private java.util.Map<java.lang.String,AnnotationProperty> |
properties
The annotation properties registry.
|
private A |
proxedAnnotation
The proxed annotation.
|
Modifier | Constructor and Description |
---|---|
private |
AnnotationProxy(java.lang.Class<A> annotationType)
Build a new proxy annotation given the annotation type.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Class<? extends java.lang.annotation.Annotation> |
annotationType() |
boolean |
equals(java.lang.Object obj) |
private static AnnotationProxy<?> |
getAnnotationProxy(java.lang.Object obj)
Retrieves the annotation proxy, if any, given the annotation.
|
private static <A extends java.lang.annotation.Annotation> |
getDeclaredMethods(java.lang.Class<A> annotationType)
Access to the declared methods of an annotation, given the type.
|
java.lang.Object |
getProperty(java.lang.String name)
Returns the property value, given the name, if present.
|
A |
getProxedAnnotation()
Returns the proxed annotation.
|
int |
hashCode() |
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args) |
static <A extends java.lang.annotation.Annotation> |
newProxy(java.lang.Class<A> annotationType)
Creates a new annotation proxy.
|
void |
setProperty(java.lang.String name,
java.lang.Object value)
Set a property value.
|
java.lang.String |
toString() |
private static final int MEMBER_NAME_MULTIPLICATOR
private final java.lang.Class<A extends java.lang.annotation.Annotation> annotationType
private final java.util.Map<java.lang.String,AnnotationProperty> properties
private final A extends java.lang.annotation.Annotation proxedAnnotation
private AnnotationProxy(java.lang.Class<A> annotationType)
annotationType
- the annotation type class has to be proxed.public static <A extends java.lang.annotation.Annotation> AnnotationProxy<A> newProxy(java.lang.Class<A> annotationType)
A
- the annotation type has to be proxed.annotationType
- the annotation type class has to be proxed.private static AnnotationProxy<?> getAnnotationProxy(java.lang.Object obj)
obj
- the annotation.private static <A extends java.lang.annotation.Annotation> java.lang.reflect.Method[] getDeclaredMethods(java.lang.Class<A> annotationType)
A
- the annotation type.annotationType
- the annotation type class.public void setProperty(java.lang.String name, java.lang.Object value)
name
- the property name.value
- the property value.public java.lang.Object getProperty(java.lang.String name)
name
- the property name.public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
invoke
in interface java.lang.reflect.InvocationHandler
java.lang.Throwable
public java.lang.Class<? extends java.lang.annotation.Annotation> annotationType()
annotationType
in interface java.lang.annotation.Annotation
public A getProxedAnnotation()
public boolean equals(java.lang.Object obj)
equals
in interface java.lang.annotation.Annotation
equals
in class java.lang.Object
public int hashCode()
hashCode
in interface java.lang.annotation.Annotation
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in interface java.lang.annotation.Annotation
toString
in class java.lang.Object