Package: groovy.org.codenarc.rule

## [Groovy] Class ClassReferenceAstVisitor

- groovy.org.codenarc.rule.ClassReferenceAstVisitor

- AstVisitor that check for references for a named class

  Authors:
    Chris Mair

- - ### Constructor Summary

    Constructors
    Constructor and description
    `ClassReferenceAstVisitor (String classNames)` Constructor
    `ClassReferenceAstVisitor (String classNames, String violationMessagePattern)` Constructor

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `void` | `visitCastExpression(org.codehaus.groovy.ast.expr.CastExpression expression)`
    `` | `protected void` | `visitClassEx(org.codehaus.groovy.ast.ClassNode node)`
    `` | `void` | `visitClassExpression(org.codehaus.groovy.ast.expr.ClassExpression expression)`
    `` | `void` | `visitClosureExpression(org.codehaus.groovy.ast.expr.ClosureExpression expression)`
    `` | `void` | `visitConstructorCallExpression(org.codehaus.groovy.ast.expr.ConstructorCallExpression node)`
    `` | `void` | `visitConstructorOrMethod(org.codehaus.groovy.ast.MethodNode node, boolean isConstructor)`
    `` | `void` | `visitField(org.codehaus.groovy.ast.FieldNode node)`
    `` | `void` | `visitImports(org.codehaus.groovy.ast.ModuleNode node)`
    `` | `void` | `visitPropertyExpression(org.codehaus.groovy.ast.expr.PropertyExpression expression)`
    `` | `void` | `visitVariableExpression(org.codehaus.groovy.ast.expr.VariableExpression expression)`

- - ### Constructor Detail

    - #### ClassReferenceAstVisitor(String classNames)

      Constructor

      Parameters:
        `classNames` - - one or more comma-separated class name patterns. Can contain wildcards (*,?)

    - #### ClassReferenceAstVisitor(String classNames, String violationMessagePattern)

      Constructor

      Parameters:
        `classNames` - - one or more comma-separated class name patterns. Can contain wildcards (*,?)
        `violationMessagePattern` - - the MessageFormat String pattern used to build the violation message. The class name is passed as the single argument to the pattern. e.g. "Found reference to {0}"

  - ### Method Detail

    - #### @Override void visitCastExpression(org.codehaus.groovy.ast.expr.CastExpression expression)

    - #### @Override protected void visitClassEx(org.codehaus.groovy.ast.ClassNode node)

    - #### @Override void visitClassExpression(org.codehaus.groovy.ast.expr.ClassExpression expression)

    - #### @Override void visitClosureExpression(org.codehaus.groovy.ast.expr.ClosureExpression expression)

    - #### @Override void visitConstructorCallExpression(org.codehaus.groovy.ast.expr.ConstructorCallExpression node)

    - #### @Override void visitConstructorOrMethod(org.codehaus.groovy.ast.MethodNode node, boolean isConstructor)

    - #### @Override void visitField(org.codehaus.groovy.ast.FieldNode node)

    - #### @Override void visitImports(org.codehaus.groovy.ast.ModuleNode node)

    - #### @Override void visitPropertyExpression(org.codehaus.groovy.ast.expr.PropertyExpression expression)

    - #### @Override void visitVariableExpression(org.codehaus.groovy.ast.expr.VariableExpression expression)