checkers.util
Class TypesUtils

java.lang.Object
  extended by checkers.util.TypesUtils

@DefaultQualifier(value="checkers.nullness.quals.NonNull")
public final class TypesUtils
extends Object

A Utilities class that helps with Elements.


Method Summary
Modifier and Type Method and Description
static Name getQualifiedName(DeclaredType type)
          Gets the fully qualified name for a provided type.
static boolean isAnonymousType(TypeMirror type)
          Checks if the type represents an anonymous type, e.g.
static boolean isBoxedPrimitive(TypeMirror type)
           
static boolean isClass(TypeMirror type)
          Checks if the type represents a java.lang.Object declared type
static boolean isDeclaredOfName(TypeMirror type, CharSequence qualifiedName)
          Check if the type represent a declared type of the given qualified name
static boolean isObject(TypeMirror type)
          Checks if the type represents a java.lang.Object declared type
static boolean isThrowable(TypeMirror type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getQualifiedName

public static Name getQualifiedName(DeclaredType type)
Gets the fully qualified name for a provided type. It returns an empty name if type is an anonymous type.

Parameters:
type - the declared type
Returns:
the name corresponding to that type

isObject

public static boolean isObject(TypeMirror type)
Checks if the type represents a java.lang.Object declared type

Parameters:
type - the type
Returns:
true iff type represents java.lang.Object

isClass

public static boolean isClass(TypeMirror type)
Checks if the type represents a java.lang.Object declared type

Parameters:
type - the type
Returns:
true iff type represents java.lang.Object

isDeclaredOfName

public static boolean isDeclaredOfName(TypeMirror type,
                                       CharSequence qualifiedName)
Check if the type represent a declared type of the given qualified name

Parameters:
type - the type
Returns:
type iff type represents a declared type of the qualified name

isAnonymousType

public static boolean isAnonymousType(TypeMirror type)
Checks if the type represents an anonymous type, e.g. as a result of an intersection type

Parameters:
type - the declared type
Returns:
true iff the type represents an anonymous type.

isBoxedPrimitive

public static boolean isBoxedPrimitive(TypeMirror type)

isThrowable

public static boolean isThrowable(TypeMirror type)
Returns:
type represents a Trowable type (e.g. Exception, Error)