javax.enterprise.util
Class AnnotationLiteral<T extends java.lang.annotation.Annotation>

java.lang.Object
  extended by javax.enterprise.util.AnnotationLiteral<T>
All Implemented Interfaces:
java.io.Serializable, java.lang.annotation.Annotation
Direct Known Subclasses:
AccessTimeoutLiteral, AdminLiteral, AfterBeginLiteral, AnyLiteral, AroundInvokeLiteral, AsynchronousLiteral, BamServiceLiteral, BeanNameLiteral, BeforeCompletionLiteral, ConcurrencyManagementLiteral, DefaultLiteral, EjbQualifierLiteral, ExcludeClassInterceptorsLiteral, ExcludeDefaultInterceptorsLiteral, InterceptorLiteral, InterceptorsDefaultLiteral, InterceptorsLiteral, LocalBeanLiteral, LockingAttributeLiteral, LockLiteral, NamedLiteral, Names, NewLiteral, PostConstructLiteral, PreDestroyLiteral, RemoveLiteral, SingletonLiteral, StatefulLiteral, StatefulTimeoutLiteral, StatelessLiteral, TransactionAttributeLiteral, TransactionManagementLiteral, XaCallbackLiteral, XmlCookieLiteral

public abstract class AnnotationLiteral<T extends java.lang.annotation.Annotation>
extends java.lang.Object
implements java.lang.annotation.Annotation, java.io.Serializable

Convenience API to create runtime Annotations.

 Annotation current = new AnnotationLiteral<Current>() {}
 
 Annotation named = new AnnotationLiteral<Named>() {
   public String name() { return "my-name"; }
 }
 

See Also:
Serialized Form

Constructor Summary
protected AnnotationLiteral()
           
 
Method Summary
 java.lang.Class<? extends java.lang.annotation.Annotation> annotationType()
           
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnnotationLiteral

protected AnnotationLiteral()
Method Detail

annotationType

public java.lang.Class<? extends java.lang.annotation.Annotation> annotationType()
Specified by:
annotationType in interface java.lang.annotation.Annotation

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface java.lang.annotation.Annotation
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Specified by:
hashCode in interface java.lang.annotation.Annotation
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Specified by:
toString in interface java.lang.annotation.Annotation
Overrides:
toString in class java.lang.Object