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
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, visitAnnotation, 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
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 Details
-
FinalVariableAnalyzer
-
FinalVariableAnalyzer
public FinalVariableAnalyzer(SourceUnit sourceUnit, FinalVariableAnalyzer.VariableNotFinalCallback callback)
-
-
Method Details
-
getSourceUnit
- Specified by:
getSourceUnit
in classClassCodeVisitorSupport
-
isEffectivelyFinal
-
visitBlockStatement
- Specified by:
visitBlockStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitBlockStatement
in classClassCodeVisitorSupport
-
visitArgumentlistExpression
- Specified by:
visitArgumentlistExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitArgumentlistExpression
in classCodeVisitorSupport
-
visitBinaryExpression
- Specified by:
visitBinaryExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitBinaryExpression
in classCodeVisitorSupport
-
visitClosureExpression
- Specified by:
visitClosureExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitClosureExpression
in classCodeVisitorSupport
-
visitPrefixExpression
- Specified by:
visitPrefixExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitPrefixExpression
in classCodeVisitorSupport
-
visitPostfixExpression
- Specified by:
visitPostfixExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitPostfixExpression
in classCodeVisitorSupport
-
visitVariableExpression
- Specified by:
visitVariableExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitVariableExpression
in classCodeVisitorSupport
-
visitIfElse
- Specified by:
visitIfElse
in interfaceGroovyCodeVisitor
- Overrides:
visitIfElse
in classClassCodeVisitorSupport
-
visitSwitch
- Specified by:
visitSwitch
in interfaceGroovyCodeVisitor
- Overrides:
visitSwitch
in classClassCodeVisitorSupport
-
visitTryCatchFinally
- Specified by:
visitTryCatchFinally
in interfaceGroovyCodeVisitor
- Overrides:
visitTryCatchFinally
in classClassCodeVisitorSupport
-