public class Utils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
asString(org.objectweb.asm.tree.MethodNode method) |
static org.objectweb.asm.ClassReader |
getClassReaderFromResource(java.lang.String internalClassName,
java.net.URL resource) |
static java.net.URL |
getClassResource(java.lang.ClassLoader loader,
java.lang.String internalClassName) |
static java.net.URL |
getClassResource(java.lang.ClassLoader loader,
org.objectweb.asm.Type type) |
static java.lang.String |
getClassResourceName(java.lang.Class<?> clazz) |
static java.lang.String |
getClassResourceName(java.lang.String internalName) |
static int |
getFirstLocal(int access,
org.objectweb.asm.commons.Method method)
Returns the index of the first local variable of a method after the "special" local variables like 'this' and the
method arguments.
|
static boolean |
isJdkProxy(byte[] classBytes)
This is here for testing.
|
static boolean |
isJdkProxy(org.objectweb.asm.ClassReader reader)
Returns true if the input class bytes are those of a proxy.
|
static boolean |
isPrimitiveType(java.lang.String type)
Returns true if the given type is a java primitive.
|
static void |
print(byte[] bytes) |
static void |
print(byte[] bytes,
java.io.PrintWriter pw) |
static org.objectweb.asm.ClassReader |
readClass(java.lang.Class<?> theClass)
Returns a ClassReader for the given class by trying to load the bytes of the class through its classloader.
|
static org.objectweb.asm.ClassReader |
readClass(java.lang.ClassLoader loader,
java.lang.String internalClassName) |
public static boolean isJdkProxy(byte[] classBytes)
classBytes - The bytes for the class.public static boolean isJdkProxy(org.objectweb.asm.ClassReader reader)
reader - Reader with the bytes.public static org.objectweb.asm.ClassReader readClass(java.lang.Class<?> theClass)
throws java.io.IOException,
BenignClassReadException
java.io.IOExceptionBenignClassReadExceptionpublic static org.objectweb.asm.ClassReader readClass(java.lang.ClassLoader loader,
java.lang.String internalClassName)
throws java.io.IOException
java.io.IOExceptionpublic static org.objectweb.asm.ClassReader getClassReaderFromResource(java.lang.String internalClassName,
java.net.URL resource)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String getClassResourceName(java.lang.String internalName)
public static java.lang.String getClassResourceName(java.lang.Class<?> clazz)
public static java.net.URL getClassResource(java.lang.ClassLoader loader,
org.objectweb.asm.Type type)
public static java.net.URL getClassResource(java.lang.ClassLoader loader,
java.lang.String internalClassName)
public static void print(byte[] bytes)
public static java.lang.String asString(org.objectweb.asm.tree.MethodNode method)
public static void print(byte[] bytes,
java.io.PrintWriter pw)
public static boolean isPrimitiveType(java.lang.String type)
public static int getFirstLocal(int access,
org.objectweb.asm.commons.Method method)