org.objectweb.asm
public class Type extends Object
Field Summary | |
---|---|
static int | ARRAY
The sort of array reference types. |
static int | BOOLEAN
The sort of the boolean type. |
static Type | BOOLEAN_TYPE
The boolean type. |
static int | BYTE
The sort of the byte type. |
static Type | BYTE_TYPE
The byte type. |
static int | CHAR
The sort of the char type. |
static Type | CHAR_TYPE
The char type. |
static int | DOUBLE
The sort of the double type. |
static Type | DOUBLE_TYPE
The double type. |
static int | FLOAT
The sort of the float type. |
static Type | FLOAT_TYPE
The float type. |
static int | INT
The sort of the int type. |
static Type | INT_TYPE
The int type. |
static int | LONG
The sort of the long type. |
static Type | LONG_TYPE
The long type. |
static int | OBJECT
The sort of object reference type. |
static int | SHORT
The sort of the short type. |
static Type | SHORT_TYPE
The short type. |
static int | VOID
The sort of the void type. |
static Type | VOID_TYPE
The void type. |
Method Summary | |
---|---|
boolean | equals(Object o)
Tests if the given object is equal to this type.
|
static int | getArgumentsAndReturnSizes(String desc)
Computes the size of the arguments and of the return value of a method.
|
static Type[] | getArgumentTypes(String methodDescriptor)
Returns the Java types corresponding to the argument types of the given
method descriptor.
|
static Type[] | getArgumentTypes(Method method)
Returns the Java types corresponding to the argument types of the given
method.
|
String | getClassName()
Returns the name of the class corresponding to this type.
|
static String | getConstructorDescriptor(Constructor c)
Returns the descriptor corresponding to the given constructor.
|
String | getDescriptor()
Returns the descriptor corresponding to this Java type.
|
static String | getDescriptor(Class c)
Returns the descriptor corresponding to the given Java type.
|
int | getDimensions()
Returns the number of dimensions of this array type. |
Type | getElementType()
Returns the type of the elements of this array type. |
String | getInternalName()
Returns the internal name of the class corresponding to this object or
array type. |
static String | getInternalName(Class c)
Returns the internal name of the given class. |
static String | getMethodDescriptor(Type returnType, Type[] argumentTypes)
Returns the descriptor corresponding to the given argument and return
types.
|
static String | getMethodDescriptor(Method m)
Returns the descriptor corresponding to the given method.
|
static Type | getObjectType(String internalName)
Returns the Java type corresponding to the given internal name.
|
int | getOpcode(int opcode)
Returns a JVM instruction opcode adapted to this Java type.
|
static Type | getReturnType(String methodDescriptor)
Returns the Java type corresponding to the return type of the given
method descriptor.
|
static Type | getReturnType(Method method)
Returns the Java type corresponding to the return type of the given
method.
|
int | getSize()
Returns the size of values of this type.
|
int | getSort()
Returns the sort of this Java type.
|
static Type | getType(String typeDescriptor)
Returns the Java type corresponding to the given type descriptor.
|
static Type | getType(Class c)
Returns the Java type corresponding to the given class.
|
int | hashCode()
Returns a hash code value for this type.
|
String | toString()
Returns a string representation of this type.
|
getSort
.getSort
.getSort
.getSort
.getSort
.getSort
.getSort
.getSort
.getSort
.getSort
.getSort
.Parameters: o the object to be compared to this type.
Returns: true if the given object is equal to this type.
Parameters: desc the descriptor of a method.
Returns: the size of the arguments of the method (plus one for the implicit this argument), argSize, and the size of its return value, retSize, packed into a single int i = (argSize << 2) | retSize (argSize is therefore equal to i >> 2, and retSize to i & 0x03).
Parameters: methodDescriptor a method descriptor.
Returns: the Java types corresponding to the argument types of the given method descriptor.
Parameters: method a method.
Returns: the Java types corresponding to the argument types of the given method.
Returns: the fully qualified name of the class corresponding to this type.
Parameters: c a Constructor Constructor
object.
Returns: the descriptor of the given constructor.
Returns: the descriptor corresponding to this Java type.
Parameters: c an object class, a primitive class or an array class.
Returns: the descriptor corresponding to the given class.
Returns: the number of dimensions of this array type.
Returns: Returns the type of the elements of this array type.
Returns: the internal name of the class corresponding to this object type.
Parameters: c an object or array class.
Returns: the internal name of the given class.
Parameters: returnType the return type of the method. argumentTypes the argument types of the method.
Returns: the descriptor corresponding to the given argument and return types.
Parameters: m a Method Method
object.
Returns: the descriptor of the given method.
Parameters: internalName an internal name.
Returns: the Java type corresponding to the given internal name.
Parameters: opcode a JVM instruction opcode. This opcode must be one of ILOAD, ISTORE, IALOAD, IASTORE, IADD, ISUB, IMUL, IDIV, IREM, INEG, ISHL, ISHR, IUSHR, IAND, IOR, IXOR and IRETURN.
Returns: an opcode that is similar to the given opcode, but adapted to this Java type. For example, if this type is float and opcode is IRETURN, this method returns FRETURN.
Parameters: methodDescriptor a method descriptor.
Returns: the Java type corresponding to the return type of the given method descriptor.
Parameters: method a method.
Returns: the Java type corresponding to the return type of the given method.
Returns: the size of values of this type, i.e., 2 for long and double, and 1 otherwise.
Returns: VOID
, BOOLEAN
,
CHAR
, BYTE
, SHORT
,
INT
, FLOAT
, LONG
,
DOUBLE
, ARRAY
or
OBJECT
.
Parameters: typeDescriptor a type descriptor.
Returns: the Java type corresponding to the given type descriptor.
Parameters: c a class.
Returns: the Java type corresponding to the given class.
Returns: a hash code value for this type.
Returns: the descriptor of this type.