public class AnnotationUtils extends Object
Constructor and Description |
---|
AnnotationUtils() |
Modifier and Type | Method and Description |
---|---|
static <A extends Annotation> |
getIndirectlyPresentAnnotations(A maybeContainerAnnotation)
If the return type of an existing
value() method of the passed annotation is an Annotation[] array and the annotations inside that Annotation[] array are annotated
with the Repeatable annotation the annotations of that array will be returned. |
static <A extends Annotation> |
unwrapContainerAnnotations(A[] annotations)
Returns a new array whose entries do not contain container annotations anymore but the
indirectly present annotation(s) a container annotation was wrapping instead.
|
public static <A extends Annotation> Annotation[] unwrapContainerAnnotations(A[] annotations)
Repeatable
. Annotations inside the given array which don't meet the above definition of
a container annotations will be returned untouched.annotations
- An array of annotations to unwrap. Can contain both container and non
container annotations.public static <A extends Annotation> List<Annotation> getIndirectlyPresentAnnotations(A maybeContainerAnnotation)
value()
method of the passed annotation is an Annotation[]
array and the annotations inside that Annotation[]
array are annotated
with the Repeatable
annotation the annotations of that array will be returned. If the
passed annotation does not have a value()
method or the above criteria are not met an
empty list will be returned instead.maybeContainerAnnotation
- The annotation which value()
method will be checked for
other annotationsvalue()
method or an empty list.