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 | Name and description |
---|---|
java.lang.String |
applyToClassNames |
java.lang.String |
doNotApplyToClassNames |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
applyTo(SourceCode sourceCode, java.util.List<Violation> violations) |
|
java.lang.String |
getApplyToClassNames() |
|
AstVisitor |
getAstVisitor() |
|
protected java.lang.Class |
getAstVisitorClass() Each concrete subclass must either set this property or define its own property with the same name |
|
java.lang.String |
getDoNotApplyToClassNames() |
|
void |
setApplyToClassNames(java.lang.String applyToClassNames) |
|
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