public class AnnotationFinder extends Object
| Constructor and Description |
|---|
AnnotationFinder() |
| Modifier and Type | Method and Description |
|---|---|
static <A extends Annotation> |
findAnnotation(AnnotatedElement annotatedElement,
Class<A> annotationType)
Retrieve an annotation of the specified
annotationType that is present on the given
annotatedElement, including considering nested annotations and method inheritance. |
public static <A extends Annotation> A findAnnotation(AnnotatedElement annotatedElement, Class<A> annotationType)
annotationType that is present on the given
annotatedElement, including considering nested annotations and method inheritance.
If the annotation isn't found, this method returns null.A - denotes the annotation type.annotatedElement - the element (e.g., class, method, field) to inspect for annotations.annotationType - the desired annotation's type.A or null if not present.Copyright © 2023. All rights reserved.