public class AnnotationUtil extends Object
| Constructor and Description |
|---|
AnnotationUtil() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends Annotation> |
createAnnotation(Class<T> clazz) |
static <T extends Annotation> |
declaredAnnotation(Class c,
Class<T> annoClass) |
static int |
hashCode(Annotation a)
Generate a hash code for the given annotation using the algorithm
presented in the
Annotation.hashCode() API docs. |
static int |
hashMember(String name,
Object value)
Helper method for generating a hash code for a member of an annotation.
|
static <T extends Annotation> |
tagAnnotation(Annotation annotation,
Class<T> tagClass)
Returns the
Annotation tagged on another annotation instance |
public static <T extends Annotation> T declaredAnnotation(Class c, Class<T> annoClass)
public static <T extends Annotation> T tagAnnotation(Annotation annotation, Class<T> tagClass)
Returns the Annotation tagged on another annotation instance
annotation - the annotation instancetagClass - the expected annotation classT - the generic type of the expected annotationtagClasspublic static <T extends Annotation> T createAnnotation(Class<T> clazz)
public static int hashCode(Annotation a)
Generate a hash code for the given annotation using the algorithm
presented in the Annotation.hashCode() API docs.
a - the Annotation for a hash code calculation is desired, not nullRuntimeException - if an Exception is encountered during annotation member accessIllegalStateException - if an annotation method invocation returns nullCopyright © 2017. All Rights Reserved.