Package org.codehaus.groovy.classgen

## Class FinalVariableAnalyzer

- java.lang.Object
- - org.codehaus.groovy.ast.CodeVisitorSupport
  - - org.codehaus.groovy.ast.ClassCodeVisitorSupport
    - - org.codehaus.groovy.classgen.FinalVariableAnalyzer

- All Implemented Interfaces:
    `GroovyClassVisitor`, `GroovyCodeVisitor`, `ErrorCollecting`

      public class FinalVariableAnalyzer
      extends ClassCodeVisitorSupport

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static interface` | `FinalVariableAnalyzer.VariableNotFinalCallback` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `FinalVariableAnalyzer​(SourceUnit sourceUnit)` |
    `FinalVariableAnalyzer​(SourceUnit sourceUnit, FinalVariableAnalyzer.VariableNotFinalCallback callback)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected SourceUnit` | `getSourceUnit()` |
    `boolean` | `isEffectivelyFinal​(Variable v)` |
    `void` | `visitArgumentlistExpression​(ArgumentListExpression ale)` |
    `void` | `visitBinaryExpression​(BinaryExpression expression)` |
    `void` | `visitBlockStatement​(BlockStatement block)` |
    `void` | `visitClosureExpression​(ClosureExpression expression)` |
    `void` | `visitIfElse​(IfStatement ifElse)` |
    `void` | `visitPostfixExpression​(PostfixExpression expression)` |
    `void` | `visitPrefixExpression​(PrefixExpression expression)` |
    `void` | `visitSwitch​(SwitchStatement switchS)` |
    `void` | `visitTryCatchFinally​(TryCatchStatement statement)` |
    `void` | `visitVariableExpression​(VariableExpression expression)` |

    - ### Methods inherited from class org.codehaus.groovy.ast.ClassCodeVisitorSupport

      `addError, visitAnnotations, visitAssertStatement, visitBreakStatement, visitCaseStatement, visitCatchStatement, visitClass, visitClassCodeContainer, visitConstructor, visitConstructorOrMethod, visitContinueStatement, visitDeclarationExpression, visitDoWhileLoop, visitExpressionStatement, visitField, visitForLoop, visitImports, visitMethod, visitObjectInitializerStatements, visitPackage, visitProperty, visitReturnStatement, visitStatement, visitSynchronizedStatement, visitThrowStatement, visitWhileLoop`

    - ### Methods inherited from class org.codehaus.groovy.ast.CodeVisitorSupport

      `visitArrayExpression, visitAttributeExpression, visitBitwiseNegationExpression, visitBooleanExpression, visitBytecodeExpression, visitCastExpression, visitClassExpression, visitClosureListExpression, visitConstantExpression, visitConstructorCallExpression, visitEmptyStatement, visitFieldExpression, visitGStringExpression, visitListExpression, visitListOfExpressions, visitMapEntryExpression, visitMapExpression, visitMethodCallExpression, visitMethodPointerExpression, visitNotExpression, visitPropertyExpression, visitRangeExpression, visitShortTernaryExpression, visitSpreadExpression, visitSpreadMapExpression, visitStaticMethodCallExpression, visitTernaryExpression, visitTupleExpression, visitUnaryMinusExpression, visitUnaryPlusExpression`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FinalVariableAnalyzer

          public FinalVariableAnalyzer​(SourceUnit sourceUnit)

    - #### FinalVariableAnalyzer

          public FinalVariableAnalyzer​(SourceUnit sourceUnit,
                                       FinalVariableAnalyzer.VariableNotFinalCallback callback)

  - ### Method Detail

    - #### getSourceUnit

          protected SourceUnit getSourceUnit()

      Specified by:
        `getSourceUnit` in class `ClassCodeVisitorSupport`

    - #### isEffectivelyFinal

          public boolean isEffectivelyFinal​(Variable v)

    - #### visitBlockStatement

          public void visitBlockStatement​(BlockStatement block)

      Specified by:
        `visitBlockStatement` in interface `GroovyCodeVisitor`
      Overrides:
        `visitBlockStatement` in class `ClassCodeVisitorSupport`

    - #### visitArgumentlistExpression

          public void visitArgumentlistExpression​(ArgumentListExpression ale)

      Specified by:
        `visitArgumentlistExpression` in interface `GroovyCodeVisitor`
      Overrides:
        `visitArgumentlistExpression` in class `CodeVisitorSupport`

    - #### visitBinaryExpression

          public void visitBinaryExpression​(BinaryExpression expression)

      Specified by:
        `visitBinaryExpression` in interface `GroovyCodeVisitor`
      Overrides:
        `visitBinaryExpression` in class `CodeVisitorSupport`

    - #### visitClosureExpression

          public void visitClosureExpression​(ClosureExpression expression)

      Specified by:
        `visitClosureExpression` in interface `GroovyCodeVisitor`
      Overrides:
        `visitClosureExpression` in class `CodeVisitorSupport`

    - #### visitPrefixExpression

          public void visitPrefixExpression​(PrefixExpression expression)

      Specified by:
        `visitPrefixExpression` in interface `GroovyCodeVisitor`
      Overrides:
        `visitPrefixExpression` in class `CodeVisitorSupport`

    - #### visitPostfixExpression

          public void visitPostfixExpression​(PostfixExpression expression)

      Specified by:
        `visitPostfixExpression` in interface `GroovyCodeVisitor`
      Overrides:
        `visitPostfixExpression` in class `CodeVisitorSupport`

    - #### visitVariableExpression

          public void visitVariableExpression​(VariableExpression expression)

      Specified by:
        `visitVariableExpression` in interface `GroovyCodeVisitor`
      Overrides:
        `visitVariableExpression` in class `CodeVisitorSupport`

    - #### visitIfElse

          public void visitIfElse​(IfStatement ifElse)

      Specified by:
        `visitIfElse` in interface `GroovyCodeVisitor`
      Overrides:
        `visitIfElse` in class `ClassCodeVisitorSupport`

    - #### visitSwitch

          public void visitSwitch​(SwitchStatement switchS)

      Specified by:
        `visitSwitch` in interface `GroovyCodeVisitor`
      Overrides:
        `visitSwitch` in class `ClassCodeVisitorSupport`

    - #### visitTryCatchFinally

          public void visitTryCatchFinally​(TryCatchStatement statement)

      Specified by:
        `visitTryCatchFinally` in interface `GroovyCodeVisitor`
      Overrides:
        `visitTryCatchFinally` in class `ClassCodeVisitorSupport`