public class AnnotationProxy extends Object implements Annotation, InvocationHandler, Serializable
Annotation that pretends it is a
"real" source code annotation. It's also an InvocationHandler.
When you create an AnnotationProxy, you must initialize it
with an AnnotationDescriptor.
The adapter checks that the provided elements are the same elements defined
in the annotation interface. However, it does not check that their
values are the right type. If you omit an element, the adapter will use the
default value for that element from the annotation interface, if it exists.
If no default exists, it will throw an exception.
Annotation,
Serialized Form| Constructor and Description |
|---|
AnnotationProxy(AnnotationDescriptor<?> descriptor) |
| Modifier and Type | Method and Description |
|---|---|
Class<? extends Annotation> |
annotationType() |
boolean |
equals(Object obj)
Performs an equality check as described in
Annotation.equals(Object). |
int |
hashCode()
Calculates the hash code of this annotation proxy as described in
Annotation.hashCode(). |
Object |
invoke(Object proxy,
Method method,
Object[] args) |
String |
toString() |
public AnnotationProxy(AnnotationDescriptor<?> descriptor)
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke in interface InvocationHandlerThrowablepublic Class<? extends Annotation> annotationType()
annotationType in interface Annotationpublic boolean equals(Object obj)
Annotation.equals(Object).equals in interface Annotationequals in class Objectobj - The object to compareAnnotation.equals(Object)public int hashCode()
Annotation.hashCode().hashCode in interface AnnotationhashCode in class ObjectAnnotation.hashCode()public String toString()
toString in interface AnnotationtoString in class ObjectCopyright © 2007-2014 Red Hat, Inc. All Rights Reserved