de.hunsicker.jalopy.language
Class CodeInspector

java.lang.Object
  |
  +--de.hunsicker.jalopy.language.TreeWalker
        |
        +--de.hunsicker.jalopy.language.CodeInspector

public final class CodeInspector
extends TreeWalker

Inspects a Java parse tree for convention violations and possible code weaknesses.

Since:
1.0b8
Version:
$Revision: 1.5.2.6 $
Author:
Marco Hunsicker

Field Summary
protected  java.lang.String[] _args
          Helper array used to store the arguments for the message formatter.
protected static Convention _settings
          The code convention.
 
Fields inherited from class de.hunsicker.jalopy.language.TreeWalker
stop
 
Constructor Summary
CodeInspector(java.util.Map issues)
          Creates a new CodeInspector object.
 
Method Summary
protected  void addIssue(antlr.collections.AST node, java.lang.String resourceKey, java.lang.Object[] args)
          Adds the given rule message for the given node.
 void inspect(antlr.collections.AST tree, java.io.File file)
          Inspects the given Java parse tree for code convention violations and coding weaknesses.
 void visit(antlr.collections.AST node)
          Callback method that can be called for a node found. Overwrite to perform whatever action you want take place for a node.

In the default implementation, this method will be called for every node of the tree.

 
Methods inherited from class de.hunsicker.jalopy.language.TreeWalker
reset, stop, walk, walkChildren, walkNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_settings

protected static final Convention _settings
The code convention.


_args

protected final java.lang.String[] _args
Helper array used to store the arguments for the message formatter.

Constructor Detail

CodeInspector

public CodeInspector(java.util.Map issues)
Creates a new CodeInspector object.

Parameters:
issues - map to hold the found issues.
Method Detail

inspect

public void inspect(antlr.collections.AST tree,
                    java.io.File file)
Inspects the given Java parse tree for code convention violations and coding weaknesses.

Parameters:
tree - root node of the parse tree.
file - the file that is inspected.

visit

public void visit(antlr.collections.AST node)
Callback method that can be called for a node found. Overwrite to perform whatever action you want take place for a node.

In the default implementation, this method will be called for every node of the tree.

Specified by:
visit in class TreeWalker
Parameters:
node - a node of the tree.

addIssue

protected void addIssue(antlr.collections.AST node,
                        java.lang.String resourceKey,
                        java.lang.Object[] args)
Adds the given rule message for the given node.

Parameters:
node - node to add a tip for.
resourceKey - resource key of the rule.
args - the arguments for message formatting.


Copyright © 1997-2005 Jalopy. All Rights Reserved.