43 * The distinction is most apparent with generic types,
44 * for which a single element can define a whole
45 * family of types. For example, the element
46 * {@code java.util.Set} corresponds to the parameterized types
47 * {@code java.util.Set<String>} and {@code java.util.Set<Number>}
48 * (and many others), and to the raw type {@code java.util.Set}.
49 *
50 * <p> Each method of this interface that returns a list of elements
51 * will return them in the order that is natural for the underlying
52 * source of program information. For example, if the underlying
53 * source of information is Java source code, then the elements will be
54 * returned in source code order.
55 *
56 * @author Joseph D. Darcy
57 * @author Scott Seligman
58 * @author Peter von der Ahé
59 * @see DeclaredType
60 * @since 1.6
61 */
62 public interface TypeElement extends Element, Parameterizable, QualifiedNameable {
63
64 /**
65 * Returns the <i>nesting kind</i> of this type element.
66 *
67 * @return the nesting kind of this type element
68 */
69 NestingKind getNestingKind();
70
71 /**
72 * Returns the fully qualified name of this type element.
73 * More precisely, it returns the <i>canonical</i> name.
74 * For local and anonymous classes, which do not have canonical names,
75 * an empty name is returned.
76 *
77 * <p>The name of a generic type does not include any reference
78 * to its formal type parameters.
79 * For example, the fully qualified name of the interface
80 * {@code java.util.Set<E>} is "{@code java.util.Set}".
81 * Nested types use "{@code .}" as a separator, as in
82 * "{@code java.util.Map.Entry}".
|
43 * The distinction is most apparent with generic types,
44 * for which a single element can define a whole
45 * family of types. For example, the element
46 * {@code java.util.Set} corresponds to the parameterized types
47 * {@code java.util.Set<String>} and {@code java.util.Set<Number>}
48 * (and many others), and to the raw type {@code java.util.Set}.
49 *
50 * <p> Each method of this interface that returns a list of elements
51 * will return them in the order that is natural for the underlying
52 * source of program information. For example, if the underlying
53 * source of information is Java source code, then the elements will be
54 * returned in source code order.
55 *
56 * @author Joseph D. Darcy
57 * @author Scott Seligman
58 * @author Peter von der Ahé
59 * @see DeclaredType
60 * @since 1.6
61 */
62 public interface TypeElement extends Element, Parameterizable, QualifiedNameable {
63 /**
64 * {@inheritDoc}
65 *
66 * <p> Note that as a particular instance of the {@linkplain
67 * javax.lang.model.element general accuracy requirements} and the
68 * ordering behavior required of this interface, the list of
69 * enclosed elements will be returned in the natural order for the
70 * originating source of information about the type. For example,
71 * if the information about the type is originating from a source
72 * file, the elements will be returned in source code order.
73 * (However, in that case the the ordering of synthesized
74 * elements, such as a default constructor, is not specified.)
75 *
76 * @return the enclosed elements in proper order, or an empty list if none
77 */
78 List<? extends Element> getEnclosedElements();
79
80 /**
81 * Returns the <i>nesting kind</i> of this type element.
82 *
83 * @return the nesting kind of this type element
84 */
85 NestingKind getNestingKind();
86
87 /**
88 * Returns the fully qualified name of this type element.
89 * More precisely, it returns the <i>canonical</i> name.
90 * For local and anonymous classes, which do not have canonical names,
91 * an empty name is returned.
92 *
93 * <p>The name of a generic type does not include any reference
94 * to its formal type parameters.
95 * For example, the fully qualified name of the interface
96 * {@code java.util.Set<E>} is "{@code java.util.Set}".
97 * Nested types use "{@code .}" as a separator, as in
98 * "{@code java.util.Map.Entry}".
|