|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.stjs.generator.javac.TypesUtils
public final class TypesUtils
A utility class that helps with TypeMirrors.
| Method Summary | |
|---|---|
static boolean |
areSamePrimitiveTypes(TypeMirror left,
TypeMirror right)
Returns true iff the arguments are both the same primitive types. |
static ArrayType |
createArrayType(Types types,
TypeMirror componentType)
Returns an ArrayType with elements of type componentType. |
static Name |
getQualifiedName(DeclaredType type)
Gets the fully qualified name for a provided type. |
static boolean |
isBooleanType(TypeMirror type)
Checks if the type represents a boolean type, that is either boolean (primitive type) or java.lang.Boolean. |
static boolean |
isBoxedPrimitive(TypeMirror type)
|
static boolean |
isClass(TypeMirror type)
Checks if the type represents a java.lang.Class declared type. |
static boolean |
isDeclaredOfName(TypeMirror type,
CharSequence qualifiedName)
Check if the type represent a declared type of the given qualified name |
static boolean |
isFloating(TypeMirror type)
Returns true iff the argument is a floating point type. |
static boolean |
isIntegral(TypeMirror type)
Returns true iff the argument is an integral type. |
static boolean |
isNumeric(TypeMirror type)
Returns true iff the argument is a primitive numeric type. |
static boolean |
isObject(TypeMirror type)
Checks if the type represents a java.lang.Object declared type. |
static boolean |
isPrimitive(TypeMirror type)
Returns true iff the argument is a primitive type. |
static boolean |
isString(TypeMirror type)
Checks if the type represents a java.lang.String declared type. |
static boolean |
isThrowable(TypeMirror type)
|
static TypeMirror |
typeFromClass(Types types,
Elements elements,
Class<?> clazz)
Returns the TypeMirror for a given Class. |
static TypeMirror |
upperBound(TypeMirror type)
If the argument is a bounded TypeVariable or WildcardType, return its non-variable, non-wildcard upper bound. |
static TypeKind |
widenedNumericType(TypeMirror left,
TypeMirror right)
Returns the widened numeric type for an arithmetic operation performed on a value of the left type and the right type. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Name getQualifiedName(DeclaredType type)
type - the declared type
public static boolean isObject(TypeMirror type)
type - the type
public static boolean isClass(TypeMirror type)
type - the type
public static boolean isString(TypeMirror type)
type - the type
public static boolean isBooleanType(TypeMirror type)
type - the type to test
public static boolean isDeclaredOfName(TypeMirror type,
CharSequence qualifiedName)
type - the type
public static boolean isBoxedPrimitive(TypeMirror type)
public static boolean isThrowable(TypeMirror type)
public static boolean isPrimitive(TypeMirror type)
public static boolean areSamePrimitiveTypes(TypeMirror left,
TypeMirror right)
public static boolean isNumeric(TypeMirror type)
public static boolean isIntegral(TypeMirror type)
public static boolean isFloating(TypeMirror type)
public static TypeKind widenedNumericType(TypeMirror left,
TypeMirror right)
TypeKind because creating a TypeMirror requires a
Types object from the ProcessingEnvironment.
public static TypeMirror upperBound(TypeMirror type)
type - a type
public static TypeMirror typeFromClass(Types types,
Elements elements,
Class<?> clazz)
TypeMirror for a given Class.
public static ArrayType createArrayType(Types types,
TypeMirror componentType)
ArrayType with elements of type componentType.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||