public class Type extends Object
| Modifier and Type | Field and Description | 
|---|---|
| static int | ARRAYThe sort of array reference types. | 
| static int | BOOLEANThe sort of the boolean type. | 
| static Type | BOOLEAN_TYPEThe boolean type. | 
| static int | BYTEThe sort of the byte type. | 
| static Type | BYTE_TYPEThe byte type. | 
| static int | CHARThe sort of the char type. | 
| static Type | CHAR_TYPEThe char type. | 
| static int | DOUBLEThe sort of the double type. | 
| static Type | DOUBLE_TYPEThe double type. | 
| static int | FLOATThe sort of the float type. | 
| static Type | FLOAT_TYPEThe float type. | 
| static int | INTThe sort of the int type. | 
| static Type | INT_TYPEThe int type. | 
| static int | LONGThe sort of the long type. | 
| static Type | LONG_TYPEThe long type. | 
| static int | METHODThe sort of method types. | 
| static int | OBJECTThe sort of object reference types. | 
| static int | SHORTThe sort of the short type. | 
| static Type | SHORT_TYPEThe short type. | 
| static int | VOIDThe sort of the void type. | 
| static Type | VOID_TYPEThe void type. | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | equals(Object object)Tests if the given object is equal to this type. | 
| int | getArgumentsAndReturnSizes()Returns the size of the arguments and of the return value of methods of this type. | 
| static int | getArgumentsAndReturnSizes(String methodDescriptor)Computes the size of the arguments and of the return value of a method. | 
| Type[] | getArgumentTypes()Returns the argument types of methods of this type. | 
| static Type[] | getArgumentTypes(Method method)Returns the  Typevalues corresponding to the argument types of the given method. | 
| static Type[] | getArgumentTypes(String methodDescriptor)Returns the  Typevalues corresponding to the argument types of the given method
 descriptor. | 
| String | getClassName()Returns the binary name of the class corresponding to this type. | 
| static String | getConstructorDescriptor(Constructor<?> constructor)Returns the descriptor corresponding to the given constructor. | 
| String | getDescriptor()Returns the descriptor corresponding to this type. | 
| static String | getDescriptor(Class<?> clazz)Returns the descriptor corresponding to the given class. | 
| 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<?> clazz)Returns the internal name of the given class. | 
| static String | getMethodDescriptor(Method method)Returns the descriptor corresponding to the given method. | 
| static String | getMethodDescriptor(Type returnType,
                   Type... argumentTypes)Returns the descriptor corresponding to the given argument and return types. | 
| static Type | getMethodType(String methodDescriptor)Returns the  Typecorresponding to the given method descriptor. | 
| static Type | getMethodType(Type returnType,
             Type... argumentTypes)Returns the method  Typecorresponding to the given argument and return types. | 
| static Type | getObjectType(String internalName)Returns the  Typecorresponding to the given internal name. | 
| int | getOpcode(int opcode)Returns a JVM instruction opcode adapted to this  Type. | 
| Type | getReturnType()Returns the return type of methods of this type. | 
| static Type | getReturnType(Method method)Returns the  Typecorresponding to the return type of the given method. | 
| static Type | getReturnType(String methodDescriptor)Returns the  Typecorresponding to the return type of the given method descriptor. | 
| int | getSize()Returns the size of values of this type. | 
| int | getSort()Returns the sort of this type. | 
| static Type | getType(Class<?> clazz)Returns the  Typecorresponding to the given class. | 
| static Type | getType(Constructor<?> constructor)Returns the method  Typecorresponding to the given constructor. | 
| static Type | getType(Method method)Returns the method  Typecorresponding to the given method. | 
| static Type | getType(String typeDescriptor)Returns the  Typecorresponding to the given type descriptor. | 
| int | hashCode()Returns a hash code value for this type. | 
| String | toString()Returns a string representation of this type. | 
public static final int VOID
getSort().public static final int BOOLEAN
getSort().public static final int CHAR
getSort().public static final int BYTE
getSort().public static final int SHORT
getSort().public static final int INT
getSort().public static final int FLOAT
getSort().public static final int LONG
getSort().public static final int DOUBLE
getSort().public static final int ARRAY
getSort().public static final int OBJECT
getSort().public static final int METHOD
getSort().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(String typeDescriptor)
Type corresponding to the given type descriptor.typeDescriptor - a field or method type descriptor.Type corresponding to the given type descriptor.public static Type getObjectType(String internalName)
Type corresponding to the given internal name.internalName - an internal name.Type corresponding to the given internal name.public static Type getMethodType(String methodDescriptor)
Type corresponding to the given method descriptor. Equivalent to 
 Type.getType(methodDescriptor).methodDescriptor - a method descriptor.Type corresponding to the given method descriptor.public static Type getMethodType(Type returnType, Type... argumentTypes)
Type corresponding to the given argument and return types.returnType - the return type of the method.argumentTypes - the argument types of the method.Type corresponding to the given argument and return types.public static Type getType(Class<?> clazz)
Type corresponding to the given class.clazz - a class.Type corresponding to the given class.public static Type getType(Constructor<?> constructor)
Type corresponding to the given constructor.constructor - a Constructor object.Type corresponding to the given constructor.public static Type getType(Method method)
Type corresponding to the given method.public static Type[] getArgumentTypes(String methodDescriptor)
Type values corresponding to the argument types of the given method
 descriptor.methodDescriptor - a method descriptor.Type values corresponding to the argument types of the given method
     descriptor.public static Type[] getArgumentTypes(Method method)
Type values corresponding to the argument types of the given method.method - a method.Type values corresponding to the argument types of the given method.public static Type getReturnType(String methodDescriptor)
Type corresponding to the return type of the given method descriptor.methodDescriptor - a method descriptor.Type corresponding to the return type of the given method descriptor.public static Type getReturnType(Method method)
Type corresponding to the return type of the given method.method - a method.Type corresponding to the return type of the given method.public static int getArgumentsAndReturnSizes(String methodDescriptor)
methodDescriptor - a method descriptor.public int getSort()
public int getDimensions()
public Type getElementType()
public String getClassName()
public String getInternalName()
public Type[] getArgumentTypes()
public Type getReturnType()
public int getArgumentsAndReturnSizes()
public String getDescriptor()
public static String getMethodDescriptor(Type returnType, Type... argumentTypes)
returnType - the return type of the method.argumentTypes - the argument types of the method.public static String getInternalName(Class<?> clazz)
clazz - an object or array class.public static String getDescriptor(Class<?> clazz)
clazz - an object class, a primitive class or an array class.public static String getConstructorDescriptor(Constructor<?> constructor)
constructor - a Constructor object.public static String getMethodDescriptor(Method method)
method - a Method object.public int getSize()
public int getOpcode(int opcode)
Type. This method must not be used for
 method types.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.Type. For
     example, if this type is float and opcode is IRETURN, this method returns
     FRETURN.public boolean equals(Object object)
public int hashCode()
Copyright © 2021. All rights reserved.