org.eclipse.jdt.internal.compiler.apt.model
Class TypesImpl

java.lang.Object
  extended by org.eclipse.jdt.internal.compiler.apt.model.TypesImpl
All Implemented Interfaces:
Types

public class TypesImpl
extends Object
implements Types

Utilities for working with types (as opposed to elements). There is one of these for every ProcessingEnvironment.


Constructor Summary
TypesImpl(BaseProcessingEnvImpl env)
           
 
Method Summary
 Element asElement(TypeMirror t)
           
 TypeMirror asMemberOf(DeclaredType containing, Element element)
           
 TypeElement boxedClass(PrimitiveType p)
           
 TypeMirror capture(TypeMirror t)
           
 boolean contains(TypeMirror t1, TypeMirror t2)
           
 List<? extends TypeMirror> directSupertypes(TypeMirror t)
           
 TypeMirror erasure(TypeMirror t)
           
 ArrayType getArrayType(TypeMirror componentType)
           
 DeclaredType getDeclaredType(DeclaredType containing, TypeElement typeElem, TypeMirror... typeArgs)
           
 DeclaredType getDeclaredType(TypeElement typeElem, TypeMirror... typeArgs)
           
 NoType getNoType(TypeKind kind)
           
 NullType getNullType()
           
 PrimitiveType getPrimitiveType(TypeKind kind)
           
 WildcardType getWildcardType(TypeMirror extendsBound, TypeMirror superBound)
           
 boolean isAssignable(TypeMirror t1, TypeMirror t2)
           
 boolean isSameType(TypeMirror t1, TypeMirror t2)
           
 boolean isSubsignature(ExecutableType m1, ExecutableType m2)
           
 boolean isSubtype(TypeMirror t1, TypeMirror t2)
           
 PrimitiveType unboxedType(TypeMirror t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypesImpl

public TypesImpl(BaseProcessingEnvImpl env)
Method Detail

asElement

public Element asElement(TypeMirror t)
Specified by:
asElement in interface Types

asMemberOf

public TypeMirror asMemberOf(DeclaredType containing,
                             Element element)
Specified by:
asMemberOf in interface Types

boxedClass

public TypeElement boxedClass(PrimitiveType p)
Specified by:
boxedClass in interface Types

capture

public TypeMirror capture(TypeMirror t)
Specified by:
capture in interface Types

contains

public boolean contains(TypeMirror t1,
                        TypeMirror t2)
Specified by:
contains in interface Types

directSupertypes

public List<? extends TypeMirror> directSupertypes(TypeMirror t)
Specified by:
directSupertypes in interface Types

erasure

public TypeMirror erasure(TypeMirror t)
Specified by:
erasure in interface Types

getArrayType

public ArrayType getArrayType(TypeMirror componentType)
Specified by:
getArrayType in interface Types

getDeclaredType

public DeclaredType getDeclaredType(TypeElement typeElem,
                                    TypeMirror... typeArgs)
Specified by:
getDeclaredType in interface Types

getDeclaredType

public DeclaredType getDeclaredType(DeclaredType containing,
                                    TypeElement typeElem,
                                    TypeMirror... typeArgs)
Specified by:
getDeclaredType in interface Types

getNoType

public NoType getNoType(TypeKind kind)
Specified by:
getNoType in interface Types

getNullType

public NullType getNullType()
Specified by:
getNullType in interface Types

getPrimitiveType

public PrimitiveType getPrimitiveType(TypeKind kind)
Specified by:
getPrimitiveType in interface Types

getWildcardType

public WildcardType getWildcardType(TypeMirror extendsBound,
                                    TypeMirror superBound)
Specified by:
getWildcardType in interface Types

isAssignable

public boolean isAssignable(TypeMirror t1,
                            TypeMirror t2)
Specified by:
isAssignable in interface Types
Returns:
true if a value of type t1 can be assigned to a variable of type t2, i.e., t2 = t1.

isSameType

public boolean isSameType(TypeMirror t1,
                          TypeMirror t2)
Specified by:
isSameType in interface Types

isSubsignature

public boolean isSubsignature(ExecutableType m1,
                              ExecutableType m2)
Specified by:
isSubsignature in interface Types

isSubtype

public boolean isSubtype(TypeMirror t1,
                         TypeMirror t2)
Specified by:
isSubtype in interface Types
Returns:
true if t1 is a subtype of t2, or if t1 == t2.

unboxedType

public PrimitiveType unboxedType(TypeMirror t)
Specified by:
unboxedType in interface Types


Copyright © 2012. All Rights Reserved.