Interface TypeElement

All Superinterfaces:
AnnotatedConstruct, Element, Parameterizable, QualifiedNameable

public interface TypeElement extends Element, Parameterizable, QualifiedNameable
Represents a class or interface program element. Provides access to information about the class or interface and its members. Note that an enum class and a record class are specialized kinds of classes and an annotation interface is a specialized kind of interface.

While a TypeElement represents a class or interface element, a DeclaredType represents a class or interface type, the latter being a use (or invocation) of the former. The distinction is most apparent with generic types, for which a single element can define a whole family of types. For example, the element java.util.Set corresponds to the parameterized types java.util.Set<String> and java.util.Set<Number> (and many others), and to the raw type java.util.Set.

Each method of this interface that returns a list of elements will return them in the order that is natural for the underlying source of program information. For example, if the underlying source of information is Java source code, then the elements will be returned in source code order.

API Note:
The represented class or interface may have a reference representation (either source code or executable output). Multiple classes and interfaces can share the same reference representation backing construct. For example, multiple classes and interface can be declared in the same source file, including, but are not limited to:

In the context of annotation processing, a type element can be:

Since:
1.6
See Also: