public interface HasAnnotations
TypeOracle
model and one that is more useful to developers.Modifier and Type | Method and Description |
---|---|
<T extends Annotation> |
getAnnotation(Class<T> annotationClass)
Returns an instance of the specified annotation type if it is present on
this element or
null if it is not. |
Annotation[] |
getAnnotations()
Returns all the annotations present on this element.
|
Annotation[] |
getDeclaredAnnotations()
Returns the annotations declared directly on this element; does not include
any inherited annotations.
|
boolean |
isAnnotationPresent(Class<? extends Annotation> annotationClass)
Returns
true if this item has an annotation of the specified
type. |
<T extends Annotation> T getAnnotation(Class<T> annotationClass)
null
if it is not. For a class, this will
look for annotations on supertypes as well.annotationClass
- annotation type to search fornull
if it is notAnnotation[] getAnnotations()
Annotation[] getDeclaredAnnotations()
boolean isAnnotationPresent(Class<? extends Annotation> annotationClass)
true
if this item has an annotation of the specified
type. For a class, this will look at supertypes as well.true
if this item has an annotation of the specified
typeCopyright © 2018. All rights reserved.