Package: groovy.org.codenarc.rule

## [Groovy] Interface AstVisitor

- Interface for Groovy AST Visitors used with Rules

  Authors:
    Chris Mair

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `List<Violation>` | `getViolations()` Retrieve the List of Violations resulting from applying this visitor
    `` | `void` | `setRule(Rule rule)` Set the Rule associated with this visitor
    `` | `void` | `setSourceCode(SourceCode sourceCode)` Set the SourceCode associated with this visitor

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---

    `interface org.codehaus.groovy.ast.GroovyClassVisitor`

    `org.codehaus.groovy.ast.GroovyClassVisitor#visitField(org.codehaus.groovy.ast.FieldNode), org.codehaus.groovy.ast.GroovyClassVisitor#visitMethod(org.codehaus.groovy.ast.MethodNode), org.codehaus.groovy.ast.GroovyClassVisitor#visitProperty(org.codehaus.groovy.ast.PropertyNode), org.codehaus.groovy.ast.GroovyClassVisitor#visitConstructor(org.codehaus.groovy.ast.ConstructorNode), org.codehaus.groovy.ast.GroovyClassVisitor#visitClass(org.codehaus.groovy.ast.ClassNode)`

    `class Object` | `equals, toString, hashCode, getClass, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### List<Violation> getViolations()

      Retrieve the List of Violations resulting from applying this visitor

      Returns:
        the List of Violations; may be empty

    - #### void setRule(Rule rule)

      Set the Rule associated with this visitor

      Parameters:
        `rule` - - the Rule

    - #### void setSourceCode(SourceCode sourceCode)

      Set the SourceCode associated with this visitor

      Parameters:
        `sourceCode` - - the SourceCode