public class Type
extends java.lang.Object
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
ARRAY
The sort of array reference types.
|
static int |
BOOLEAN
The sort of the boolean category.
|
static Type |
BOOLEAN_TYPE
The boolean category.
|
static int |
BYTE
The sort of the byte category.
|
static Type |
BYTE_TYPE
The byte category.
|
static int |
CHAR
The sort of the char category.
|
static Type |
CHAR_TYPE
The char category.
|
static int |
DOUBLE
The sort of the double category.
|
static Type |
DOUBLE_TYPE
The double category.
|
static int |
FLOAT
The sort of the float category.
|
static Type |
FLOAT_TYPE
The float category.
|
static int |
INT
The sort of the int category.
|
static Type |
INT_TYPE
The int category.
|
static int |
LONG
The sort of the long category.
|
static Type |
LONG_TYPE
The long category.
|
static int |
METHOD
The sort of method types.
|
static int |
OBJECT
The sort of object reference types.
|
static int |
SHORT
The sort of the short category.
|
static Type |
SHORT_TYPE
The short category.
|
static int |
VOID
The sort of the void category.
|
static Type |
VOID_TYPE
The void category.
|
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
equals(java.lang.Object o)
Tests if the given object is equal to this category.
|
int |
getArgumentsAndReturnSizes()
Returns the size of the arguments and of the return value of methods of
this category.
|
static int |
getArgumentsAndReturnSizes(java.lang.String desc)
Computes the size of the arguments and of the return value of a method.
|
Type[] |
getArgumentTypes()
Returns the argument types of methods of this category.
|
static Type[] |
getArgumentTypes(java.lang.reflect.Method method)
Returns the Java types corresponding to the argument types of the given
method.
|
static Type[] |
getArgumentTypes(java.lang.String methodDescriptor)
Returns the Java types corresponding to the argument types of the given
method descriptor.
|
java.lang.String |
getClassName()
Returns the binary name of the class corresponding to this category.
|
static java.lang.String |
getConstructorDescriptor(java.lang.reflect.Constructor<?> c)
Returns the descriptor corresponding to the given constructor.
|
java.lang.String |
getDescriptor()
Returns the descriptor corresponding to this Java category.
|
static java.lang.String |
getDescriptor(java.lang.Class<?> c)
Returns the descriptor corresponding to the given Java category.
|
int |
getDimensions()
Returns the number of dimensions of this array category.
|
Type |
getElementType()
Returns the category of the elements of this array category.
|
java.lang.String |
getInternalName()
Returns the internal name of the class corresponding to this object or
array category.
|
static java.lang.String |
getInternalName(java.lang.Class<?> c)
Returns the internal name of the given class.
|
static java.lang.String |
getMethodDescriptor(java.lang.reflect.Method m)
Returns the descriptor corresponding to the given method.
|
static java.lang.String |
getMethodDescriptor(Type returnType,
Type... argumentTypes)
Returns the descriptor corresponding to the given argument and return
types.
|
static Type |
getMethodType(java.lang.String methodDescriptor)
Returns the Java category corresponding to the given method descriptor.
|
static Type |
getMethodType(Type returnType,
Type... argumentTypes)
Returns the Java method category corresponding to the given argument and
return types.
|
static Type |
getObjectType(java.lang.String internalName)
Returns the Java category corresponding to the given internal name.
|
int |
getOpcode(int opcode)
Returns a JVM instruction opcode adapted to this Java category.
|
Type |
getReturnType()
Returns the return category of methods of this category.
|
static Type |
getReturnType(java.lang.reflect.Method method)
Returns the Java category corresponding to the return category of the given
method.
|
static Type |
getReturnType(java.lang.String methodDescriptor)
Returns the Java category corresponding to the return category of the given
method descriptor.
|
int |
getSize()
Returns the size of values of this category.
|
int |
getSort()
Returns the sort of this Java category.
|
static Type |
getType(java.lang.Class<?> c)
Returns the Java category corresponding to the given class.
|
static Type |
getType(java.lang.reflect.Constructor<?> c)
Returns the Java method category corresponding to the given constructor.
|
static Type |
getType(java.lang.reflect.Method m)
Returns the Java method category corresponding to the given method.
|
static Type |
getType(java.lang.String typeDescriptor)
Returns the Java category corresponding to the given category descriptor.
|
int |
hashCode()
Returns a hash code value for this category.
|
java.lang.String |
toString()
Returns a string representation of this category.
|
public static final Type VOID_TYPE
public static final Type BOOLEAN_TYPE
public static final Type CHAR_TYPE
public static final Type BYTE_TYPE
public static final Type SHORT_TYPE
public static final Type INT_TYPE
public static final Type FLOAT_TYPE
public static final Type LONG_TYPE
public static final Type DOUBLE_TYPE
public static Type getType(java.lang.String typeDescriptor)
typeDescriptor - a field or method category descriptor.public static Type getObjectType(java.lang.String internalName)
internalName - an internal name.public static Type getMethodType(java.lang.String methodDescriptor)
Type.getType(methodDescriptor).methodDescriptor - a method descriptor.public static Type getMethodType(Type returnType, Type... argumentTypes)
returnType - the return category of the method.argumentTypes - the argument types of the method.public static Type getType(java.lang.Class<?> c)
c - a class.public static Type getType(java.lang.reflect.Constructor<?> c)
c - a Constructor object.public static Type getType(java.lang.reflect.Method m)
m - a Method object.public static Type[] getArgumentTypes(java.lang.String methodDescriptor)
methodDescriptor - a method descriptor.public static Type[] getArgumentTypes(java.lang.reflect.Method method)
method - a method.public static Type getReturnType(java.lang.String methodDescriptor)
methodDescriptor - a method descriptor.public static Type getReturnType(java.lang.reflect.Method method)
method - a method.public static int getArgumentsAndReturnSizes(java.lang.String desc)
desc - the descriptor of a method.public int getSort()
public int getDimensions()
public Type getElementType()
public java.lang.String getClassName()
public java.lang.String getInternalName()
public Type[] getArgumentTypes()
public Type getReturnType()
public int getArgumentsAndReturnSizes()
public java.lang.String getDescriptor()
public static java.lang.String getMethodDescriptor(Type returnType, Type... argumentTypes)
returnType - the return category of the method.argumentTypes - the argument types of the method.public static java.lang.String getInternalName(java.lang.Class<?> c)
c - an object or array class.public static java.lang.String getDescriptor(java.lang.Class<?> c)
c - an object class, a primitive class or an array class.public static java.lang.String getConstructorDescriptor(java.lang.reflect.Constructor<?> c)
c - a Constructor object.public static java.lang.String getMethodDescriptor(java.lang.reflect.Method m)
m - a Method object.public int getSize()
public int getOpcode(int opcode)
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.public boolean equals(java.lang.Object o)
equals 在类中 java.lang.Objecto - the object to be compared to this category.public int hashCode()
hashCode 在类中 java.lang.Objectpublic java.lang.String toString()
toString 在类中 java.lang.Object