class AsmUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.util.Map<java.lang.String,java.lang.Class<?>> |
classForDesc |
Constructor and Description |
---|
AsmUtils() |
Modifier and Type | Method and Description |
---|---|
static org.objectweb.asm.tree.InsnList |
createArgumentLoaders(java.lang.String methodDescriptor) |
static org.objectweb.asm.ClassReader |
createClassReader(java.lang.Class<?> clazz) |
static java.lang.Class<?> |
findLoadedClass(java.lang.String className,
java.lang.ClassLoader classLoader)
Returns the class with the given name if it has already been loaded by the given class loader.
|
private static java.lang.reflect.Method |
findMethod(java.lang.Class<?> clazz,
java.lang.String methodName,
java.lang.Class<?>[] argTypes) |
static java.lang.reflect.Constructor |
getClassConstructor(java.lang.String classInternalName,
java.lang.String constructorDesc) |
static java.lang.reflect.Field |
getClassField(java.lang.String classInternalName,
java.lang.String fieldName) |
static java.lang.Class<?> |
getClassForInternalName(java.lang.String classDesc) |
static java.lang.Class<?> |
getClassForType(org.objectweb.asm.Type type) |
static java.lang.reflect.Method |
getClassMethod(java.lang.String classInternalName,
java.lang.String methodName,
java.lang.String methodDesc) |
static java.lang.String |
getExtendedParserClassName(java.lang.String parserClassName) |
static int |
getLoadingOpcode(org.objectweb.asm.Type argType) |
static boolean |
isActionRoot(org.objectweb.asm.tree.AbstractInsnNode insn) |
static boolean |
isActionRoot(java.lang.String methodOwner,
java.lang.String methodName) |
static boolean |
isAssignableTo(java.lang.String classInternalName,
java.lang.Class<?> type)
Determines whether the class with the given descriptor is assignable to the given type.
|
static boolean |
isBooleanValueOfZ(org.objectweb.asm.tree.AbstractInsnNode insn) |
static boolean |
isBooleanValueOfZ(java.lang.String methodOwner,
java.lang.String methodName,
java.lang.String methodDesc) |
static boolean |
isCallOnContextAware(org.objectweb.asm.tree.AbstractInsnNode insn) |
static boolean |
isVarRoot(org.objectweb.asm.tree.AbstractInsnNode insn) |
static boolean |
isVarRoot(java.lang.String methodOwner,
java.lang.String methodName,
java.lang.String methodDesc) |
static java.lang.Class<?> |
loadClass(java.lang.String className,
byte[] code,
java.lang.ClassLoader classLoader)
Loads the class defined with the given name and bytecode using the given class loader.
|
private static final java.util.Map<java.lang.String,java.lang.Class<?>> classForDesc
public static org.objectweb.asm.ClassReader createClassReader(java.lang.Class<?> clazz) throws java.io.IOException
java.io.IOException
public static java.lang.String getExtendedParserClassName(java.lang.String parserClassName)
public static java.lang.Class<?> getClassForInternalName(java.lang.String classDesc)
public static java.lang.Class<?> getClassForType(org.objectweb.asm.Type type)
public static java.lang.reflect.Field getClassField(java.lang.String classInternalName, java.lang.String fieldName)
public static java.lang.reflect.Method getClassMethod(java.lang.String classInternalName, java.lang.String methodName, java.lang.String methodDesc)
private static java.lang.reflect.Method findMethod(java.lang.Class<?> clazz, java.lang.String methodName, java.lang.Class<?>[] argTypes)
public static java.lang.reflect.Constructor getClassConstructor(java.lang.String classInternalName, java.lang.String constructorDesc)
public static java.lang.Class<?> findLoadedClass(java.lang.String className, java.lang.ClassLoader classLoader)
className
- the full name of the class to be loadedclassLoader
- the class loader to usepublic static java.lang.Class<?> loadClass(java.lang.String className, byte[] code, java.lang.ClassLoader classLoader)
className
- the full name of the class to be loadedcode
- the bytecode of the class to loadclassLoader
- the class loader to usepublic static org.objectweb.asm.tree.InsnList createArgumentLoaders(java.lang.String methodDescriptor)
public static int getLoadingOpcode(org.objectweb.asm.Type argType)
public static boolean isAssignableTo(java.lang.String classInternalName, java.lang.Class<?> type)
classInternalName
- the class descriptortype
- the typepublic static boolean isBooleanValueOfZ(org.objectweb.asm.tree.AbstractInsnNode insn)
public static boolean isBooleanValueOfZ(java.lang.String methodOwner, java.lang.String methodName, java.lang.String methodDesc)
public static boolean isActionRoot(org.objectweb.asm.tree.AbstractInsnNode insn)
public static boolean isActionRoot(java.lang.String methodOwner, java.lang.String methodName)
public static boolean isVarRoot(org.objectweb.asm.tree.AbstractInsnNode insn)
public static boolean isVarRoot(java.lang.String methodOwner, java.lang.String methodName, java.lang.String methodDesc)
public static boolean isCallOnContextAware(org.objectweb.asm.tree.AbstractInsnNode insn)