Package: org.codehaus.groovy.control

## [Java] Class StaticVerifier

- org.codehaus.groovy.control.StaticVerifier

-     public class StaticVerifier
      extends ClassCodeVisitorSupport

  Checks for dynamic variables in static contexts.

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected SourceUnit` | `getSourceUnit()` Returns the source unit currently being verified.
    `` | `public void` | `visitClass(ClassNode node, SourceUnit unit)` Starts verification for the supplied class and source unit.
    `` | `public void` | `visitClosureExpression(ClosureExpression ce)` Tracks closure nesting while visiting closure expressions.
    `` | `public void` | `visitConstructorCallExpression(ConstructorCallExpression cce)` Tracks whether the visitor is inside a special constructor call.
    `` | `public void` | `visitConstructorOrMethod(MethodNode node, boolean isConstructor)` Tracks the current method or constructor while verifying static references.
    `` | `public void` | `visitVariableExpression(VariableExpression ve)` Reports dynamic variable access that is illegal in static contexts.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class ClassCodeVisitorSupport` | `addError, getSourceUnit, visitAnnotation, visitAnnotations, visitAnnotations, visitAssertStatement, visitBlockStatement, visitBreakStatement, visitCaseStatement, visitCatchStatement, visitClass, visitClassCodeContainer, visitClosureExpression, visitConstructor, visitConstructorOrMethod, visitContinueStatement, visitDeclarationExpression, visitDoWhileLoop, visitExpressionStatement, visitField, visitForLoop, visitIfElse, visitImports, visitMethod, visitObjectInitializerStatements, visitPackage, visitProperty, visitReturnStatement, visitStatement, visitStatementAnnotations, visitSwitch, visitSynchronizedStatement, visitThrowStatement, visitTryCatchFinally, visitWhileLoop, visitYieldStatement`
    `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`

- - ### Method Detail

    - #### protected SourceUnit getSourceUnit()

      Returns the source unit currently being verified.

      Returns:
        the active source unit

    - #### public void visitClass(ClassNode node, SourceUnit unit)

      Starts verification for the supplied class and source unit.

      Parameters:
        `node` - the class to verify
        `unit` - the owning source unit

    - #### public void visitClosureExpression(ClosureExpression ce)

      Tracks closure nesting while visiting closure expressions.

      Parameters:
        `ce` - the closure expression to visit

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

      Tracks whether the visitor is inside a special constructor call.

      Parameters:
        `cce` - the constructor call to visit

    - #### public void visitConstructorOrMethod(MethodNode node, boolean isConstructor)

      Tracks the current method or constructor while verifying static references.

      Parameters:
        `node` - the method or constructor being visited
        `isConstructor` - whether `node` is a constructor

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

      Reports dynamic variable access that is illegal in static contexts.

      Parameters:
        `ve` - the variable expression to inspect