public final class Type
A Java field or method type. This class can be used to make it easier to manipulate type and
method descriptors.
public static final int | ARRAY = 9 The sort of array reference types. |
public static final int | BOOLEAN = 1 The sort of the boolean type. |
public static final Type | The boolean type. |
public static final int | BYTE = 3 The sort of the byte type. |
public static final Type | The byte type. |
public static final int | CHAR = 2 The sort of the char type. |
public static final Type | The char type. |
public static final int | DOUBLE = 8 The sort of the double type. |
public static final Type | The double type. |
public static final int | FLOAT = 6 The sort of the float type. |
public static final Type | The float type. |
public static final int | INT = 5 The sort of the int type. |
public static final Type | The int type. |
public static final int | LONG = 7 The sort of the long type. |
public static final Type | The long type. |
public static final int | METHOD = 11 The sort of method types. |
public static final int | OBJECT = 10 The sort of object reference types. |
public static final int | SHORT = 4 The sort of the short type. |
public static final Type | The short type. |
public static final int | VOID = 0 The sort of the void type. |
public static final Type | The void type. |
public boolean | Tests if the given object is equal to this type. |
public Type[] | Returns the argument types of methods of this type. |
public static Type[] | getArgumentTypes( Returns the Type values corresponding to the argument types of the given method
descriptor. |
public static Type[] | getArgumentTypes( Returns the Type values corresponding to the argument types of the given method. |
public int | Returns the size of the arguments and of the return value of methods of this type. |
public static int | getArgumentsAndReturnSizes( Computes the size of the arguments and of the return value of a method. |
public String | Returns the binary name of the class corresponding to this type. |
public static String | getConstructorDescriptor( Returns the descriptor corresponding to the given constructor. |
public String | Returns the descriptor corresponding to this type. |
public static String | getDescriptor( Returns the descriptor corresponding to the given class. |
public int | Returns the number of dimensions of this array type. |
public Type | Returns the type of the elements of this array type. |
public String | Returns the internal name of the class corresponding to this object or array type. |
public static String | getInternalName( Returns the internal name of the given class. |
public static String | getMethodDescriptor( Returns the descriptor corresponding to the given method. |
public static String | getMethodDescriptor( Returns the descriptor corresponding to the given argument and return types. |
public static Type | getMethodType( Returns the Type corresponding to the given method descriptor. |
public static Type | getMethodType( Returns the method Type corresponding to the given argument and return types. |
public static Type | getObjectType( Returns the Type corresponding to the given internal name. |
public int | getOpcode( Returns a JVM instruction opcode adapted to this Type. |
public Type | Returns the return type of methods of this type. |
public static Type | getReturnType( Returns the Type corresponding to the return type of the given method descriptor. |
public static Type | getReturnType( Returns the Type corresponding to the return type of the given method. |
public int | getSize() Returns the size of values of this type. |
public int | getSort() Returns the sort of this type. |
public static Type | Returns the Type corresponding to the given class. |
public static Type | Returns the Type corresponding to the given type descriptor. |
public static Type | getType( Returns the method Type corresponding to the given constructor. |
public static Type | Returns the method Type corresponding to the given method. |
public int | hashCode() Returns a hash code value for this type. |
public String | toString() Returns a string representation of this type. |
The
boolean
type.The
double
type.The
float
type.The
short
type.Tests if the given object is equal to this type.
objectthe object to be compared to this type.
true if the given object is equal to this type.
Returns the argument types of methods of this type. This method should only be used for method
types.
the argument types of methods of this type.
Returns the size of the arguments and of the return value of methods of this type. This method
should only be used for method types.
the size of the arguments of the method (plus one for the implicit this argument),
argumentsSize, and the size of its return value, returnSize, packed into a single int i =
(argumentsSize << 2) | returnSize
(argumentsSize is therefore equal to
i >> 2
, and returnSize to i & 0x03
).Computes the size of the arguments and of the return value of a method.
methodDescriptora method descriptor.
the size of the arguments of the method (plus one for the implicit this argument),
argumentsSize, and the size of its return value, returnSize, packed into a single int i =
(argumentsSize << 2) | returnSize
(argumentsSize is therefore equal to
i >> 2
, and returnSize to i & 0x03
).Returns the binary name of the class corresponding to this type. This method must not be used
on method types.
the binary name of the class corresponding to this type.
Returns the descriptor corresponding to the given constructor.
constructora Constructor object.
the descriptor of the given constructor.
Returns the descriptor corresponding to this type.
the descriptor corresponding to this type.
Returns the descriptor corresponding to the given class.
clazzan object class, a primitive class or an array class.
the descriptor corresponding to the given class.
Returns the number of dimensions of this array type. This method should only be used for an
array type.
the number of dimensions of this array type.
Returns the type of the elements of this array type. This method should only be used for an
array type.
Returns the type of the elements of this array type.
Returns the internal name of the class corresponding to this object or array type. The internal
name of a class is its fully qualified name (as returned by Class.getName(), where '.' are
replaced by '/'). This method should only be used for an object or array type.
the internal name of the class corresponding to this object type.
Returns the internal name of the given class. The internal name of a class is its fully
qualified name, as returned by Class.getName(), where '.' are replaced by '/'.
clazzan object or array class.
the internal name of the given class.
Returns the descriptor corresponding to the given method.
methoda Method object.
the descriptor of the given method.
Returns the descriptor corresponding to the given argument and return types.
returnTypethe return type of the method.
argumentTypesthe argument types of the method.
the descriptor corresponding to the given argument and return types.
Returns a JVM instruction opcode adapted to this Type. This method must not be used for
method types.
opcodea 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.
an opcode that is similar to the given opcode, but adapted to this Type. For
example, if this type is
float
and opcode
is IRETURN, this method returns
FRETURN.Returns the return type of methods of this type. This method should only be used for method
types.
the return type of methods of this type.
Returns the size of values of this type. This method must not be used for method types.
the size of values of this type, i.e., 2 for
long
and double
, 0 for
void
and 1 otherwise.Returns the method Type corresponding to the given constructor.
constructora Constructor object.
the method Type corresponding to the given constructor.
Returns a hash code value for this type.
a hash code value for this type.