All Implemented Interfaces:
QualifiedNameable, Parameterizable, Element
While a {@code 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
{@code java.util.Set} corresponds to the parameterized types
{@code 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. Note that as a particular instance of the {@linkplain
javax.lang.model.element 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 type. For example,
if the information about the type is originating from a source
file, the elements will be returned in source code order.
(However, in that case the the ordering of synthesized
elements, such as a default constructor, is not specified.) The name of a generic type does not include any reference
to its formal type parameters.
For example, the fully qualified name of the interface
{@code java.util.SetAlso see:
Joseph
- D. DarcyScott
- SeligmanPeter
- von der Ahé1.6
- Method from javax.lang.model.element.TypeElement Summary:
getEnclosedElements, getEnclosingElement, getInterfaces, getNestingKind, getQualifiedName, getSimpleName, getSuperclass, getTypeParameters Method from javax.lang.model.element.TypeElement Detail: public List<Element> getEnclosedElements()
{@inheritDoc}
public Element getEnclosingElement()
Returns the package of a top-level type and returns the
immediately lexically enclosing element for a {@linkplain
NestingKind#isNested nested} type.
public List<TypeMirror> getInterfaces()
Returns the interface types directly implemented by this class
or extended by this interface.
public NestingKind getNestingKind()
Returns the nesting kind of this type element.
public Name getQualifiedName()
Returns the fully qualified name of this type element.
More precisely, it returns the canonical name.
For local and anonymous classes, which do not have canonical names,
an empty name is returned.
public Name getSimpleName()
Returns the simple name of this type element.
For an anonymous class, an empty name is returned.
public TypeMirror getSuperclass()
public List<TypeParameterElement> getTypeParameters()
Returns the formal type parameters of this type element
in declaration order.