|
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
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.
| Field 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
|
| Property Summary | |
|---|---|
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. |
| 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. |
| Field 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
| Property Detail |
|---|
String applyToClassNames
Class astVisitorClass
String doNotApplyToClassNames
| Method Detail |
|---|
void applyTo(SourceCode sourceCode, List violations)
AstVisitor getAstVisitor()
protected boolean shouldApplyThisRuleTo(def classNode)
classNode - - the ClassNode
Groovy Documentation