public interface AnnotatedElement
Modifier and Type | Method and Description |
---|---|
<T extends Annotation> |
getAnnotation(Class<T> annotationType)
Returns, for this element, the annotation with the specified type, or
null if no annotation with the specified type is present
(including inherited annotations). |
Annotation[] |
getAnnotations()
Returns, for this element, an array containing all annotations (including
inherited annotations).
|
Annotation[] |
getDeclaredAnnotations()
Returns, for this element, all annotations that are explicitly declared
(not inherited).
|
boolean |
isAnnotationPresent(Class<? extends Annotation> annotationType)
Indicates whether or not this element has an annotation with the
specified annotation type (including inherited annotations).
|
<T extends Annotation> T getAnnotation(Class<T> annotationType)
null
if no annotation with the specified type is present
(including inherited annotations).annotationType
- the type of the annotation to search fornull
NullPointerException
- if annotationType
is null
Annotation[] getAnnotations()
Annotation[] getDeclaredAnnotations()
boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
annotationType
- the type of the annotation to search fortrue
if the annotation exists, false
otherwiseNullPointerException
- if annotationType
is null