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 {
}
PayBy payByCheque = new PayByQualifier() {
public PaymentMethod value() {
return CHEQUE;
}
};
javax.enterprise.inject.Instance#select(Annotation...), javax.enterprise.event.Event#select(Annotation...)
| Modifier and Type | Field and Description |
|---|---|
| private transient Class | |
| private transient Integer | |
| private transient Method[] | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public Class | annotationType()
Implements java. |
| private void | |
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. Implements java. |
| private static Class | |
| private Method[] | |
| private static Object | |
| private static <T> Class | |
| public int | hashCode()
Overrides java. Implements java. |
| private static Object | |
| public String | toString()
Overrides java. Implements java. |
| annotationType | back to summary |
|---|---|
| private transient Class<T> annotationType | |
| cachedHashCode | back to summary |
|---|---|
| private transient Integer cachedHashCode | |
| members | back to summary |
|---|---|
| private transient Method[] members | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| AnnotationLiteral | back to summary |
|---|---|
| protected AnnotationLiteral() | |
| annotationType | back to summary |
|---|---|
| public Class Implements java. Doc from java. Returns the annotation interface of this annotation.
| |
| appendInBraces | back to summary |
|---|---|
| private void appendInBraces(StringBuilder buf, String s) | |
| 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() | |
| getMemberValue | back to summary |
|---|---|
| private static Object getMemberValue(Method member, Annotation instance) | |
| 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) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Implements java. Doc from java. Returns a string representation of this annotation. The details of the representation are implementation-dependent, but the following may be regarded as typical: @com.example.Name(first="Duke", middle="of", last="Java") | |