Supports inline instantiation of annotation type instances.
An instance of an annotation type may be obtained by subclassing AnnotationLiteral.
public abstract class PayByQualifier
extends AnnotationLiteral<PayBy>
implements PayBy {}
An extension of AnnotationLiteral must do two things:
| Modifier and Type | Field and Description |
|---|---|
| private transient Class | |
| private transient Method[] | |
| private static final long | serialVersionUID
For serialization |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public Class | annotationType()
Implements java. Returns the annotation interface of this annotation. |
| public boolean | equals(Object other)
Overrides java. Implements java. Returns true if the specified object represents an annotation that is logically equivalent to this one. |
| private static Class | |
| private Method[] | |
| private static <T> Class | |
| public int | hashCode()
Overrides java. Implements java. Returns the hash code of this annotation. |
| private static Object | |
| private static void |
| annotationType | back to summary |
|---|---|
| private transient Class<T> annotationType | |
| members | back to summary |
|---|---|
| private transient Method[] members | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID For serialization | |
| AnnotationLiteral | back to summary |
|---|---|
| protected AnnotationLiteral() | |
| annotationType | back to summary |
|---|---|
| public Class Implements java. Doc from java. Returns the annotation interface of this annotation. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Implements java. Doc from java. Returns true if the specified object represents an annotation that is logically equivalent to this one. In other words, returns true if the specified object is an instance of the same annotation interface as this instance, all of whose members are equal to the corresponding member of this annotation, as defined below:
| |
| getAnnotationLiteralSubclass | back to summary |
|---|---|
| private static Class | |
| getMembers | back to summary |
|---|---|
| private Method[] getMembers() | |
| getTypeParameter | back to summary |
|---|---|
private static <T> Class
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements java. Doc from java. Returns the hash code of this annotation. The hash code of an annotation is the sum of the hash codes
of its members (including those with default values).
The hash code of an annotation member is (127 times the hash code
of the member-name as computed by
| |
| invoke | back to summary |
|---|---|
| private static Object invoke(Method method, Object instance) | |
| setAccessible | back to summary |
|---|---|
| private static void setAccessible(final AccessibleObject ao) | |