public static final class JavaClassFile.Member.Type extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
ARRAY
The sort of array reference types.
|
static int |
BOOLEAN
The sort of the
boolean type. |
static JavaClassFile.Member.Type |
BOOLEAN_TYPE
The
boolean type. |
static int |
BYTE
The sort of the
byte type. |
static JavaClassFile.Member.Type |
BYTE_TYPE
The
byte type. |
static int |
CHAR
The sort of the
char type. |
static JavaClassFile.Member.Type |
CHAR_TYPE
The
char type. |
static int |
DOUBLE
The sort of the
double type. |
static JavaClassFile.Member.Type |
DOUBLE_TYPE
The
double type. |
static int |
FLOAT
The sort of the
float type. |
static JavaClassFile.Member.Type |
FLOAT_TYPE
The
float type. |
static int |
INT
The sort of the
int type. |
static JavaClassFile.Member.Type |
INT_TYPE
The
int type. |
static int |
LONG
The sort of the
long type. |
static JavaClassFile.Member.Type |
LONG_TYPE
The
long type. |
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 type. |
static JavaClassFile.Member.Type |
SHORT_TYPE
The
short type. |
static int |
VOID
The sort of the
void type. |
static JavaClassFile.Member.Type |
VOID_TYPE
The
void type. |
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
JavaClassFile.Member.Type[] |
getArgumentTypes()
Returns the argument types of methods of this type.
|
static JavaClassFile.Member.Type[] |
getArgumentTypes(Method method)
Returns the
JavaClassFile.Member.Type values corresponding to the argument types of the given method. |
static JavaClassFile.Member.Type[] |
getArgumentTypes(String methodDescriptor)
Returns the
JavaClassFile.Member.Type values 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.
|
JavaClassFile.Member.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(Class<?>[] parameterTypes,
Class<?> returnType) |
static String |
getMethodDescriptor(JavaClassFile.Member.Type returnType,
JavaClassFile.Member.Type... argumentTypes)
Returns the descriptor corresponding to the given argument and return types.
|
static String |
getMethodDescriptor(Method method)
Returns the descriptor corresponding to the given method.
|
static JavaClassFile.Member.Type |
getMethodType(JavaClassFile.Member.Type returnType,
JavaClassFile.Member.Type... argumentTypes)
Returns the method
JavaClassFile.Member.Type corresponding to the given argument and return types. |
static JavaClassFile.Member.Type |
getMethodType(String methodDescriptor)
Returns the
JavaClassFile.Member.Type corresponding to the given method descriptor. |
static JavaClassFile.Member.Type |
getObjectType(String internalName)
Returns the
JavaClassFile.Member.Type corresponding to the given internal name. |
int |
getOpcode(int opcode)
Returns a JVM instruction opcode adapted to this
JavaClassFile.Member.Type. |
JavaClassFile.Member.Type |
getReturnType()
Returns the return type of methods of this type.
|
static JavaClassFile.Member.Type |
getReturnType(Method method)
Returns the
JavaClassFile.Member.Type corresponding to the return type of the given method. |
static JavaClassFile.Member.Type |
getReturnType(String methodDescriptor)
Returns the
JavaClassFile.Member.Type corresponding 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 JavaClassFile.Member.Type |
getType(Class<?> clazz)
Returns the
JavaClassFile.Member.Type corresponding to the given class. |
static JavaClassFile.Member.Type |
getType(Constructor<?> constructor)
Returns the method
JavaClassFile.Member.Type corresponding to the given constructor. |
static JavaClassFile.Member.Type |
getType(Method method)
Returns the method
JavaClassFile.Member.Type corresponding to the given method. |
static JavaClassFile.Member.Type |
getType(String typeDescriptor)
Returns the
JavaClassFile.Member.Type corresponding 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 OBJECT
getSort().public static final JavaClassFile.Member.Type VOID_TYPE
void type.public static final JavaClassFile.Member.Type BOOLEAN_TYPE
boolean type.public static final JavaClassFile.Member.Type CHAR_TYPE
char type.public static final JavaClassFile.Member.Type BYTE_TYPE
byte type.public static final JavaClassFile.Member.Type SHORT_TYPE
short type.public static final JavaClassFile.Member.Type INT_TYPE
int type.public static final JavaClassFile.Member.Type FLOAT_TYPE
float type.public static final JavaClassFile.Member.Type LONG_TYPE
long type.public static final JavaClassFile.Member.Type DOUBLE_TYPE
double type.public static JavaClassFile.Member.Type getType(String typeDescriptor)
JavaClassFile.Member.Type corresponding to the given type descriptor.typeDescriptor - a field or method type descriptor.JavaClassFile.Member.Type corresponding to the given type descriptor.public static JavaClassFile.Member.Type getType(Class<?> clazz)
JavaClassFile.Member.Type corresponding to the given class.clazz - a class.JavaClassFile.Member.Type corresponding to the given class.public static JavaClassFile.Member.Type getType(Constructor<?> constructor)
JavaClassFile.Member.Type corresponding to the given constructor.constructor - a Constructor object.JavaClassFile.Member.Type corresponding to the given constructor.public static JavaClassFile.Member.Type getType(Method method)
JavaClassFile.Member.Type corresponding to the given method.method - a Method object.JavaClassFile.Member.Type corresponding to the given method.public JavaClassFile.Member.Type getElementType()
public static JavaClassFile.Member.Type getObjectType(String internalName)
JavaClassFile.Member.Type corresponding to the given internal name.internalName - an internal name.JavaClassFile.Member.Type corresponding to the given internal name.public static JavaClassFile.Member.Type getMethodType(String methodDescriptor)
JavaClassFile.Member.Type corresponding to the given method descriptor. Equivalent to
Type.getType(methodDescriptor).methodDescriptor - a method descriptor.JavaClassFile.Member.Type corresponding to the given method descriptor.public static JavaClassFile.Member.Type getMethodType(JavaClassFile.Member.Type returnType, JavaClassFile.Member.Type... argumentTypes)
JavaClassFile.Member.Type corresponding to the given argument and return types.returnType - the return type of the method.argumentTypes - the argument types of the method.JavaClassFile.Member.Type corresponding to the given argument and return types.public JavaClassFile.Member.Type[] getArgumentTypes()
public static JavaClassFile.Member.Type[] getArgumentTypes(String methodDescriptor)
JavaClassFile.Member.Type values corresponding to the argument types of the given method
descriptor.methodDescriptor - a method descriptor.JavaClassFile.Member.Type values corresponding to the argument types of the given method
descriptor.public static JavaClassFile.Member.Type[] getArgumentTypes(Method method)
JavaClassFile.Member.Type values corresponding to the argument types of the given method.method - a method.JavaClassFile.Member.Type values corresponding to the argument types of the given method.public JavaClassFile.Member.Type getReturnType()
public static JavaClassFile.Member.Type getReturnType(String methodDescriptor)
JavaClassFile.Member.Type corresponding to the return type of the given method descriptor.methodDescriptor - a method descriptor.JavaClassFile.Member.Type corresponding to the return type of the given method descriptor.public static JavaClassFile.Member.Type getReturnType(Method method)
JavaClassFile.Member.Type corresponding to the return type of the given method.method - a method.JavaClassFile.Member.Type corresponding to the return type of the given method.public String getClassName()
public String getInternalName()
public static String getInternalName(Class<?> clazz)
clazz - an object or array class.public String getDescriptor()
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(JavaClassFile.Member.Type returnType, JavaClassFile.Member.Type... argumentTypes)
returnType - the return type of the method.argumentTypes - the argument types of the method.public static String getMethodDescriptor(Method method)
method - a Method object.public static String getMethodDescriptor(Class<?>[] parameterTypes, Class<?> returnType)
public int getSort()
public int getDimensions()
public int getSize()
long and double, 0 for
void and 1 otherwise.public int getArgumentsAndReturnSizes()
(argumentsSize << 2) | returnSize (argumentsSize is therefore equal to i >> 2, and returnSize to i & 0x03).public static int getArgumentsAndReturnSizes(String methodDescriptor)
methodDescriptor - a method descriptor.(argumentsSize << 2) | returnSize (argumentsSize is therefore equal to i >> 2, and returnSize to i & 0x03).public int getOpcode(int opcode)
JavaClassFile.Member.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.JavaClassFile.Member.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.