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:
ClaimLiteral, RestClient.RestClientLiteral

public abstract class AnnotationLiteral<T extends Annotation> extends Object implements Annotation, Serializable

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;
     }
 };
 
See Also: