|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD |
java.lang.Objectorg.codenarc.rule.AbstractRule
org.codenarc.rule.AbstractAstVisitorRule
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.
Property Summary | |
---|---|
protected static def |
DEFAULT_CONST_NAME
|
protected static def |
DEFAULT_FIELD_NAME
|
protected static def |
DEFAULT_TEST_CLASS_NAMES
|
protected static def |
DEFAULT_TEST_FILES
|
protected static def |
DEFAULT_VAR_NAME
|
String |
applyToClassNames
This rule is only applied to classes with names matching this value. |
Class |
astVisitorClass
Each concrete subclass must either set this property or define its own property with the same name |
String |
doNotApplyToClassNames
This rule is NOT applied to classes with names matching this value. |
Constructor Summary | |
AbstractAstVisitorRule()
|
Method Summary | |
---|---|
void
|
applyTo(SourceCode sourceCode, List violations)
|
AstVisitor
|
getAstVisitor()
|
protected boolean
|
shouldApplyThisRuleTo(def classNode)
Return true if this rule should be applied for the specified ClassNode, based on the configuration of this rule. |
Property Detail |
---|
protected static final def DEFAULT_CONST_NAME
protected static final def DEFAULT_FIELD_NAME
protected static final def DEFAULT_TEST_CLASS_NAMES
protected static final def DEFAULT_TEST_FILES
protected static final def DEFAULT_VAR_NAME
String applyToClassNames
Class astVisitorClass
String doNotApplyToClassNames
Constructor Detail |
---|
AbstractAstVisitorRule()
Method Detail |
---|
void applyTo(SourceCode sourceCode, List violations)
AstVisitor getAstVisitor()
protected boolean shouldApplyThisRuleTo(def classNode)
Groovy Documentation