javax.lang.model.element
public interface TypeElement extends Element
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.
DeclaredType
Modifier and Type | Method and Description |
---|---|
List<? extends TypeMirror> |
getInterfaces()
Returns the interface types directly implemented by this class
or extended by this interface.
|
NestingKind |
getNestingKind()
Returns the nesting kind of this type element.
|
Name |
getQualifiedName()
Returns the fully qualified name of this type element.
|
TypeMirror |
getSuperclass()
Returns the direct superclass of this type element.
|
List<? extends TypeParameterElement> |
getTypeParameters()
Returns the formal type parameters of this type element
in declaration order.
|
accept, asType, equals, getAnnotation, getAnnotationMirrors, getEnclosedElements, getEnclosingElement, getKind, getModifiers, getSimpleName, hashCode
NestingKind getNestingKind()
Name getQualifiedName()
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
java.util.Set<E>
is "java.util.Set
".
Nested types use ".
" as a separator, as in
"java.util.Map.Entry
".
Elements.getBinaryName(javax.lang.model.element.TypeElement)
TypeMirror getSuperclass()
java.lang.Object
, then a NoType
with kind NONE
is returned.NoType
if there is noneList<? extends TypeMirror> getInterfaces()
List<? extends TypeParameterElement> getTypeParameters()
Submit a bug or feature Copyright © 1993, 2017, Oracle and/or its affiliates. All rights reserved.
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.