Package: org.codehaus.groovy.classgen

## [Java] Class VerifierCodeVisitor

- org.codehaus.groovy.classgen.VerifierCodeVisitor

-     public class VerifierCodeVisitor
      extends CodeVisitorSupport

  Performs various checks on code inside methods and constructors including checking for valid field, variables names etc. that would otherwise lead to invalid code.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `VerifierCodeVisitor(ClassNode classNode)` Creates a new verifier code visitor for the given class.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public static void` | `assertValidIdentifier(String name, String message, ASTNode node)` Verifies that the supplied name is a valid Java identifier.
    `` | `public void` | `visitConstructorCallExpression(ConstructorCallExpression call)` * Visits a ConstructorCallExpression, traversing its argument list. * * Parameters: `call` - the constructor call expression
    `` | `public void` | `visitFieldExpression(FieldExpression expression)` * Visits a FieldExpression. No traversal is performed as field expressions contain no child expressions. * * Parameters: `expression` - the field expression
    `` | `public void` | `visitForLoop(ForStatement statement)` * Visits a ForStatement, traversing the collection expression and loop body. * * Parameters: `statement` - the for loop statement
    `` | `public void` | `visitListExpression(ListExpression expression)` * Visits a ListExpression, traversing all contained expressions. * * Parameters: `expression` - the list expression
    `` | `public void` | `visitVariableExpression(VariableExpression expression)` * Visits a VariableExpression. No traversal is performed as variable expressions contain no child expressions. * * Parameters: `expression` - the variable expression

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class CodeVisitorSupport` | `afterSwitchCaseStatementsVisited, afterSwitchCaseStatementsVisited, afterSwitchConditionExpressionVisited, afterSwitchConditionExpressionVisited, visitArgumentlistExpression, visitArrayExpression, visitAssertStatement, visitAttributeExpression, visitBinaryExpression, visitBitwiseNegationExpression, visitBlockStatement, visitBooleanExpression, visitBreakStatement, visitBytecodeExpression, visitCaseStatement, visitCastExpression, visitCatchStatement, visitClassExpression, visitClosureExpression, visitClosureListExpression, visitConstantExpression, visitConstructorCallExpression, visitContinueStatement, visitDeclarationExpression, visitDoWhileLoop, visitEmptyStatement, visitExpressionStatement, visitFieldExpression, visitForLoop, visitGStringExpression, visitIfElse, visitLambdaExpression, visitListExpression, visitMapEntryExpression, visitMapExpression, visitMethodCallExpression, visitMethodPointerExpression, visitMethodReferenceExpression, visitNotExpression, visitPostfixExpression, visitPrefixExpression, visitPropertyExpression, visitRangeExpression, visitReturnStatement, visitShortTernaryExpression, visitSpreadExpression, visitSpreadMapExpression, visitStaticMethodCallExpression, visitSwitch, visitSwitchExpression, visitSynchronizedStatement, visitTernaryExpression, visitThrowStatement, visitTryCatchFinally, visitTupleExpression, visitUnaryMinusExpression, visitUnaryPlusExpression, visitVariableExpression, visitWhileLoop, visitYieldStatement`

- - ### Constructor Detail

    - #### public VerifierCodeVisitor(ClassNode classNode)

      Creates a new verifier code visitor for the given class.

      Parameters:
        `classNode` - the class node being verified

  - ### Method Detail

    - #### public static void assertValidIdentifier(String name, String message, ASTNode node)

      Verifies that the supplied name is a valid Java identifier.

      Parameters:
        `name` - the identifier text to validate
        `message` - the error context to include in failures
        `node` - the node to associate with any parse error

    - #### public void visitConstructorCallExpression(ConstructorCallExpression call)

      * Visits a ConstructorCallExpression, traversing its argument list. * *

      Parameters:
        `call` - the constructor call expression

    - #### public void visitFieldExpression(FieldExpression expression)

      * Visits a FieldExpression. No traversal is performed as field expressions contain no child expressions. * *

      Parameters:
        `expression` - the field expression

    - #### public void visitForLoop(ForStatement statement)

      * Visits a ForStatement, traversing the collection expression and loop body. * *

      Parameters:
        `statement` - the for loop statement

    - #### public void visitListExpression(ListExpression expression)

      * Visits a ListExpression, traversing all contained expressions. * *

      Parameters:
        `expression` - the list expression

    - #### public void visitVariableExpression(VariableExpression expression)

      * Visits a VariableExpression. No traversal is performed as variable expressions contain no child expressions. * *

      Parameters:
        `expression` - the variable expression