public class JvmTypes extends Object
| Constructor and Description |
|---|
JvmTypes() |
| Modifier and Type | Method and Description |
|---|---|
static int |
arrayDepth(JvmType t)
Return the depth of array nesting.
|
static JvmType.Clazz |
boxedType(JvmType.Primitive p)
Given a primitive type, determine the equivalent boxed type.
|
static boolean |
isBoxedType(JvmType t)
Determine whether or not the given type is a wrapper for a primitive
type.
|
static boolean |
isBoxedTypeOf(JvmType t,
String wrapper)
Determine whether or not the given type is a wrapper for a primitive
type.
|
static boolean |
isClass(String pkg,
String clazz,
JvmType t) |
static boolean |
isGeneric(JvmType t) |
static boolean |
isGenericArray(JvmType t) |
static boolean |
isJavaLangObject(JvmType t)
Check wither a given type is a reference to java.lang.Object or not.
|
static boolean |
isJavaLangString(JvmType t)
Check wither a given type is a reference to java.lang.String or not.
|
static JvmType.Clazz |
parentType(JvmType.Clazz t)
Return type representing the enclosing class for the given type, or null
if the given type is already outermost.
|
static JvmType.Clazz |
stripGenerics(JvmType.Clazz ct) |
static JvmType.Function |
stripGenerics(JvmType.Function ft) |
static JvmType.Intersection |
stripGenerics(JvmType.Intersection wt) |
static JvmType |
stripGenerics(JvmType.Variable vt) |
static JvmType |
stripGenerics(JvmType.Wildcard wt) |
static JvmType |
stripGenerics(JvmType t)
The purpose of this method is to strip the generic information from a
type.
|
static JvmType.Function |
substitute(JvmType.Function type,
Map<String,JvmType.Reference> binding)
This method accepts a binding from type variables to concrete types, and
then substitutes each such variable occuring in the target (function)
type with its corresponding instantation.
|
static JvmType.Reference |
substitute(JvmType.Reference type,
Map<String,JvmType.Reference> binding)
This method accepts a binding from type variables to concrete types, and
then substitutes each such variable occuring in the target type with its
corresponding instantation.
|
static JvmType.Primitive |
unboxedType(JvmType.Clazz p)
Given a primitive wrapper class (i.e.
|
public static final JvmType.Void VOID
public static final JvmType.Null NULL
public static final JvmType.Bool BOOL
public static final JvmType.Byte BYTE
public static final JvmType.Char CHAR
public static final JvmType.Short SHORT
public static final JvmType.Int INT
public static final JvmType.Long LONG
public static final JvmType.Float FLOAT
public static final JvmType.Double DOUBLE
public static final JvmType.Clazz JAVA_LANG_OBJECT
public static final JvmType.Clazz JAVA_LANG_CLASS
public static final JvmType.Clazz JAVA_LANG_CLONEABLE
public static final JvmType.Clazz JAVA_LANG_STRING
public static final JvmType.Clazz JAVA_LANG_ENUM
public static final JvmType.Clazz JAVA_LANG_BOOLEAN
public static final JvmType.Clazz JAVA_LANG_CHARACTER
public static final JvmType.Clazz JAVA_LANG_BYTE
public static final JvmType.Clazz JAVA_LANG_SHORT
public static final JvmType.Clazz JAVA_LANG_INTEGER
public static final JvmType.Clazz JAVA_LANG_LONG
public static final JvmType.Clazz JAVA_LANG_FLOAT
public static final JvmType.Clazz JAVA_LANG_DOUBLE
public static final JvmType.Clazz JAVA_IO_SERIALIZABLE
public static final JvmType.Clazz JAVA_UTIL_ITERATOR
public static final JvmType.Clazz JAVA_LANG_THROWABLE
public static final JvmType.Clazz JAVA_LANG_RUNTIMEEXCEPTION
public static final JvmType.Clazz JAVA_LANG_VIRTUALMACHINEERROR
public static final JvmType.Clazz JAVA_LANG_NULLPOINTEREXCEPTION
public static final JvmType.Clazz JAVA_LANG_ARITHMETICEXCEPTION
public static JvmType.Clazz boxedType(JvmType.Primitive p)
p - public static JvmType.Primitive unboxedType(JvmType.Clazz p)
p - public static boolean isBoxedType(JvmType t)
t - public static boolean isBoxedTypeOf(JvmType t, String wrapper)
t - --- type to testwrapper - --- specific wrapper class to look for (i.e. Integer, Boolean,
Character).public static JvmType.Reference substitute(JvmType.Reference type, Map<String,JvmType.Reference> binding)
K -> String V -> IntegerThen, substituting against
HashMap<K,V> yields
HashMap<String,Integer>.type - binding - public static JvmType.Function substitute(JvmType.Function type, Map<String,JvmType.Reference> binding)
K -> String V -> IntegerThen, substituting against
v f(K) yields
Integer f(String).type - binding - public static boolean isJavaLangObject(JvmType t)
t - public static boolean isJavaLangString(JvmType t)
t - public static boolean isGeneric(JvmType t)
public static boolean isGenericArray(JvmType t)
public static int arrayDepth(JvmType t)
t - public static JvmType.Clazz parentType(JvmType.Clazz t)
pkg.Test$inner return pkg.Test.t - public static JvmType stripGenerics(JvmType t)
t - public static JvmType.Clazz stripGenerics(JvmType.Clazz ct)
public static JvmType.Function stripGenerics(JvmType.Function ft)
public static JvmType stripGenerics(JvmType.Variable vt)
public static JvmType stripGenerics(JvmType.Wildcard wt)
public static JvmType.Intersection stripGenerics(JvmType.Intersection wt)
Copyright © 2016. All rights reserved.