|
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
org.codenarc.rule.grails.GrailsPublicControllerMethodRule
class GrailsPublicControllerMethodRule extends AbstractAstVisitorRule
Rule that checks for public methods on Grails controller classes. Static methods are ignored.
Grails controller actions and interceptors are defined as properties on the controller class. Public methods on a controller class are unnecessary. They break encapsulation and can be confusing. This rule sets the default value ofapplyToFilesMatching
to only match files
under the 'grails-app/controllers' folder. You can override this with a different regular
expression value if appropriate.
This rule also sets the default value of applyToClassNames
to only match class
names ending in 'Controller'. You can override this with a different class name pattern
(String) if appropriate.
Property Summary | |
---|---|
String |
applyToClassNames
|
String |
applyToFilesMatching
|
Class |
astVisitorClass
|
String |
name
|
int |
priority
|
Constructor Summary | |
GrailsPublicControllerMethodRule()
|
Method Summary |
---|
Methods inherited from class AbstractAstVisitorRule | |
---|---|
shouldApplyThisRuleTo |
Property Detail |
---|
String applyToClassNames
String applyToFilesMatching
Class astVisitorClass
String name
int priority
Constructor Detail |
---|
GrailsPublicControllerMethodRule()
Groovy Documentation