public abstract class AbstractAstVisitorRule extends AbstractRule
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.Modifier and Type | Field and Description |
---|---|
static String |
CLOSURE_TEXT |
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 |
Constructor and Description |
---|
AbstractAstVisitorRule() |
Modifier and Type | Method and Description |
---|---|
void |
applyTo(SourceCode sourceCode,
List<Violation> violations)
Apply this rule to the specified source and return a list of violations (or an empty List)
|
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.
|
applyTo, createViolation, createViolation, createViolation, createViolation, createViolation, createViolationForImport, createViolationForImport, createViolationForImport, getApplyToFileNames, getApplyToFilesMatching, getCompilerPhase, getDescription, getDoNotApplyToFileNames, getDoNotApplyToFilesMatching, getName, getPriority, getViolationMessage, isEnabled, isReady, setApplyToFileNames, setApplyToFilesMatching, setDescription, setDoNotApplyToFileNames, setDoNotApplyToFilesMatching, setEnabled, setName, setPriority, setViolationMessage, toString, validate
protected static final String DEFAULT_CONST_NAME
protected static final String DEFAULT_FIELD_NAME
protected static final String DEFAULT_VAR_NAME
protected static final String DEFAULT_TEST_FILES
protected static final String DEFAULT_TEST_CLASS_NAMES
public static final String CLOSURE_TEXT
protected Class getAstVisitorClass()
public AstVisitor getAstVisitor()
public void applyTo(SourceCode sourceCode, List<Violation> violations)
AbstractRule
applyTo
in class AbstractRule
sourceCode
- - the source to apply this rule toviolations
- - the List of violations to which new violations from this rule are to be addedprotected boolean shouldApplyThisRuleTo(org.codehaus.groovy.ast.ClassNode classNode)
classNode
- - the ClassNodepublic String getApplyToClassNames()
public void setApplyToClassNames(String applyToClassNames)
public String getDoNotApplyToClassNames()
public void setDoNotApplyToClassNames(String doNotApplyToClassNames)
Copyright © 2022. All rights reserved.