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.
Authors:
Mike Clark (mike@clarkware.com)
Clarkware Consulting, Inc.

Field Summary

static int
ACC_ABSTRACT
static int
ACC_INTERFACE
static char
CLASS_DESCRIPTOR
static int
CONSTANT_CLASS
static int
CONSTANT_DOUBLE
static int
CONSTANT_FIELD
static int
CONSTANT_FLOAT
static int
CONSTANT_INTEGER
static int
CONSTANT_INTERFACEMETHOD
static int
CONSTANT_LONG
static int
CONSTANT_METHOD
static int
CONSTANT_NAMEANDTYPE
static int
CONSTANT_STRING
static int
CONSTANT_UNICODE
static int
CONSTANT_UTF8
static int
JAVA_MAGIC

Fields inherited from class jdepend.framework.AbstractParser

DEBUG

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 void
main(args[] )
Test main.
JavaClass
parse(File classFile)
Parses the specified Java class file and returns a representative JavaClass instance.
JavaClass
parse(InputStream is)
Parses the specified input stream and returns a representative JavaClass instance.
String
toString()
Returns a string representation of this object.

Methods inherited from class jdepend.framework.AbstractParser

addParseListener, debug, getFilter, onParsedJavaClass, parse, setFilter

Field Details

ACC_ABSTRACT

public static final int ACC_ABSTRACT
Field Value:
1024

ACC_INTERFACE

public static final int ACC_INTERFACE
Field Value:
512

CLASS_DESCRIPTOR

public static final char CLASS_DESCRIPTOR
Field Value:
'L'

CONSTANT_CLASS

public static final int CONSTANT_CLASS
Field Value:
7

CONSTANT_DOUBLE

public static final int CONSTANT_DOUBLE
Field Value:
6

CONSTANT_FIELD

public static final int CONSTANT_FIELD
Field Value:
9

CONSTANT_FLOAT

public static final int CONSTANT_FLOAT
Field Value:
4

CONSTANT_INTEGER

public static final int CONSTANT_INTEGER
Field Value:
3

CONSTANT_INTERFACEMETHOD

public static final int CONSTANT_INTERFACEMETHOD
Field Value:
11

CONSTANT_LONG

public static final int CONSTANT_LONG
Field Value:
5

CONSTANT_METHOD

public static final int CONSTANT_METHOD
Field Value:
10

CONSTANT_NAMEANDTYPE

public static final int CONSTANT_NAMEANDTYPE
Field Value:
12

CONSTANT_STRING

public static final int CONSTANT_STRING
Field Value:
8

CONSTANT_UNICODE

public static final int CONSTANT_UNICODE
Field Value:
2

CONSTANT_UTF8

public static final int CONSTANT_UTF8
Field Value:
1

JAVA_MAGIC

public static final int JAVA_MAGIC
Field Value:
-889275714

Constructor Details

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 Details

main

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

parse

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

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

Parameters:
Returns:
Parsed class.

parse

public JavaClass parse(InputStream is)
            throws IOException
Parses the specified input stream and returns a representative JavaClass instance.

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

Overrides:
parse in interface AbstractParser
Parameters:
is - Input stream to parse.
Returns:
Java class.

toString

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

Copyright B) 1999-2003 Clarkware Consulting, Inc.