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 FormConstructor 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 InvocationHandler
Throwable
public Class<? extends Annotation> annotationType()
annotationType
in interface Annotation
public boolean equals(Object obj)
Annotation.equals(Object)
.equals
in interface Annotation
equals
in class Object
obj
- The object to compareAnnotation.equals(Object)
public int hashCode()
Annotation.hashCode()
.hashCode
in interface Annotation
hashCode
in class Object
Annotation.hashCode()
public String toString()
toString
in interface Annotation
toString
in class Object
Copyright © 2007-2014 Red Hat, Inc. All Rights Reserved