AnnotatedElementContext encapsulates the context in which an
AnnotatedElement is declared.
For example, an AnnotatedElementContext is used in
TempDirFactory to allow inspecting
the field or parameter the TempDir
annotation is declared on.
This interface is not intended to be implemented by clients.
| Modifier and Type | Method and Description |
|---|---|
| public default < the annotation type A extends Annotation> Optional | Returns: anOptional containing the annotation; never null but
potentially emptythe annotation type to search for; never annotationType)nullFind the first annotation of |
| public default < the annotation type A extends Annotation> List | Returns: the list of all such annotations found; neithernull nor
mutable, but potentially emptythe repeatable annotation type to search for; never
annotationType)nullFind all repeatable annotations of
|
| public AnnotatedElement | Returns: the annotated element; nevernullGet the |
| public default boolean | Returns: true if the annotation is present or meta-presentthe annotation type to search for; never annotationType)nullDetermine if an annotation of |
| findAnnotation | back to summary |
|---|---|
| public default <A extends Annotation> Optional Find the first annotation of WARNINGFavor the use of this method over directly invoking annotation lookup
methods in the
| |
| findRepeatableAnnotations | back to summary |
|---|---|
| public default <A extends Annotation> List Find all repeatable annotations of
WARNINGFavor the use of this method over directly invoking annotation lookup
methods in the
| |
| getAnnotatedElement | back to summary |
|---|---|
| public AnnotatedElement getAnnotatedElement() Get the WARNINGWhen searching for annotations on the annotated element in this context,
favor
| |
| isAnnotated | back to summary |
|---|---|
| public default boolean isAnnotated(Class<? extends Annotation> annotationType) Determine if an annotation of Note This method does not find repeatable annotations.
To check for repeatable annotations, use WARNINGFavor the use of this method over directly invoking
| |