com.appperfect.codeanalyzer.engine.rules
Interface IRule

All Known Subinterfaces:
IConfigurableRule

public interface IRule

The implementaion of this interface represents a Code Analyzer rule. Each system rule implements this interface, similarly one should implement this interface for writing a custom rule. If the rule requies to be configurable one should implement it's sub interface com.appperfect.codeanalyzer.engine.rules.IConfigurableRule

Version:
6.0
Author:
AppPerfect Corporation.

Method Summary
 void evaluate(org.eclipse.jdt.core.dom.ASTNode node, com.appperfect.codeanalyzer.engine.rules.IViolationListener vl)
          The engine notifies the rule through this method when one of the specified node types is encountered.
 int[] getASTNodeTypes()
          A rule specifies the type of nodes it is interested in through this method.
 void reset()
          This method is called before each call to evaluate.
 

Method Detail

getASTNodeTypes

public int[] getASTNodeTypes()
A rule specifies the type of nodes it is interested in through this method. The engine notifies this rule whenever it encounters a node of any of these types while traversing the AST.

Returns:
the int array should contain the node type constants defined by org.eclipse.jdt.core.dom.ASTNode.

evaluate

public void evaluate(org.eclipse.jdt.core.dom.ASTNode node,
                     com.appperfect.codeanalyzer.engine.rules.IViolationListener vl)
The engine notifies the rule through this method when one of the specified node types is encountered. This method gets invoked for each node of any of the types this rule is interested in, is encountered by rule engine during traversal of AST.

Parameters:
node - the node that was found during traversal.
vl - the rule may report a violation by calling violationFound(ASTNode) on this object.

reset

public void reset()
This method is called before each call to evaluate. For performance reasons, a rule class may use class variables instead of local variables. Those fields should be reset to its default value in this method