22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package javax.lang.model;
27
28 import java.lang.annotation.*;
29 import java.util.List;
30 import javax.lang.model.element.*;
31 import javax.lang.model.type.*;
32
33 /**
34 * Represents a construct that can be annotated.
35 *
36 * A construct is either an {@linkplain
37 * javax.lang.model.element.Element element} or a {@linkplain
38 * javax.lang.model.type.TypeMirror type}. Annotations on an element
39 * are on a <em>declaration</em>, whereas annotations on a type are on
40 * a specific <em>use</em> of a type name.
41 *
42 * As defined by <cite>The Java™ Language Specification</cite>
43 * section {@jls 9.7.4}, an annotation on an element is a
44 * <em>declaration annotation</em> and an annotation on a type is a
45 * <em>type annotation</em>.
46 *
47 * The terms <em>directly present</em>, <em>present</em>,
48 * <em>indirectly present</em>, and <em>associated </em> are used
49 * throughout this interface to describe precisely which annotations,
50 * either declaration annotations or type annotations, are returned by
51 * the methods in this interface.
52 *
53 * <p>In the definitions below, an annotation <i>A</i> has an
54 * annotation type <i>AT</i>. If <i>AT</i> is a repeatable annotation
55 * type, the type of the containing annotation is <i>ATC</i>.
56 *
57 * <p>Annotation <i>A</i> is <em>directly present</em> on a construct
58 * <i>C</i> if either:
59 *
60 * <ul>
61 *
62 * <li><i>A</i> is {@linkplain
63 * javax.lang.model.util.Elements#getOrigin(AnnotatedConstruct,
64 * AnnotationMirror) explicitly or implicitly}
65 * declared as applying to
66 * the source code representation of <i>C</i>.
67 *
68 * <p>Typically, if exactly one annotation of type <i>AT</i> appears in
69 * the source code of representation of <i>C</i>, then <i>A</i> is
70 * explicitly declared as applying to <i>C</i>.
71 *
72 * An annotation of type <i>AT</i> on a {@linkplain
73 * RecordComponentElement record component} can be implicitly propagated
74 * down to affiliated mandated members. Type annotations modifying the
75 * type of a record component can be also propagated to mandated
76 * members. Propagation of the annotations to mandated members is
77 * governed by rules given in the <cite>The Java™ Language
78 * Specification</cite>.
79 *
80 * If there are multiple annotations of type <i>AT</i> present on
81 * <i>C</i>, then if <i>AT</i> is repeatable annotation type, an
82 * annotation of type <i>ATC</i> is {@linkplain javax.lang.model.util.Elements#getOrigin(AnnotatedConstruct, AnnotationMirror) implicitly declared} on <i>C</i>.
83 * <li> A representation of <i>A</i> appears in the executable output
84 * for <i>C</i>, such as the {@code RuntimeVisibleAnnotations} (JVMS {@jvms 4.7.16}) or
85 * {@code RuntimeVisibleParameterAnnotations} (JVMS {@jvms 4.7.17}) attributes of a class
86 * file.
87 *
88 * </ul>
89 *
90 * <p>An annotation <i>A</i> is <em>present</em> on a
91 * construct <i>C</i> if either:
92 * <ul>
93 *
94 * <li><i>A</i> is directly present on <i>C</i>.
95 *
96 * <li>No annotation of type <i>AT</i> is directly present on
97 * <i>C</i>, and <i>C</i> is a class and <i>AT</i> is inheritable
|
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package javax.lang.model;
27
28 import java.lang.annotation.*;
29 import java.util.List;
30 import javax.lang.model.element.*;
31 import javax.lang.model.type.*;
32
33 /**
34 * Represents a construct that can be annotated.
35 *
36 * A construct is either an {@linkplain
37 * javax.lang.model.element.Element element} or a {@linkplain
38 * javax.lang.model.type.TypeMirror type}. Annotations on an element
39 * are on a <em>declaration</em>, whereas annotations on a type are on
40 * a specific <em>use</em> of a type name.
41 *
42 * As defined by <cite>The Java Language Specification</cite>
43 * section {@jls 9.7.4}, an annotation on an element is a
44 * <em>declaration annotation</em> and an annotation on a type is a
45 * <em>type annotation</em>.
46 *
47 * The terms <em>directly present</em>, <em>present</em>,
48 * <em>indirectly present</em>, and <em>associated </em> are used
49 * throughout this interface to describe precisely which annotations,
50 * either declaration annotations or type annotations, are returned by
51 * the methods in this interface.
52 *
53 * <p>In the definitions below, an annotation <i>A</i> has an
54 * annotation type <i>AT</i>. If <i>AT</i> is a repeatable annotation
55 * type, the type of the containing annotation is <i>ATC</i>.
56 *
57 * <p>Annotation <i>A</i> is <em>directly present</em> on a construct
58 * <i>C</i> if either:
59 *
60 * <ul>
61 *
62 * <li><i>A</i> is {@linkplain
63 * javax.lang.model.util.Elements#getOrigin(AnnotatedConstruct,
64 * AnnotationMirror) explicitly or implicitly}
65 * declared as applying to
66 * the source code representation of <i>C</i>.
67 *
68 * <p>Typically, if exactly one annotation of type <i>AT</i> appears in
69 * the source code of representation of <i>C</i>, then <i>A</i> is
70 * explicitly declared as applying to <i>C</i>.
71 *
72 * An annotation of type <i>AT</i> on a {@linkplain
73 * RecordComponentElement record component} can be implicitly propagated
74 * down to affiliated mandated members. Type annotations modifying the
75 * type of a record component can be also propagated to mandated
76 * members. Propagation of the annotations to mandated members is
77 * governed by rules given in the <cite>The Java Language
78 * Specification</cite>.
79 *
80 * If there are multiple annotations of type <i>AT</i> present on
81 * <i>C</i>, then if <i>AT</i> is repeatable annotation type, an
82 * annotation of type <i>ATC</i> is {@linkplain javax.lang.model.util.Elements#getOrigin(AnnotatedConstruct, AnnotationMirror) implicitly declared} on <i>C</i>.
83 * <li> A representation of <i>A</i> appears in the executable output
84 * for <i>C</i>, such as the {@code RuntimeVisibleAnnotations} (JVMS {@jvms 4.7.16}) or
85 * {@code RuntimeVisibleParameterAnnotations} (JVMS {@jvms 4.7.17}) attributes of a class
86 * file.
87 *
88 * </ul>
89 *
90 * <p>An annotation <i>A</i> is <em>present</em> on a
91 * construct <i>C</i> if either:
92 * <ul>
93 *
94 * <li><i>A</i> is directly present on <i>C</i>.
95 *
96 * <li>No annotation of type <i>AT</i> is directly present on
97 * <i>C</i>, and <i>C</i> is a class and <i>AT</i> is inheritable
|