public abstract class AbstractAstVisitorRule extends AbstractRule
Abstract superclass for Rules that use a Groovy AST Visitor.
Each subclass must set theastVisitorClass
property or else define a new
property with the same name, specifying the Class of the AstVisitor
to applied to the specified source code.
Modifiers | Name | Description |
---|---|---|
static java.lang.String |
CLOSURE_TEXT |
|
protected static java.lang.String |
DEFAULT_CONST_NAME |
|
protected static java.lang.String |
DEFAULT_FIELD_NAME |
|
protected static java.lang.String |
DEFAULT_TEST_CLASS_NAMES |
|
protected static java.lang.String |
DEFAULT_TEST_FILES |
|
protected static java.lang.String |
DEFAULT_VAR_NAME |
Type Params | Return Type | Name and description |
---|---|---|
|
public void |
applyTo(SourceCode sourceCode, java.util.List<Violation> violations) |
|
public int |
compare(Violation o1, Violation o2) |
|
public java.lang.String |
getApplyToClassNames() |
|
public AstVisitor |
getAstVisitor() |
|
protected java.lang.Class |
getAstVisitorClass() Each concrete subclass must either set this property or define its own property with the same name |
|
public java.lang.String |
getDoNotApplyToClassNames() |
|
public void |
setApplyToClassNames(java.lang.String applyToClassNames) |
|
public void |
setDoNotApplyToClassNames(java.lang.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 | Name |
---|---|
class AbstractRule |
applyTo, applyTo, createViolation, createViolation, createViolationForImport, createViolationForImport, getApplyToFileNames, getApplyToFilesMatching, getCompilerPhase, getDescription, getDoNotApplyToFileNames, getDoNotApplyToFilesMatching, getName, getPriority, getViolationMessage, isEnabled, isReady, setApplyToFileNames, setApplyToFilesMatching, setDescription, setDoNotApplyToFileNames, setDoNotApplyToFilesMatching, setEnabled, setName, setPriority, setViolationMessage, toString, validate |
Each concrete subclass must either set this property or define its own property with the same name
Return true if this rule should be applied for the specified ClassNode, based on the configuration of this rule.
classNode
- - the ClassNode