Represents a Java program element that can be annotated.
java.lang.reflect.AnnotatedElement
| Modifier and Type | Method and Description |
|---|---|
| public < the type of the annotation T extends Annotation> T | Returns: the first program element annotation of the given annotation type, or a null valuethe class of the annotation type annotationType)Get program element annotation of a certain annotation type. |
| public < the type of the annotation T extends Annotation> Set | Returns: the program element annotations of the given annotation type, or an empty collectionthe class of the annotation type annotationType)Get program element annotations of a certain annotation type. |
| public Set | Returns: all annotations of the program element, or an empty set if no annotations are presentGet all annotations of the program element. |
| public Type | Returns: the type of the annotated program elementGet the type of the annotated program element. |
| public Set | Returns: a set of all types to which the base type should be considered assignableGet all types to which the base type should be considered assignable. |
| public boolean | Returns: true if the program element has an annotation of the given annotation type, or false otherwisethe annotation type to check for annotationType)Determine if the program element has an annotation of a certain annotation type. |
| getAnnotation | back to summary |
|---|---|
| public <T extends Annotation> T getAnnotation(Class<T> annotationType)
Get program element annotation of a certain annotation type.
The behavior of this method is intended to be the same behavior as
| |
| getAnnotations | back to summary |
|---|---|
| public <T extends Annotation> Set Get program element annotations of a certain annotation type.
This method returns back all annotations, including repeatable annotations of this type.
The behavior of this method is intended to be the same behavior as | |
| getAnnotations | back to summary |
|---|---|
| public Set Get all annotations of the program element.
| |
| getBaseType | back to summary |
|---|---|
| public Type getBaseType() Get the type of the annotated program element.
| |
| getTypeClosure | back to summary |
|---|---|
| public Set Get all types to which the base type should be considered assignable. | |
| isAnnotationPresent | back to summary |
|---|---|
| public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
Determine if the program element has an annotation of a certain annotation type.
The behavior of this method is similar to
| |