Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.axis2.description.java2wsdl.bytecode
Class ClassReader

    java.lang.Object
      java.io.InputStream
          java.io.ByteArrayInputStream
              org.apache.axis2.description.java2wsdl.bytecode.ClassReader

All Implemented Interfaces:
  Closeable

Direct Known Subclasses:
  ParamReader

    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.

Field Summary

Fields inherited from class java.io.ByteArrayInputStream
`buf, count, mark, pos`

Constructor Summary
`protected` | `ClassReader(byte[] buf, Map attrMethods)`

Method Summary
`protected static Map` | `findAttributeReaders(Class c)`
`protected static byte[]` | `getBytes(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 String` | `getSignature(Member method, 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 Class` | `resolveClass(int i)`
`protected Field` | `resolveField(int i)`
`protected Member` | `resolveMethod(int index)`
`protected org.apache.axis2.description.java2wsdl.bytecode.ClassReader.NameAndType` | `resolveNameAndType(int i)`
`protected String` | `resolveUtf8(int i)`
`protected void` | `skipAttributes()`
`protected void` | `skipFully(int n)` Skips n bytes in the input stream.

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
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ClassReader

    protected ClassReader(byte[] buf,
                          Map attrMethods)

Method Detail

### getBytes

    protected static byte[] getBytes(Class c)
                              throws IOException

  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.

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

### findAttributeReaders

    protected static Map findAttributeReaders(Class c)

### getSignature

    protected static String getSignature(Member method,
                                         Class[] paramTypes)

### readShort

    protected final int readShort()

  Returns:
    Returns the next unsigned 16 bit value.

### readInt

    protected final int readInt()

  Returns:
    Returns the next signed 32 bit value.

### skipFully

    protected void skipFully(int n)
                      throws IOException

  Skips n bytes in the input stream.

  Throws:
    `IOException`

### resolveMethod

    protected final Member resolveMethod(int index)
                                  throws IOException,
                                         ClassNotFoundException,
                                         NoSuchMethodException

  Throws:
    `IOException`
    `ClassNotFoundException`
    `NoSuchMethodException`

### resolveField

    protected final Field resolveField(int i)
                                throws IOException,
                                       ClassNotFoundException,
                                       NoSuchFieldException

  Throws:
    `IOException`
    `ClassNotFoundException`
    `NoSuchFieldException`

### resolveNameAndType

    protected final org.apache.axis2.description.java2wsdl.bytecode.ClassReader.NameAndType resolveNameAndType(int i)
                                                                                                        throws IOException

  Throws:
    `IOException`

### resolveClass

    protected final Class resolveClass(int i)
                                throws IOException,
                                       ClassNotFoundException

  Throws:
    `IOException`
    `ClassNotFoundException`

### resolveUtf8

    protected final String resolveUtf8(int i)
                                throws IOException

  Throws:
    `IOException`

### readCpool

    protected final void readCpool()
                            throws IOException

  Throws:
    `IOException`

### skipAttributes

    protected final void skipAttributes()
                                 throws IOException

  Throws:
    `IOException`

### readAttributes

    protected final void readAttributes()
                                 throws IOException

  Reads 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.

  Throws:
    `IOException`

### readCode

    public void readCode()
                  throws IOException

  Reads a code attribute.

  Throws:
    `IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2011 The Apache Software Foundation. All Rights Reserved.