jreversepro.parser
Class JClassParser

java.lang.Object
  extended by jreversepro.parser.JClassParser
All Implemented Interfaces:
AppConstants

public class JClassParser
extends java.lang.Object
implements AppConstants

Author:
Karthik Kumar

Field Summary
 
Fields inherited from interface jreversepro.common.AppConstants
DECOMPILE_FLAG, FONT, GPL_INFO, L_AND_F, MAGIC, PROP_FILE, PROP_HEADING, TITLE, VERSION, XPOS, XSIZE, YPOS, YSIZE
 
Constructor Summary
JClassParser()
           
 
Method Summary
 JClassInfo getClassInfo()
           
 JConstantPool getCpInfo()
           
 void parse(byte[] bytes)
          Parses the given byte array and creates the ClassInfo and ConstantPool objects.
 void parse(java.io.ByteArrayInputStream is, java.lang.String pathToClass)
          Parses the given file and creates the ClassInfo and ConstantPool objects.
 void parse(java.io.File aFile)
          Parses the given file and creates the ClassInfo and ConstantPool objects.
 void parse(java.io.InputStream is, int length, java.lang.String pathToClass)
          Parses the given file and creates the ClassInfo and ConstantPool objects.
 void parse(java.net.URL url)
          Parses a class file at the other side of a URL and creates the ClassInfo and ConstantPool objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JClassParser

public JClassParser()
Method Detail

parse

public void parse(byte[] bytes)
           throws java.io.IOException,
                  ClassParserException
Parses the given byte array and creates the ClassInfo and ConstantPool objects.

Parameters:
bytes - byte array to be parsed.
Throws:
ClassParserException - Thrown if class file not in desired format.
java.io.IOException - Thrown if error in stream of bytes containing the class file.

parse

public void parse(java.net.URL url)
           throws java.io.IOException,
                  ClassParserException
Parses a class file at the other side of a URL and creates the ClassInfo and ConstantPool objects.

Parameters:
url - a url pointing to a class file to be parsed.
Throws:
ClassParserException - Thrown if class file not in desired format.
java.io.IOException - Thrown if error in stream of bytes containing the class file.

parse

public void parse(java.io.File aFile)
           throws java.io.IOException,
                  ClassParserException
Parses the given file and creates the ClassInfo and ConstantPool objects.

Parameters:
aFile - class file to be parsed.
Throws:
ClassParserException - Thrown if class file not in desired format.
java.io.IOException - Thrown if error in stream of bytes containing the class file.

parse

public void parse(java.io.InputStream is,
                  int length,
                  java.lang.String pathToClass)
           throws java.io.IOException,
                  ClassParserException
Parses the given file and creates the ClassInfo and ConstantPool objects.

Parameters:
is - InputStream from which bytes are taken.
length - Length of the bytecode stream.
pathToClass - path to class.
Throws:
ClassParserException - Thrown if class file not in desired format.
java.io.IOException - Thrown if error in stream of bytes containing the class file.

parse

public void parse(java.io.ByteArrayInputStream is,
                  java.lang.String pathToClass)
           throws java.io.IOException,
                  ClassParserException
Parses the given file and creates the ClassInfo and ConstantPool objects.

Parameters:
is - InputStream containing the bytes.
pathToClass - path to the class.
Throws:
ClassParserException - Thrown if class file not in desired format.
java.io.IOException - Thrown if error in stream of bytes containing the class file.

getCpInfo

public final JConstantPool getCpInfo()
Returns:
Returns the ConstantPool Information of the class.

getClassInfo

public final JClassInfo getClassInfo()
Returns:
Returns the data Information of the class.


Submit Feedback to akkumar@users.sourceforge.net