org.objectweb.asm
Class ClassReader

java.lang.Object
  |
  +--org.objectweb.asm.ClassReader

public class ClassReader
extends Object

A Java class parser to make a ClassVisitor visit an existing class. This class parses a byte array conforming to the Java class file format and calls the appropriate visit methods of a given class visitor for each field, method and bytecode instruction encountered.


Constructor Summary
ClassReader(byte[] b)
          Constructs a new ClassReader object.
ClassReader(InputStream is)
          Constructs a new ClassReader object.
ClassReader(String name)
          Constructs a new ClassReader object.
 
Method Summary
 void accept(ClassVisitor classVisitor, boolean skipDebug)
          Makes the given visitor visit the Java class of this ClassReader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassReader

public ClassReader(byte[] b)
Constructs a new ClassReader object.
Parameters:
b - the bytecode of the class to be read.

ClassReader

public ClassReader(InputStream is)
            throws IOException
Constructs a new ClassReader object.
Parameters:
is - an input stream from which to read the class.
Throws:
IOException - if a problem occurs during reading.

ClassReader

public ClassReader(String name)
            throws IOException
Constructs a new ClassReader object.
Parameters:
name - the fully qualified name of the class to be read.
Throws:
IOException - if an exception occurs during reading.
Method Detail

accept

public void accept(ClassVisitor classVisitor,
                   boolean skipDebug)
Makes the given visitor visit the Java class of this ClassReader. This class is the one specified in the constructor (see ClassReader).
Parameters:
classVisitor - the visitor that must visit this class.
skipDebug - true if the debug information of the class must not be visited. In this case the visitLocalVariable and CodeVisitor.visitLineNumber(int, org.objectweb.asm.Label) methods will not be called.