Package javax.enterprise.util
Class AnnotationLiteral<T extends Annotation>
java.lang.Object
javax.enterprise.util.AnnotationLiteral<T>
- Type Parameters:
T- the annotation type
- All Implemented Interfaces:
Serializable,Annotation
- Direct Known Subclasses:
Alternative.Literal,Any.Literal,Default.Literal,InjectLiteral,NamedLiteral,Nonbinding.Literal,QualifierLiteral,SingletonLiteral,Specializes.Literal,TransientReference.Literal,Typed.Literal,Vetoed.Literal
public abstract class AnnotationLiteral<T extends Annotation>
extends Object
implements Annotation, Serializable
Supports inline instantiation of annotation type instances.
Reflection operations are using SecurityActions utility class to support security manager.
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;
}
};
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass<? extends Annotation> private voidappendInBraces(StringBuilder buf, String s) booleanprivate static Class<?> getAnnotationLiteralSubclass(Class<?> clazz) private Method[]private static ObjectgetMemberValue(Method member, Annotation instance) private static <T> Class<T> getTypeParameter(Class<?> annotationLiteralSuperclass) inthashCode()private static ObjecttoString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
annotationType
-
members
-
cachedHashCode
-
-
Constructor Details
-
AnnotationLiteral
protected AnnotationLiteral()
-
-
Method Details
-
getMembers
-
getAnnotationLiteralSubclass
-
getTypeParameter
-
annotationType
- Specified by:
annotationTypein interfaceAnnotation
-
toString
- Specified by:
toStringin interfaceAnnotation- Overrides:
toStringin classObject
-
appendInBraces
-
equals
- Specified by:
equalsin interfaceAnnotation- Overrides:
equalsin classObject
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceAnnotation- Overrides:
hashCodein classObject
-
getMemberValue
-
invoke
-