org.apache.axis.utils.bytecode
Class ClassReader
ByteArrayInputStream
org.apache.axis.utils.bytecode.ClassReader
public class ClassReader
extends ByteArrayInputStream
This is the class file reader for obtaining the parameter names
for declared methods in a class. The class must have debugging
attributes for us to obtain this information.
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.
ClassReader
protected ClassReader(buf[] ,
Map attrMethods)
findAttributeReaders
protected static Map findAttributeReaders(Class c)
getBytes
protected static byte[] getBytes(Class c)
throws IOException
load 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.
c
- the class of interest
- a byte array containing the bytecode
getSignature
protected static String getSignature(Member method,
Class[] paramTypes)
readAttributes
protected final void readAttributes()
throws IOException
read an attributes array. the elements of a class file that
can contain attributes are: fields, methods, the class itself,
and some other types of attributes.
readCode
public void readCode()
throws IOException
read a code attribute
readCpool
protected final void readCpool()
throws IOException
readInt
protected final int readInt()
- the next signed 32 bit value
readShort
protected final int readShort()
- the next unsigned 16 bit value
resolveClass
protected final Class resolveClass(int i)
throws IOException,
ClassNotFoundException
resolveField
protected final Field resolveField(int i)
throws IOException,
ClassNotFoundException,
NoSuchFieldException
resolveMethod
protected final Member resolveMethod(int index)
throws IOException,
ClassNotFoundException,
NoSuchMethodException
resolveNameAndType
protected final org.apache.axis.utils.bytecode.ClassReader.NameAndType resolveNameAndType(int i)
throws IOException
resolveUtf8
protected final String resolveUtf8(int i)
throws IOException
skipAttributes
protected final void skipAttributes()
throws IOException
skipFully
protected void skipFully(int n)
throws IOException
skip n bytes in the input stream.
Copyright B) 2005 Apache Web Services Project. All Rights Reserved.