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` | `visitTryCatchFinally​(TryCatchStatement statement)` |
    `void` | `visitVariableExpression​(VariableExpression expression)` |

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

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

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

      `afterSwitchConditionExpressionVisited, visitArrayExpression, visitAttributeExpression, visitBitwiseNegationExpression, visitBooleanExpression, visitBytecodeExpression, visitCastExpression, visitClassExpression, visitClosureListExpression, visitConstantExpression, visitConstructorCallExpression, visitEmptyStatement, visitFieldExpression, visitGStringExpression, visitLambdaExpression, visitListExpression, visitMapEntryExpression, visitMapExpression, visitMethodCallExpression, visitMethodPointerExpression, visitMethodReferenceExpression, 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`

    - ### Methods inherited from interface org.codehaus.groovy.ast.GroovyCodeVisitor

      `visitEmptyExpression, visitListOfExpressions`

- - ### 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`

    - #### visitTryCatchFinally

          public void visitTryCatchFinally​(TryCatchStatement statement)

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