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 InvocationHandlerExceptionpublic Class<? extends Annotation> annotationType()
annotationType in interface Annotationpublic String toString()
toString in interface AnnotationtoString in class Objectpublic boolean equals(Object o)
equals in interface Annotationequals in class Objectpublic int hashCode()
hashCode in interface AnnotationhashCode in class ObjectCopyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.