at.davinci.util
Class ClassReader

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.ByteArrayInputStream
          extended by at.davinci.util.ClassReader
All Implemented Interfaces:
java.io.Closeable
Direct Known Subclasses:
ParamReader

public class ClassReader
extends java.io.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.

---------------------------------------------------------------------- Borrowed for DaVinci from the Axis Project, Apache Software Foundation ----------------------------------------------------------------------

Author:
Edwin Smith, Macromedia

Method Summary
static byte[] getBytes(java.lang.Class c)
          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.
 void readCode()
          read a code attribute
 
Methods inherited from class java.io.ByteArrayInputStream
available, close, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.io.InputStream
read
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBytes

public static byte[] getBytes(java.lang.Class c)
                       throws java.io.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.

Parameters:
c - the class of interest
Returns:
a byte array containing the bytecode
Throws:
java.io.IOException

readCode

public void readCode()
              throws java.io.IOException
read a code attribute

Throws:
java.io.IOException