org.apache.myfaces.extensions.cdi.core.api.tools
Class DefaultAnnotation

java.lang.Object
  extended by org.apache.myfaces.extensions.cdi.core.api.tools.DefaultAnnotation
All Implemented Interfaces:
Serializable, Annotation, InvocationHandler

public class DefaultAnnotation
extends Object
implements Annotation, InvocationHandler, Serializable

A small helper class to create an Annotation instance of the given annotation class via Proxy. The annotation literal gets filled with the default values.

usage:

 Class annotationClass = ...;
 Annotation a = DefaultAnnotation.of(annotationClass)
 

See Also:
Serialized Form

Method Summary
 Class<? extends Annotation> annotationType()
           
 boolean equals(Object o)
           
 int hashCode()
           
 Object invoke(Object proxy, Method method, Object[] args)
           
static
<T extends Annotation>
T
of(Class<T> annotationClass)
           
 String toString()
          Copied from javax.enterprise.util.AnnotationLiteral#toString() with minor changes.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

of

public static <T extends Annotation> T of(Class<T> annotationClass)

invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] args)
              throws Throwable
Specified by:
invoke in interface InvocationHandler
Throws:
Throwable

annotationType

public Class<? extends Annotation> annotationType()
Specified by:
annotationType in interface Annotation

toString

public String toString()
Copied from javax.enterprise.util.AnnotationLiteral#toString() with minor changes.

Specified by:
toString in interface Annotation
Overrides:
toString in class Object
Returns:

equals

public boolean equals(Object o)
Specified by:
equals in interface Annotation
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Annotation
Overrides:
hashCode in class Object


Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.