Groovy Documentation

java.org.codenarc.rule
[Java] Class AbstractAstVisitorRule

java.lang.Object
  java.org.codenarc.rule.AbstractRule
      java.org.codenarc.rule.AbstractAstVisitorRule

public abstract class AbstractAstVisitorRule
extends AbstractRule

Abstract superclass for Rules that use a Groovy AST Visitor.

Each subclass must set the astVisitorClass property or else define a new property with the same name, specifying the Class of the AstVisitor to applied to the specified source code.

Authors:
Chris Mair
Hamlet D'Arcy


Field Summary
protected static String DEFAULT_CONST_NAME

protected static String DEFAULT_FIELD_NAME

protected static String DEFAULT_TEST_CLASS_NAMES

protected static String DEFAULT_TEST_FILES

protected static String DEFAULT_VAR_NAME

 
Method Summary
void applyTo(SourceCode sourceCode, List violations)

String getApplyToClassNames()

AstVisitor getAstVisitor()

protected Class getAstVisitorClass()

Each concrete subclass must either set this property or define its own property with the same name

String getDoNotApplyToClassNames()

void setApplyToClassNames(String applyToClassNames)

void setDoNotApplyToClassNames(String doNotApplyToClassNames)

protected boolean shouldApplyThisRuleTo(org.codehaus.groovy.ast.ClassNode classNode)

Return true if this rule should be applied for the specified ClassNode, based on the configuration of this rule.

 
Methods inherited from class AbstractRule
applyTo, applyTo, createViolation, createViolation, createViolation, createViolation, createViolation, createViolationForImport, createViolationForImport, createViolationForImport, getApplyToFileNames, getApplyToFilesMatching, getDescription, getDoNotApplyToFileNames, getDoNotApplyToFilesMatching, getName, getPriority, getViolationMessage, isEnabled, isReady, setApplyToFileNames, setApplyToFilesMatching, setDescription, setDoNotApplyToFileNames, setDoNotApplyToFilesMatching, setEnabled, setName, setPriority, setViolationMessage, toString, validate
 

Field Detail

DEFAULT_CONST_NAME

protected static final String DEFAULT_CONST_NAME


DEFAULT_FIELD_NAME

protected static final String DEFAULT_FIELD_NAME


DEFAULT_TEST_CLASS_NAMES

protected static final String DEFAULT_TEST_CLASS_NAMES


DEFAULT_TEST_FILES

protected static final String DEFAULT_TEST_FILES


DEFAULT_VAR_NAME

protected static final String DEFAULT_VAR_NAME


 
Method Detail

applyTo

@Override
public void applyTo(SourceCode sourceCode, List violations)


getApplyToClassNames

public String getApplyToClassNames()


getAstVisitor

public AstVisitor getAstVisitor()


getAstVisitorClass

protected Class getAstVisitorClass()
Each concrete subclass must either set this property or define its own property with the same name


getDoNotApplyToClassNames

public String getDoNotApplyToClassNames()


setApplyToClassNames

public void setApplyToClassNames(String applyToClassNames)


setDoNotApplyToClassNames

public void setDoNotApplyToClassNames(String doNotApplyToClassNames)


shouldApplyThisRuleTo

protected boolean shouldApplyThisRuleTo(org.codehaus.groovy.ast.ClassNode classNode)
Return true if this rule should be applied for the specified ClassNode, based on the configuration of this rule.
Parameters:
classNode - - the ClassNode
Returns:
true if this rule should be applied for the specified ClassNode


 

Groovy Documentation