java.lang.reflect
public
interface
java.lang.reflect.AnnotatedElement
| java.lang.reflect.AnnotatedElement |
|
An interface implemented an annotated element to enable reflective access to
annotation information.
Known Indirect Subclasses
| AccessibleObject |
This class must be implemented by the VM vendor. |
| Class |
This class must be implemented by the VM vendor. |
| Constructor |
This class models a constructor. |
| Field |
This class must be implemented by the VM vendor. |
| Method |
This class models a method. |
| Package |
This class must be implemented by the vm vendor. |
Summary
Details
Public Methods
public
T
getAnnotation(Class annotationType)
Gets the
Annotation for this element for the annotation type
passed, if it exists.
Parameters
| annotationType
| The Class instance of the annotation to search for. |
Gets all
Annotations for this element.
Returns
- An array of Annotations, which may be empty, but never
null.
public
Annotation[]
getDeclaredAnnotations()
Gets all
Annotations that are explicitly declared by this
element (not inherited).
Returns
- An array of Annotations, which may be empty, but never
null.
public
boolean
isAnnotationPresent(Class annotationType)
Determines if this element has an annotation for the annotation type
passed.
Parameters
| annotationType
| The class instance of the annotation to search for. |
Returns
true if the annotation exists, otherwise
false.