IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
 
[Sommaire]  [Top 50]  [F.A.Q.]  [ Java SE ]  [ Java EE ]  [Javadoc standard]  [Contact]
[ 1.4.2 ]  [ 5.0 ]  [ 6.0
Rechercher   
Dans
Options   sensible à la casse
étendre la recherche aux descriptions
Préférences
fr en 
 
Moteurs de recherche
JavaTM 2 Platform Std. Ed. v1.6.0

javax.lang.model.element
Interface TypeElement

All Superinterfaces:
Element

public interface TypeElement
extends Element

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.

Since:
1.6
See Also:
DeclaredType

Method Summary
 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, getEnclosedElements, getEnclosingElement, getKind, getModifiers, getSimpleName, hashCode
 

Method Detail

getNestingKind

NestingKind getNestingKind()
Returns the nesting kind of this type element.

Returns:
the nesting kind of this type element

getQualifiedName

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.

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".

Returns:
the fully qualified name of this class or interface, or an empty name if none
See Also:
Elements.getBinaryName(javax.lang.model.element.TypeElement)
See The Java Language Specification, Third Edition:
6.7 Fully Qualified Names and Canonical Names

getSuperclass

TypeMirror getSuperclass()
Returns the direct superclass of this type element. If this type element represents an interface or the class java.lang.Object, then a NoType with kind NONE is returned.

Returns:
the direct superclass, or a NoType if there is none

getInterfaces

List<? extends TypeMirror> getInterfaces()
Returns the interface types directly implemented by this class or extended by this interface.

Returns:
the interface types directly implemented by this class or extended by this interface, or an empty list if there are none

getTypeParameters

List<? extends TypeParameterElement> getTypeParameters()
Returns the formal type parameters of this type element in declaration order.

Returns:
the formal type parameters, or an empty list if there are none

Copyright 2003 Sun Microsystems, Inc. All rights reserved