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.type
interface DeclaredType

All Superinterfaces:
ReferenceType, TypeMirror
All Known Subinterfaces:
ErrorType

public interface DeclaredType
extends ReferenceType

Represents a declared type, either a class type or an interface type. This includes parameterized types such as {@code java.util.Set} as well as raw types.

While a {@code TypeElement} represents a class or interface element, a {@code DeclaredType} represents a class or interface type, the latter being a use (or invocation) of the former. See {@link TypeElement} for more on this distinction.

The supertypes (both class and interface types) of a declared type may be found using the {@link Types#directSupertypes(TypeMirror)} method. This returns the supertypes with any type arguments substituted in.

This interface is also used to represent intersection types. An intersection type is implicit in a program rather than being explictly declared. For example, the bound of the type parameter {@code } is an intersection type. It is represented by a {@code DeclaredType} with {@code Number} as its superclass and {@code Runnable} as its lone superinterface.


Method Summary
 Element

          Returns the element corresponding to this type.
 TypeMirror

          Returns the type of the innermost enclosing instance or a of kind if there is no enclosing instance.
 List

          Returns the actual type arguments of this type.
 
Methods inherited from class javax.lang.model.type.TypeMirror
accept, equals, getKind, hashCode, toString
 

Method Detail

asElement

public Element asElement()
Returns the element corresponding to this type.

Returns:
the element corresponding to this type

getEnclosingType

public TypeMirror getEnclosingType()
Returns the type of the innermost enclosing instance or a {@code NoType} of kind {@code NONE} if there is no enclosing instance. Only types corresponding to inner classes have an enclosing instance.

Returns:
a type mirror for the enclosing type

getTypeArguments

public List getTypeArguments()
Returns the actual type arguments of this type. For a type nested within a parameterized type (such as {@code Outer.Inner}), only the type arguments of the innermost type are included.

Returns:
the actual type arguments of this type, or an empty list if 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/.