public final class AnnotationUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.util.Optional<java.lang.reflect.Field> |
getAnnotatedField(java.lang.Class annotation,
java.lang.Class clazz)
Method getAnnotatedField gets the first annotated field of the type of annotation specified.
|
static java.util.List<java.lang.reflect.Field> |
getAnnotatedFields(java.lang.Class annotation,
java.lang.Class clazz)
Method getAnnotatedFields gets the fields annotated of a specific type from the class and its parent classes.
|
static java.util.Optional<java.lang.reflect.Method> |
getAnnotatedMethod(java.lang.Class annotation,
java.lang.Class clazz)
Method getAnnotatedMethod the first annotated method of the type of annotation specified.
|
static java.util.List<java.lang.reflect.Method> |
getAnnotatedMethods(java.lang.Class annotation,
java.lang.Class clazz)
Method getAnnotatedMethods gets the methods annotated of a specific type from the class and its parent
classes.
The List is in order of closest parent => current obj methods, parent obj methods, etc. |
static <A extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<A> annotation,
java.lang.Class<?> clazz)
Method getAnnotation returns the annotation on a class or its parent annotation.
|
public static java.util.List<java.lang.reflect.Field> getAnnotatedFields(java.lang.Class annotation, java.lang.Class clazz)
annotation
- the annotation typeclazz
- the class that is expected to be annotatedSet
of Field
objects annotated with the annotatedClasspublic static java.util.Optional<java.lang.reflect.Field> getAnnotatedField(java.lang.Class annotation, java.lang.Class clazz)
annotation
- the type of the annotationclazz
- the annotated classpublic static java.util.List<java.lang.reflect.Method> getAnnotatedMethods(java.lang.Class annotation, java.lang.Class clazz)
annotation
- the type of the annotationclazz
- the annotated classpublic static java.util.Optional<java.lang.reflect.Method> getAnnotatedMethod(java.lang.Class annotation, java.lang.Class clazz)
annotation
- the type of the annotationclazz
- the annotated classpublic static <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A> annotation, java.lang.Class<?> clazz)
A
- the type of the annotationclazz
- the annotated classannotation
- the annotation to find