jdepend.framework
Class AbstractParser

java.lang.Object
  |
  +--jdepend.framework.AbstractParser
Direct Known Subclasses:
JavaClassFileParser, JavaSourceFileParser

public abstract class AbstractParser
extends java.lang.Object

The AbstractParser class is the base class for classes capable of parsing files to create a JavaClass instance.

Author:
Mike Clark, Clarkware Consulting, Inc.

Field Summary
static boolean DEBUG
           
 
Constructor Summary
AbstractParser()
          Constructs an AbstractParser instance with the default package filter.
AbstractParser(PackageFilter filter)
          Constructs an AbstractParser instance with the specified package filter.
 
Method Summary
 void addParseListener(ParserListener listener)
          Registers the specified parser listener.
protected  void debug(java.lang.String message)
           
protected  PackageFilter getFilter()
           
protected  void onParsedJavaClass(JavaClass jClass)
          Informs registered parser listeners that the specified JavaClass was parsed.
abstract  JavaClass parse(java.lang.String filename)
          Parses the specified Java file and returns a representative JavaClass instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static boolean DEBUG
Constructor Detail

AbstractParser

public AbstractParser()
Constructs an AbstractParser instance with the default package filter.

AbstractParser

public AbstractParser(PackageFilter filter)
Constructs an AbstractParser instance with the specified package filter.
Parameters:
filter - Package filter.
Method Detail

addParseListener

public void addParseListener(ParserListener listener)
Registers the specified parser listener.
Parameters:
listener - Parser listener.

parse

public abstract JavaClass parse(java.lang.String filename)
                         throws java.io.IOException
Parses the specified Java file and returns a representative JavaClass instance.

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

Parameters:
filename - Java file name.
Returns:
Java class.
Throws:
java.io.IOException - If the file could not be parsed.

onParsedJavaClass

protected void onParsedJavaClass(JavaClass jClass)
Informs registered parser listeners that the specified JavaClass was parsed.
Parameters:
jClass - Parsed Java class.

getFilter

protected PackageFilter getFilter()

debug

protected void debug(java.lang.String message)


Copyright © 1999-2002 Clarkware Consulting, Inc. All Rights Reserved.