| java.lang.Object net.sf.retrotranslator.runtime.asm.ClassReader
ClassReader | public class ClassReader (Code) | | 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.
author: Eric Bruneton author: Eugene Kuleshov |
Field Summary | |
final public byte[] | b The class to be parsed. | final public int | header Start index of the class header information (access, name...) in
ClassReader.b b . |
b | final public byte[] b(Code) | | The class to be parsed. The content of this array must not be
modified. This field is intended for
Attribute sub classes, and
is normally not needed by class generators or adapters.
|
header | final public int header(Code) | | Start index of the class header information (access, name...) in
ClassReader.b b .
|
ClassReader | public ClassReader(byte[] b)(Code) | | Constructs a new
ClassReader object.
Parameters: b - the bytecode of the class to be read. |
ClassReader | public ClassReader(byte[] b, int off, int len)(Code) | | Constructs a new
ClassReader object.
Parameters: b - the bytecode of the class to be read. Parameters: off - the start offset of the class data. Parameters: len - the length of the class data. |
ClassReader | public ClassReader(String name) throws IOException(Code) | | 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. |
accept | public void accept(ClassVisitor classVisitor, Attribute[] attrs, boolean skipDebug)(Code) | | Makes the given visitor visit the Java class of this
ClassReader .
This class is the one specified in the constructor (see
ClassReader.ClassReader(byte[]) ClassReader ).
Parameters: classVisitor - the visitor that must visit this class. Parameters: attrs - prototypes of the attributes that must be parsed during thevisit of the class. Any attribute whose type is not equal to thetype of one the prototypes will be ignored. Parameters: skipDebug - true if the debug information of the classmust not be visited. In this case theMethodVisitor.visitLocalVariable visitLocalVariable andMethodVisitor.visitLineNumber visitLineNumber methods willnot be called. |
getItem | public int getItem(int item)(Code) | | Returns the start index of the constant pool item in
ClassReader.b b , plus
one. This method is intended for
Attribute sub classes, and is
normally not needed by class generators or adapters.
Parameters: item - the index a constant pool item. the start index of the constant pool item in ClassReader.b b, plusone. |
readByte | public int readByte(int index)(Code) | | Reads a byte value in
ClassReader.b b . This method is intended for
Attribute sub classes, and is normally not needed by class
generators or adapters.
Parameters: index - the start index of the value to be read in ClassReader.b b. the read value. |
readClass | public String readClass(int index, char[] buf)(Code) | | Reads a class constant pool item in
ClassReader.b b . This method is
intended for
Attribute sub classes, and is normally not needed by
class generators or adapters.
Parameters: index - the start index of an unsigned short value in ClassReader.b b,whose value is the index of a class constant pool item. Parameters: buf - buffer to be used to read the item. This buffer must besufficiently large. It is not automatically resized. the String corresponding to the specified class item. |
readConst | public Object readConst(int item, char[] buf)(Code) | | Reads a numeric or string constant pool item in
ClassReader.b b . This
method is intended for
Attribute sub classes, and is normally not
needed by class generators or adapters.
Parameters: item - the index of a constant pool item. Parameters: buf - buffer to be used to read the item. This buffer must besufficiently large. It is not automatically resized. the Integer, Float, Long,Double, String or Type corresponding tothe given constant pool item. |
readInt | public int readInt(int index)(Code) | | Reads a signed int value in
ClassReader.b b . This method is intended for
Attribute sub classes, and is normally not needed by class
generators or adapters.
Parameters: index - the start index of the value to be read in ClassReader.b b. the read value. |
readLong | public long readLong(int index)(Code) | | Reads a signed long value in
ClassReader.b b . This method is intended
for
Attribute sub classes, and is normally not needed by class
generators or adapters.
Parameters: index - the start index of the value to be read in ClassReader.b b. the read value. |
readShort | public short readShort(int index)(Code) | | Reads a signed short value in
ClassReader.b b . This method is intended
for
Attribute sub classes, and is normally not needed by class
generators or adapters.
Parameters: index - the start index of the value to be read in ClassReader.b b. the read value. |
readUTF8 | public String readUTF8(int index, char[] buf)(Code) | | Reads an UTF8 string constant pool item in
ClassReader.b b . This method
is intended for
Attribute sub classes, and is normally not needed
by class generators or adapters.
Parameters: index - the start index of an unsigned short value in ClassReader.b b,whose value is the index of an UTF8 constant pool item. Parameters: buf - buffer to be used to read the item. This buffer must besufficiently large. It is not automatically resized. the String corresponding to the specified UTF8 item. |
readUnsignedShort | public int readUnsignedShort(int index)(Code) | | Reads an unsigned short value in
ClassReader.b b . This method is
intended for
Attribute sub classes, and is normally not needed by
class generators or adapters.
Parameters: index - the start index of the value to be read in ClassReader.b b. the read value. |
|
|