jdepend.framework

Class ClassFileParser

public class ClassFileParser extends AbstractParser

The ClassFileParser class is responsible for parsing a Java class file to create a JavaClass instance.

Author: Mike Clark (mike@clarkware.com) Clarkware Consulting, Inc.

Field Summary
static intACC_ABSTRACT
static intACC_INTERFACE
static charCLASS_DESCRIPTOR
static intCONSTANT_CLASS
static intCONSTANT_DOUBLE
static intCONSTANT_FIELD
static intCONSTANT_FLOAT
static intCONSTANT_INTEGER
static intCONSTANT_INTERFACEMETHOD
static intCONSTANT_LONG
static intCONSTANT_METHOD
static intCONSTANT_NAMEANDTYPE
static intCONSTANT_STRING
static intCONSTANT_UNICODE
static intCONSTANT_UTF8
static intJAVA_MAGIC
Constructor Summary
ClassFileParser()
Constructs a JavaClassFileParser instance with the default package filter.
ClassFileParser(PackageFilter filter)
Constructs a JavaClassFileParser instance with the specified package filter.
Method Summary
static voidmain(String[] args)
Test main.
JavaClassparse(File classFile)
Parses the specified Java class file and returns a representative JavaClass instance.
JavaClassparse(InputStream is)
StringtoString()
Returns a string representation of this object.

Field Detail

ACC_ABSTRACT

public static final int ACC_ABSTRACT

ACC_INTERFACE

public static final int ACC_INTERFACE

CLASS_DESCRIPTOR

public static final char CLASS_DESCRIPTOR

CONSTANT_CLASS

public static final int CONSTANT_CLASS

CONSTANT_DOUBLE

public static final int CONSTANT_DOUBLE

CONSTANT_FIELD

public static final int CONSTANT_FIELD

CONSTANT_FLOAT

public static final int CONSTANT_FLOAT

CONSTANT_INTEGER

public static final int CONSTANT_INTEGER

CONSTANT_INTERFACEMETHOD

public static final int CONSTANT_INTERFACEMETHOD

CONSTANT_LONG

public static final int CONSTANT_LONG

CONSTANT_METHOD

public static final int CONSTANT_METHOD

CONSTANT_NAMEANDTYPE

public static final int CONSTANT_NAMEANDTYPE

CONSTANT_STRING

public static final int CONSTANT_STRING

CONSTANT_UNICODE

public static final int CONSTANT_UNICODE

CONSTANT_UTF8

public static final int CONSTANT_UTF8

JAVA_MAGIC

public static final int JAVA_MAGIC

Constructor Detail

ClassFileParser

public ClassFileParser()
Constructs a JavaClassFileParser instance with the default package filter.

ClassFileParser

public ClassFileParser(PackageFilter filter)
Constructs a JavaClassFileParser instance with the specified package filter.

Parameters: filter Package filter.

Method Detail

main

public static void main(String[] args)
Test main.

parse

public JavaClass parse(File classFile)
Parses the specified Java class file and returns a representative JavaClass instance.

Registered parser listeners are informed that the resulting JavaClass was parsed.

Parameters: fileName Java class file name.

Returns: Parsed class.

Throws: IOException If the file could not be parsed.

parse

public JavaClass parse(InputStream is)

toString

public String toString()
Returns a string representation of this object.

Returns: String representation.

Copyright B) 1999-2003 Clarkware Consulting, Inc.