Spec-Zone .ru
спецификации, руководства, описания, API
|
|
Java™ Platform Standard Ed. 7 DRAFT ea-b118 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TypeElement extends Element, Parameterizable, QualifiedNameable
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.
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 Element> |
getEnclosedElements()
Returns the elements that are, loosely speaking, directly enclosed by this element. |
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. |
Methods inherited from interface javax.lang.model.element.Element |
---|
accept, asType, equals, getAnnotation, getAnnotationMirrors, getEnclosingElement, getKind, getModifiers, getSimpleName, hashCode |
Method Detail |
---|
List<? extends Element> getEnclosedElements()
values
and valueOf
methods of an
enum type.
A package encloses the top-level classes and interfaces within
it, but is not considered to enclose subpackages.
Other kinds of elements are not currently considered to enclose
any elements; however, that may change as this API or the
programming language evolves.
Note that elements of certain kinds can be isolated using
methods in ElementFilter
.
Note that 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 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.)
getEnclosedElements
in interface Element
Elements.getAllMembers(javax.lang.model.element.TypeElement)
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
".
getQualifiedName
in interface QualifiedNameable
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()
getTypeParameters
in interface Parameterizable
|
Java™ Platform Standard Ed. 7 DRAFT ea-b118 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1993, 2010, Oracle Corporation. All rights reserved.