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
-
-
-
-
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 classClassCodeVisitorSupport
-
isEffectivelyFinal
public boolean isEffectivelyFinal(Variable v)
-
visitBlockStatement
public void visitBlockStatement(BlockStatement block)
- Specified by:
visitBlockStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitBlockStatement
in classClassCodeVisitorSupport
-
visitArgumentlistExpression
public void visitArgumentlistExpression(ArgumentListExpression ale)
- Specified by:
visitArgumentlistExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitArgumentlistExpression
in classCodeVisitorSupport
-
visitBinaryExpression
public void visitBinaryExpression(BinaryExpression expression)
- Specified by:
visitBinaryExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitBinaryExpression
in classCodeVisitorSupport
-
visitClosureExpression
public void visitClosureExpression(ClosureExpression expression)
- Specified by:
visitClosureExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitClosureExpression
in classCodeVisitorSupport
-
visitPrefixExpression
public void visitPrefixExpression(PrefixExpression expression)
- Specified by:
visitPrefixExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitPrefixExpression
in classCodeVisitorSupport
-
visitPostfixExpression
public void visitPostfixExpression(PostfixExpression expression)
- Specified by:
visitPostfixExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitPostfixExpression
in classCodeVisitorSupport
-
visitVariableExpression
public void visitVariableExpression(VariableExpression expression)
- Specified by:
visitVariableExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitVariableExpression
in classCodeVisitorSupport
-
visitIfElse
public void visitIfElse(IfStatement ifElse)
- Specified by:
visitIfElse
in interfaceGroovyCodeVisitor
- Overrides:
visitIfElse
in classClassCodeVisitorSupport
-
visitSwitch
public void visitSwitch(SwitchStatement switchS)
- Specified by:
visitSwitch
in interfaceGroovyCodeVisitor
- Overrides:
visitSwitch
in classClassCodeVisitorSupport
-
visitTryCatchFinally
public void visitTryCatchFinally(TryCatchStatement statement)
- Specified by:
visitTryCatchFinally
in interfaceGroovyCodeVisitor
- Overrides:
visitTryCatchFinally
in classClassCodeVisitorSupport
-
-