public final class AnnotationUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T extends Annotation> |
findAnnotation(Class<?> clazz,
Class<T> annotationClazz)
Returns the annotation object for the specified annotation class of the
given class object.
|
static <T extends Annotation> |
findAnnotation(Method m,
Class<?> clazz,
Class<T> annotationClazz)
Returns the annotation object for the specified annotation class of
either the method if it can be found, or of the given class object.
|
static <T extends Annotation> |
findAnnotation(Method m,
Class<T> annotationClazz)
Returns the annotation object for the specified annotation class of the
method if it can be found, otherwise null.
|
static Set<Annotation> |
getAllAnnotations(Class<?> clazz)
Returns all annotations of a class, also the annotations of the super
classes, implemented interfaces and the annotations that are present in
stereotype annotations.
|
static Set<Annotation> |
getAllAnnotations(Method m)
Returns all annotations of a class, also the annotations of the super
classes, implemented interfaces and the annotations that are present in
stereotype annotations.
|
public static Set<Annotation> getAllAnnotations(Class<?> clazz)
Note that the set can contain annotation objects of the same type with different values for their members.
clazz - the class from which to get the annotationspublic static Set<Annotation> getAllAnnotations(Method m)
m - the class from which to get the annotationspublic static <T extends Annotation> T findAnnotation(Method m, Class<?> clazz, Class<T> annotationClazz)
findAnnotation(java.lang.reflect.Method, java.lang.Class). If
the annotation can not be found, the method
findAnnotation(java.lang.Class, java.lang.Class) is used to find
the annotation on class level.T - The annotation typem - The method in which to look for the annotationclazz - The class in which to look for the annotation if it can not be
found on method levelannotationClazz - The type of the annotation to look forpublic static <T extends Annotation> T findAnnotation(Method m, Class<T> annotationClazz)
T - The annotation typem - The method in which to look for the annotationannotationClazz - The type of the annotation to look forpublic static <T extends Annotation> T findAnnotation(Class<?> clazz, Class<T> annotationClazz)
T - The annotation typeclazz - The class in which to look for the annotationannotationClazz - The type of the annotation to look forCopyright © 2020 Blazebit. All rights reserved.