public abstract class Types extends Object
| 构造器和说明 |
|---|
Types() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
accessFlagsToString(int flags,
boolean isClass) |
static String[] |
descriptorToParameterTypes(String methoddescriptor) |
static String |
descriptorToReturnType(String methoddescriptor) |
static Class |
descriptorToType(String typedescriptor)
Converts a VM descriptor to the corresponding type.
|
static String |
fullMethodDescriptorToFullUserName(String classJavaName,
String methodName,
String methoddescriptor) |
static String |
fullMethodDescriptorToUserName(String classJavaName,
String methodName,
String methoddescriptor) |
static String |
getClassPackageName(Class c)
Returns 'c''s package name [does not include trailing '.'] or ""
if 'c' is in the default package.
|
static String |
javaNameToVMName(String javaName)
Converts Java-styled package/class name to how it would be
represented in the VM.
|
static String |
methodDescriptorToUserName(String methoddescriptor) |
static String |
signatureToDescriptor(Class[] parameterTypes,
Class returnType)
Converts a method signature (parameter types + return type) to its VM descriptor
representation.
|
static String |
signatureToDescriptor(Method method)
Converts a method signature to its VM descriptor representation.
|
static String |
signatureToMethodDescriptor(String[] parameterTypeDescriptors,
String returnTypeDescriptor) |
static String |
typeDescriptorToUserName(String typedescriptor) |
static String |
typeToDescriptor(Class type)
Converts a type (a Class) to its VM descriptor representation.
|
static String |
vmNameToJavaName(String vmName)
Converts a VM-styled package/class name to how it would be
represented in Java.
|
public static String getClassPackageName(Class c)
public static String accessFlagsToString(int flags, boolean isClass)
public static String javaNameToVMName(String javaName)
Example:
javaNameToVMName("java.lang.Object") = "java/lang/Object"
public static String vmNameToJavaName(String vmName)
Example:
vmNameToJavaName("java/lang/Object") = "java.lang.Object"
public static String signatureToDescriptor(Method method)
Example:
signatureToDescriptor(new Object().getClass().getMethod("equals" ,new Class[0])) = "(Ljava/lang/Object;)Z"
Equivalent to
signatureToDescriptor(method.getParameterTypes (), method.getReturnType ()).
public static String signatureToDescriptor(Class[] parameterTypes, Class returnType)
public static String typeToDescriptor(Class type)
Example:
typeToDescriptor(Object.class) = "Ljava/lang/Object;"
typeToDescriptor(boolean.class) = "Z"
Note the invariant typeToDescriptor(descriptorToType(desc)) == desc.
public static Class descriptorToType(String typedescriptor) throws ClassNotFoundException
Example:
descriptorToType("[[I") = int[][].class
descriptorToType("B") = byte.class
Note the invariant descriptorToType(typeToDescriptor(c)) == c.
public static String[] descriptorToParameterTypes(String methoddescriptor)
public static String signatureToMethodDescriptor(String[] parameterTypeDescriptors, String returnTypeDescriptor)
public static String fullMethodDescriptorToUserName(String classJavaName, String methodName, String methoddescriptor)
Copyright © 2018. All rights reserved.