All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class de.fub.bytecode.classfile.ClassParser

java.lang.Object
   |
   +----de.fub.bytecode.classfile.ClassParser

public final class ClassParser
extends Object
implements Constants
Wrapper class that parses a given Java .class file. The method parse returns a JavaClass object on success. When an I/O error or an inconsistency occurs an appropiate exception is propagated back to the caller. The structure and the names comply, except for a few conveniences, exactly with the JVM specification 1.0. See this paper for further details about the structure of a bytecode file.

Version:
$Id: ClassParser.java,v 1.7 1999/11/04 12:22:25 dahm Exp $
Author:
M. Dahm

Constructor Index

 o ClassParser(InputStream, String)
Parse class from the given stream.
 o ClassParser(String)
Parse class from given .class file.
 o ClassParser(String, String)
Parse class from given .class file in a ZIP-archive

Method Index

 o parse()
Parse the given Java class file and return an object that represents the contained data, i.e.

Constructors

 o ClassParser
 public ClassParser(InputStream file,
                    String file_name)
Parse class from the given stream.

Parameters:
file - Input stream
file_name - File name
 o ClassParser
 public ClassParser(String file_name) throws IOException
Parse class from given .class file.

Parameters:
file_name - file name
 o ClassParser
 public ClassParser(String zip_file,
                    String file_name) throws IOException
Parse class from given .class file in a ZIP-archive

Parameters:
file_name - file name

Methods

 o parse
 public JavaClass parse() throws IOException, ClassFormatError
Parse the given Java class file and return an object that represents the contained data, i.e. constants, methods, fields and commands. A ClassFormatError is raised, if the file is not a valid .class file. (This does not include verification of the byte code as it is performed by the java interpreter).

Returns:
Class object representing the parsed class file

All Packages  Class Hierarchy  This Package  Previous  Next  Index