< prev index next >

src/java.compiler/share/classes/javax/lang/model/element/TypeElement.java

Print this page

        

*** 30,40 **** import javax.lang.model.util.*; /** * Represents a class or interface program element. Provides access * to information about the type and its members. Note that an enum ! * type is a kind of class and an annotation type is a kind of * interface. * * <p> While a {@code TypeElement} represents a class or interface * <i>element</i>, a {@link DeclaredType} represents a class * or interface <i>type</i>, the latter being a use --- 30,40 ---- import javax.lang.model.util.*; /** * Represents a class or interface program element. Provides access * to information about the type and its members. Note that an enum ! * type and a record type are kinds of class esand an annotation type is a kind of * interface. * * <p> While a {@code TypeElement} represents a class or interface * <i>element</i>, a {@link DeclaredType} represents a class * or interface <i>type</i>, the latter being a use
*** 80,90 **** */ @Override TypeMirror asType(); /** ! * Returns the fields, methods, constructors, and member types * that are directly declared in this class or interface. * * This includes any {@linkplain Elements.Origin#MANDATED * mandated} elements such as the (implicit) default constructor * and the implicit {@code values} and {@code valueOf} methods of --- 80,90 ---- */ @Override TypeMirror asType(); /** ! * Returns the fields, methods, constructors, state components, and member types * that are directly declared in this class or interface. * * This includes any {@linkplain Elements.Origin#MANDATED * mandated} elements such as the (implicit) default constructor * and the implicit {@code values} and {@code valueOf} methods of
*** 176,185 **** --- 176,217 ---- * if there are none */ List<? extends TypeParameterElement> getTypeParameters(); /** + * Returns the state components of this type element in + * declaration order. + * + * @implSpec The default implementations of this method returns an + * empty and unmodifiable list. + * + * @return the state components, or an empty list if there are + * none + * + * @since amber + */ + default List<? extends VariableElement> getStateComponents() { + return List.of(); + } + + /** + * Returns the permitted subtypes of this type element in + * declaration order. + * + * @implSpec The default implementations of this method returns an + * empty and unmodifiable list. + * + * @return the permitted subtypes, or an empty list + * if there are none + * + * @since amber + */ + default List<? extends TypeMirror> getPermittedSubtypes() { + return List.of(); + } + + /** * Returns the package of a top-level type and returns the * immediately lexically enclosing element for a {@linkplain * NestingKind#isNested nested} type. * * @return the package of a top-level type, the immediately
< prev index next >