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 extends annotation> annotationClass = ...; Annotation a = DefaultAnnotation.of(annotationClass)
Modifier and Type | Method and Description |
---|---|
Class<? extends Annotation> |
annotationType() |
boolean |
equals(Object o) |
int |
hashCode() |
Object |
invoke(Object proxy,
Method method,
Object[] args) |
static <T extends Annotation> |
of(Class<T> annotationClass)
Creates an annotation instance for the given annotation class
|
String |
toString()
Copied from Apache OWB (javax.enterprise.util.AnnotationLiteral#toString())
with minor changes.
|
public static <T extends Annotation> T of(Class<T> annotationClass)
T
- current typeannotationClass
- type of the target annotationpublic Object invoke(Object proxy, Method method, Object[] args) throws Exception
invoke
in interface InvocationHandler
Exception
public Class<? extends Annotation> annotationType()
annotationType
in interface Annotation
public String toString()
toString
in interface Annotation
toString
in class Object
public boolean equals(Object o)
equals
in interface Annotation
equals
in class Object
public int hashCode()
hashCode
in interface Annotation
hashCode
in class Object
Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.