Methods
- ✗public abstract javax.lang.model.type.TypeMirror asType()Comparing jdk-21-ga and jdk-22+36
asType
TypeMirror asType()Returns the type defined by this class or interface element, returning the Italics style removed.!diff-dfn! added.Moved to a span with id prototypicaltype and class search-tag-result.prototypical !diff-dfn! added.Moved to a span with id prototypicaltype and class search-tag-result.type !diff-dfn! added.Moved to a span with id prototypicaltype and class search-tag-result. for an element representing a generic type.A generic element defines a family of types, not just one. If this is a generic element, a prototypical type is returned which has the element's invocation on the type variables corresponding to its own formal type parameters. For example, for the generic class element
C<N extends Number>, the parameterized typeC<N>is returned. Otherwise, for a non-generic class or interface, the prototypical type mirror corresponds to a use of the type. None of the components of the prototypical type are annotated, including the prototypical type itself.- Specified by:
asTypein interfaceElement- API Note:
- Moved out of a division with class block.Moved out of a paragraph.Moved to a definition list with class notes.Moved to a definition.The
Moved out of a division with class block.Moved out of a paragraph.Moved to a definition list with class notes.Moved to a definition.TypesMoved out of a division with class block.Moved out of a paragraph.Moved to a definition list with class notes.Moved to a definition. utility interface has more general methods for obtaining the full range of types defined by an element.
- ✗public abstract java.util.List<? extends javax.lang.model.element.Element> getEnclosedElements()Comparing jdk-21-ga and jdk-22+36
getEnclosedElements
Returns the fields, methods, constructors, record components, and member classes and interfaces that are directly declared in this class or interface. This includes any mandated elements such as the (implicit) default constructor and the implicitvaluesandvalueOfmethods of an enum class.- Specified by:
getEnclosedElementsin interfaceElement- API Note:
- As a particular instance of the general accuracy requirements and the ordering behavior required of this interface, the list of enclosed elements will be returned in the natural order for the originating source of information about the class or interface. For example, if the information about the class or interface is originating from a source file, the elements will be returned in source code order. (However, in that case the ordering of implicitly declared elements, such as default constructors, is not specified.)
- Returns:
- the enclosed elements in proper order, or an empty list if none
- See Java Language Specification:
- Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-8.html#jls-8.8.9.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-8.html#jls-8.8.9. Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-8.html#jls-8.8.9.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-8.html#jls-8.8.9.8.8.9 Default Constructor
Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-8.html#jls-8.9.3.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-8.html#jls-8.9.3.8.9.3 Enum Members
Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-8.html#jls-8.10.3.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-8.html#jls-8.10.3.8.10.3 Record Members
- See Also:
- ✓public abstract javax.lang.model.element.Element getEnclosingElement()
- ✓public abstract java.util.List<? extends javax.lang.model.type.TypeMirror> getInterfaces()
- ✓public abstract javax.lang.model.element.NestingKind getNestingKind()
- ✗public default java.util.List<? extends javax.lang.model.type.TypeMirror> getPermittedSubclasses()Comparing jdk-21-ga and jdk-22+36
getPermittedSubclasses
Returns the permitted classes of this class or interface element in declaration order. Note that for an interface, permitted subclasses and subinterfaces can be returned.- Implementation Requirements:
- The default implementations of this method returns an empty and unmodifiable list.
- Returns:
- the permitted classes, or an empty list if there are none
- See Java Language Specification:
- 8.1.6 Permitted Direct Subclasses
9.1.4 Permitted Direct Subclasses and Subinterfaces
- Since:
- 17
- ✗public abstract javax.lang.model.element.Name getQualifiedName()Comparing jdk-21-ga and jdk-22+36
getQualifiedName
Name getQualifiedName()Returns the fully qualified name of this class or interface element. More precisely, it returns the canonical name. For local, and anonymous , and unnamedPREVIEW classes, which do not have canonical names, an empty name is returned.The name of a generic class or interface does not include any reference to its formal type parameters. For example, the fully qualified name of the interface
java.util.Set<E>is "java.util.Set". Nested classes and interfaces use "." as a separator, as in "java.util.Map.Entry".- Specified by:
getQualifiedNamein interfaceQualifiedNameable- Returns:
- the fully qualified name of this class or interface, or an empty name if none
- See Java Language Specification:
- Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-6.html#jls-6.7.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-6.html#jls-6.7. Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-6.html#jls-6.7.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-6.html#jls-6.7.6.7 Fully Qualified Names and Canonical Names
7.3 Compilation Units
- See Also:
- ✓public default java.util.List<? extends javax.lang.model.element.RecordComponentElement> getRecordComponents()
- ✗public abstract javax.lang.model.element.Name getSimpleName()Comparing jdk-21-ga and jdk-22+36
getSimpleName
Name getSimpleName()Returns the simple name of this class or interface element. For an anonymous class, an empty name is returned. For an unnamedPREVIEW class, a name matching the base name of the hosting file, minus any extension, is returned.- Specified by:
getSimpleNamein interfaceElement- Returns:
- the simple name of this class or interface, an empty name for an anonymous class
- See Also:
- ✓public abstract javax.lang.model.type.TypeMirror getSuperclass()
- ✓public abstract java.util.List<? extends javax.lang.model.element.TypeParameterElement> getTypeParameters()
- ①Only in: jdk-21-ga; not in: jdk-22+36.public default boolean isUnnamed()Only in jdk-21-ga; not i jdk-22+36
isUnnamed
default boolean isUnnamed()isUnnamedis a reflective preview API of the Java platform.Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.Returnstrueif this is an unnamed class andfalseotherwise.- Implementation Requirements:
- The default implementation of this method returns
false. - Returns:
trueif this is an unnamed class andfalseotherwise- See Java Language Specification:
-
7.3 Compilation Units
- Since:
- 21
Summary
| Elements | Comments | Descriptions | Total | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Added | Changed | Removed | Added | Changed | Removed | Added | Changed | Removed | ||
| asType() | 5 | 2 | 3 | 10 | ||||||
| getEnclosedElements() | 3 | 3 | ||||||||
| getPermittedSubclasses() | 5 | 5 | ||||||||
| getQualifiedName() | 1 | 1 | 5 | 7 | ||||||
| getSimpleName() | 3 | 3 | ||||||||
| isUnnamed() | 1 | 1 | 2 | |||||||
| Total | 1 | 11 | 6 | 12 | 30 | |||||