1 *java.lang.reflect.AnnotatedElement* *AnnotatedElement* Represents an annotated
3 public interface interface AnnotatedElement
6 |java.lang.reflect.AnnotatedElement_Description|
7 |java.lang.reflect.AnnotatedElement_Fields|
8 |java.lang.reflect.AnnotatedElement_Constructors|
9 |java.lang.reflect.AnnotatedElement_Methods|
11 ================================================================================
13 *java.lang.reflect.AnnotatedElement_Methods*
14 |java.lang.reflect.AnnotatedElement.getAnnotation(Class)|Returns this element's
15 |java.lang.reflect.AnnotatedElement.getAnnotations()|Returns all annotations pr
16 |java.lang.reflect.AnnotatedElement.getDeclaredAnnotations()|Returns all annota
17 |java.lang.reflect.AnnotatedElement.isAnnotationPresent(Class)|Returns true if
19 *java.lang.reflect.AnnotatedElement_Description*
21 Represents an annotated element of the program currently running in this VM.
22 This interface allows annotations to be read reflectively. All annotations
23 returned by methods in this interface are immutable and serializable. It is
24 permissible for the caller to modify the arrays returned by accessors for
25 array-valued enum members; it will have no affect on the arrays returned to
28 If an annotation returned by a method in this interface contains (directly or
29 indirectly) a (|java.lang.Class|) -valued member referring to a class that is
30 not accessible in this VM, attempting to read the class by calling the relevant
31 Class-returning method on the returned annotation will result in a
32 (|java.lang.TypeNotPresentException|) .
34 Similarly, attempting to read an enum-valued member will result in a
35 (|java.lang.EnumConstantNotPresentException|) if the enum constant in the
36 annotation is no longer present in the enum type.
38 Finally, Attempting to read a member whose definition has evolved incompatibly
39 will result in a (|java.lang.annotation.AnnotationTypeMismatchException|) or an
40 (|java.lang.annotation.IncompleteAnnotationException|) .
43 *java.lang.reflect.AnnotatedElement.getAnnotation(Class)*
45 public |java.lang.annotation.Annotation| getAnnotation(java.lang.Class annotationType)
47 Returns this element's annotation for the specified type if such an annotation
48 is present, else null.
50 annotationType - the Class object corresponding to the annotation type
52 Returns: this element's annotation for the specified annotation type if present on this
54 *java.lang.reflect.AnnotatedElement.getAnnotations()*
56 public |java.lang.annotation.Annotation| getAnnotations()
58 Returns all annotations present on this element. (Returns an array of length
59 zero if this element has no annotations.) The caller of this method is free to
60 modify the returned array; it will have no effect on the arrays returned to
64 Returns: all annotations present on this element
65 *java.lang.reflect.AnnotatedElement.getDeclaredAnnotations()*
67 public |java.lang.annotation.Annotation| getDeclaredAnnotations()
69 Returns all annotations that are directly present on this element. Unlike the
70 other methods in this interface, this method ignores inherited annotations.
71 (Returns an array of length zero if no annotations are directly present on this
72 element.) The caller of this method is free to modify the returned array; it
73 will have no effect on the arrays returned to other callers.
76 Returns: All annotations directly present on this element
77 *java.lang.reflect.AnnotatedElement.isAnnotationPresent(Class)*
79 public boolean isAnnotationPresent(java.lang.Class annotationType)
81 Returns true if an annotation for the specified type is present on this
82 element, else false. This method is designed primarily for convenient access to
85 annotationType - the Class object corresponding to the annotation type
87 Returns: true if an annotation for the specified annotation type is present on this