Package: groovy.org.codenarc.rule.grails

## [Groovy] Class GrailsPublicControllerMethodRule

- groovy.org.codenarc.rule.grails.GrailsPublicControllerMethodRule

- Rule that checks for public methods on Grails controller classes. Static methods are ignored.

  NOTE: This rule is DISABLED by default (i.e., by setting its enabled property to false). Given that Grails 2.x allows and encourages controller actions to be defined as methods instead of closures, this rule makes no more sense (for Grails 2.x projects).

  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.

  The `ignoreMethodNames` property optionally specifies one or more (comma-separated) method names that should be ignored (i.e., that should not cause a rule violation). The name(s) may optionally include wildcard characters ('*' or '?').

  This rule sets the default value of `applyToFilesMatching` 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.
  Authors:
    Chris Mair
    Hamlet D'Arcy

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `String` | `applyToClassNames`
    `String` | `applyToFilesMatching`
    `Class` | `astVisitorClass`
    `String` | `ignoreMethodNames`
    `String` | `name`
    `int` | `priority`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `GrailsPublicControllerMethodRule ()`

- - ### Property Detail

    - #### String applyToClassNames

    - #### String applyToFilesMatching

    - #### Class astVisitorClass

    - #### String ignoreMethodNames

    - #### String name

    - #### int priority

  - ### Constructor Detail

    - #### GrailsPublicControllerMethodRule()