public class FinalVariableAnalyzer extends ClassCodeVisitorSupport
Modifier and Type | Class and Description |
---|---|
static interface |
FinalVariableAnalyzer.VariableNotFinalCallback |
Constructor and Description |
---|
FinalVariableAnalyzer(SourceUnit sourceUnit) |
FinalVariableAnalyzer(SourceUnit sourceUnit,
FinalVariableAnalyzer.VariableNotFinalCallback callback) |
Modifier and Type | Method and 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) |
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
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
public FinalVariableAnalyzer(SourceUnit sourceUnit)
public FinalVariableAnalyzer(SourceUnit sourceUnit, FinalVariableAnalyzer.VariableNotFinalCallback callback)
protected SourceUnit getSourceUnit()
getSourceUnit
in class ClassCodeVisitorSupport
public boolean isEffectivelyFinal(Variable v)
public void visitBlockStatement(BlockStatement block)
visitBlockStatement
in interface GroovyCodeVisitor
visitBlockStatement
in class ClassCodeVisitorSupport
public void visitArgumentlistExpression(ArgumentListExpression ale)
visitArgumentlistExpression
in interface GroovyCodeVisitor
visitArgumentlistExpression
in class CodeVisitorSupport
public void visitBinaryExpression(BinaryExpression expression)
visitBinaryExpression
in interface GroovyCodeVisitor
visitBinaryExpression
in class CodeVisitorSupport
public void visitClosureExpression(ClosureExpression expression)
visitClosureExpression
in interface GroovyCodeVisitor
visitClosureExpression
in class CodeVisitorSupport
public void visitPrefixExpression(PrefixExpression expression)
visitPrefixExpression
in interface GroovyCodeVisitor
visitPrefixExpression
in class CodeVisitorSupport
public void visitPostfixExpression(PostfixExpression expression)
visitPostfixExpression
in interface GroovyCodeVisitor
visitPostfixExpression
in class CodeVisitorSupport
public void visitVariableExpression(VariableExpression expression)
visitVariableExpression
in interface GroovyCodeVisitor
visitVariableExpression
in class CodeVisitorSupport
public void visitIfElse(IfStatement ifElse)
visitIfElse
in interface GroovyCodeVisitor
visitIfElse
in class ClassCodeVisitorSupport
public void visitSwitch(SwitchStatement switchS)
visitSwitch
in interface GroovyCodeVisitor
visitSwitch
in class ClassCodeVisitorSupport
public void visitTryCatchFinally(TryCatchStatement statement)
visitTryCatchFinally
in interface GroovyCodeVisitor
visitTryCatchFinally
in class ClassCodeVisitorSupport