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
- Direct Known Subclasses:
Alternative.Literal
,Any.Literal
,ApplicationScoped.Literal
,BeforeDestroyed.Literal
,ClaimLiteral
,ConversationScoped.Literal
,Default.Literal
,Dependent.Literal
,Destroyed.Literal
,Initialized.Literal
,InjectLiteral
,NamedLiteral
,New.Literal
,Nonbinding.Literal
,QualifierLiteral
,RequestScoped.Literal
,RestClient.RestClientLiteral
,SessionScoped.Literal
,SingletonLiteral
,Specializes.Literal
,TransientReference.Literal
,Typed.Literal
,Vetoed.Literal
public abstract class AnnotationLiteral<T extends java.lang.annotation.Annotation> extends java.lang.Object implements java.lang.annotation.Annotation, java.io.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; } };
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AnnotationLiteral()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<? extends java.lang.annotation.Annotation>
annotationType()
boolean
equals(java.lang.Object other)
int
hashCode()
java.lang.String
toString()
-
-
-
Method Detail
-
annotationType
public java.lang.Class<? extends java.lang.annotation.Annotation> annotationType()
- Specified by:
annotationType
in interfacejava.lang.annotation.Annotation
-
toString
public java.lang.String toString()
- Specified by:
toString
in interfacejava.lang.annotation.Annotation
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Specified by:
equals
in interfacejava.lang.annotation.Annotation
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.lang.annotation.Annotation
- Overrides:
hashCode
in classjava.lang.Object
-
-