This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.lang.model.element
interface TypeElement

All Superinterfaces:
Element

Most common ways to construct:

Element sym = …;

TypeElement owner = (TypeElement)sym.getEnclosingElement();

Based on 6 examples

 

ExecutableElement e = …;

TypeElement owner = (TypeElement)e.getEnclosingElement();

Based on 6 examples


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 {@code TypeElement} represents a class or interface element, a {@link 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} and {@code java.util.Set} (and many others), and to the raw type {@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.


Method Summary
 List

          Returns the interface types directly implemented by this class or extended by this interface.
 NestingKind

          Returns the nesting kind of this type element.
 Name

          Returns the fully qualified name of this type element.
 TypeMirror

          Returns the direct superclass of this type element.
 List

          Returns the formal type parameters of this type element in declaration order.
 
Methods inherited from class javax.lang.model.element.Element
accept, asType, equals, getAnnotation, getAnnotationMirrors, getEnclosedElements, getEnclosingElement, getKind, getModifiers, getSimpleName, hashCode
 

Method Detail

getInterfaces

public List 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

getNestingKind

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

Returns:
the nesting kind of this type element

getQualifiedName

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.

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.Set} is "{@code java.util.Set}". Nested types use "{@code .}" as a separator, as in "{@code java.util.Map.Entry}".

Returns:
the fully qualified name of this class or interface, or an empty name if none

getSuperclass

public TypeMirror getSuperclass()
Returns the direct superclass of this type element. If this type element represents an interface or the class {@code java.lang.Object}, then a {@link NoType} with kind {@link TypeKind#NONE NONE} is returned.

Returns:
the direct superclass, or a {@code NoType} if there is none

getTypeParameters

public List 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


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.