|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjasm.lang.JvmTypes
public class JvmTypes
Constructor Summary | |
---|---|
JvmTypes()
|
Method Summary | |
---|---|
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,
java.lang.String wrapper)
Determine whether or not the given type is a wrapper for a primitive type. |
static boolean |
isClass(java.lang.String pkg,
java.lang.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,
java.util.Map<java.lang.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,
java.util.Map<java.lang.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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final JvmType.Void T_VOID
public static final JvmType.Null T_NULL
public static final JvmType.Bool T_BOOL
public static final JvmType.Byte T_BYTE
public static final JvmType.Char T_CHAR
public static final JvmType.Short T_SHORT
public static final JvmType.Int T_INT
public static final JvmType.Long T_LONG
public static final JvmType.Float T_FLOAT
public static final JvmType.Double T_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
Constructor Detail |
---|
public JvmTypes()
Method Detail |
---|
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, java.lang.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, java.util.Map<java.lang.String,JvmType.Reference> binding)
K -> String V -> IntegerThen, substituting against
HashMap
yields
HashMap
.
type
- binding
-
public static JvmType.Function substitute(JvmType.Function type, java.util.Map<java.lang.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 isClass(java.lang.String pkg, java.lang.String clazz, JvmType 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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |