Package javax.enterprise.util
Class AnnotationLiteral<T extends java.lang.annotation.Annotation>
- java.lang.Object
-
- javax.enterprise.util.AnnotationLiteral<T>
-
- Type Parameters:
T- the annotation type
- All Implemented Interfaces:
java.io.Serializable,java.lang.annotation.Annotation
public abstract class AnnotationLiteral<T extends java.lang.annotation.Annotation> extends java.lang.Object implements java.lang.annotation.Annotation, java.io.SerializableSupports 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; } };- Author:
- Pete Muir, Gavin King, Marko Luksa
- See Also:
Instance.select(Annotation...),Event.select(Annotation...), Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAnnotationLiteral()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<? extends java.lang.annotation.Annotation>annotationType()booleanequals(java.lang.Object other)inthashCode()java.lang.StringtoString()
-
-
-
Method Detail
-
annotationType
public java.lang.Class<? extends java.lang.annotation.Annotation> annotationType()
- Specified by:
annotationTypein interfacejava.lang.annotation.Annotation
-
toString
public java.lang.String toString()
- Specified by:
toStringin interfacejava.lang.annotation.Annotation- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Specified by:
equalsin interfacejava.lang.annotation.Annotation- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacejava.lang.annotation.Annotation- Overrides:
hashCodein classjava.lang.Object
-
-