public class ClassReader extends java.io.ByteArrayInputStream
This does not work for inherited methods. To obtain parameter names for inherited methods, you must use a paramReader for the class that originally declared the method.
don't get tricky, it's the bare minimum. Instances of this class are not threadsafe -- don't share them.
| Modifier | Constructor and Description |
|---|---|
protected |
ClassReader(byte[] buf,
java.util.Map attrMethods) |
| Modifier and Type | Method and Description |
|---|---|
protected static java.util.Map |
findAttributeReaders(java.lang.Class c) |
protected static byte[] |
getBytes(java.lang.Class c)
Loads the bytecode for a given class, by using the class's defining
classloader and assuming that for a class named P.C, the bytecodes are
in a resource named /P/C.class.
|
protected static java.lang.String |
getSignature(java.lang.reflect.Member method,
java.lang.Class[] paramTypes) |
protected void |
readAttributes()
Reads an attributes array.
|
void |
readCode()
Reads a code attribute.
|
protected void |
readCpool() |
protected int |
readInt() |
protected int |
readShort() |
protected java.lang.Class |
resolveClass(int i) |
protected java.lang.reflect.Field |
resolveField(int i) |
protected java.lang.reflect.Member |
resolveMethod(int index) |
protected org.apache.bytecode.ClassReader.NameAndType |
resolveNameAndType(int i) |
protected java.lang.String |
resolveUtf8(int i) |
protected void |
skipAttributes() |
protected void |
skipFully(int n)
Skips n bytes in the input stream.
|
protected ClassReader(byte[] buf, java.util.Map attrMethods)
protected static byte[] getBytes(java.lang.Class c) throws java.io.IOException
c - the class of interestjava.io.IOExceptionprotected static java.util.Map findAttributeReaders(java.lang.Class c)
protected static java.lang.String getSignature(java.lang.reflect.Member method, java.lang.Class[] paramTypes)
protected final int readShort()
protected final int readInt()
protected void skipFully(int n) throws java.io.IOException
java.io.IOExceptionprotected final java.lang.reflect.Member resolveMethod(int index) throws java.io.IOException, java.lang.ClassNotFoundException, java.lang.NoSuchMethodException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionjava.lang.NoSuchMethodExceptionprotected final java.lang.reflect.Field resolveField(int i) throws java.io.IOException, java.lang.ClassNotFoundException, java.lang.NoSuchFieldException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionjava.lang.NoSuchFieldExceptionprotected final org.apache.bytecode.ClassReader.NameAndType resolveNameAndType(int i) throws java.io.IOException
java.io.IOExceptionprotected final java.lang.Class resolveClass(int i) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionprotected final java.lang.String resolveUtf8(int i) throws java.io.IOException
java.io.IOExceptionprotected final void readCpool() throws java.io.IOException
java.io.IOExceptionprotected final void skipAttributes() throws java.io.IOException
java.io.IOExceptionprotected final void readAttributes() throws java.io.IOException
java.io.IOExceptionpublic void readCode() throws java.io.IOException
java.io.IOExceptionCopyright © 2019. All rights reserved.