public abstract class ContextualClassCodeVisitor extends ClassCodeVisitorSupport
Constructor and Description |
---|
ContextualClassCodeVisitor() |
addError, getSourceUnit, visitAnnotations, visitClassCodeContainer, visitConstructor, visitDeclarationExpression, visitMethod, visitObjectInitializerStatements, visitStatement
visitArgumentlistExpression, visitListOfExpressions
public TreeContext getTreeContext()
public TreeContext getLastContext()
protected void pushContext(TreeContext ctx)
protected TreeContext popContext()
protected void pushContext(ASTNode node)
public void visitClass(ClassNode node)
GroovyClassVisitor
visitClass
in interface GroovyClassVisitor
visitClass
in class ClassCodeVisitorSupport
public void visitPackage(PackageNode node)
visitPackage
in class ClassCodeVisitorSupport
public void visitImports(ModuleNode node)
visitImports
in class ClassCodeVisitorSupport
protected void visitConstructorOrMethod(MethodNode node, boolean isConstructor)
visitConstructorOrMethod
in class ClassCodeVisitorSupport
public void visitField(FieldNode node)
GroovyClassVisitor
visitField
in interface GroovyClassVisitor
visitField
in class ClassCodeVisitorSupport
public void visitProperty(PropertyNode node)
GroovyClassVisitor
visitProperty
in interface GroovyClassVisitor
visitProperty
in class ClassCodeVisitorSupport
public void visitMethodCallExpression(MethodCallExpression call)
visitMethodCallExpression
in interface GroovyCodeVisitor
visitMethodCallExpression
in class CodeVisitorSupport
public void visitStaticMethodCallExpression(StaticMethodCallExpression call)
visitStaticMethodCallExpression
in interface GroovyCodeVisitor
visitStaticMethodCallExpression
in class CodeVisitorSupport
public void visitConstructorCallExpression(ConstructorCallExpression call)
visitConstructorCallExpression
in interface GroovyCodeVisitor
visitConstructorCallExpression
in class CodeVisitorSupport
public void visitBinaryExpression(BinaryExpression expression)
visitBinaryExpression
in interface GroovyCodeVisitor
visitBinaryExpression
in class CodeVisitorSupport
public void visitTernaryExpression(TernaryExpression expression)
visitTernaryExpression
in interface GroovyCodeVisitor
visitTernaryExpression
in class CodeVisitorSupport
public void visitShortTernaryExpression(ElvisOperatorExpression expression)
visitShortTernaryExpression
in interface GroovyCodeVisitor
visitShortTernaryExpression
in class CodeVisitorSupport
public void visitPostfixExpression(PostfixExpression expression)
visitPostfixExpression
in interface GroovyCodeVisitor
visitPostfixExpression
in class CodeVisitorSupport
public void visitPrefixExpression(PrefixExpression expression)
visitPrefixExpression
in interface GroovyCodeVisitor
visitPrefixExpression
in class CodeVisitorSupport
public void visitBooleanExpression(BooleanExpression expression)
visitBooleanExpression
in interface GroovyCodeVisitor
visitBooleanExpression
in class CodeVisitorSupport
public void visitNotExpression(NotExpression expression)
visitNotExpression
in interface GroovyCodeVisitor
visitNotExpression
in class CodeVisitorSupport
public void visitClosureExpression(ClosureExpression expression)
visitClosureExpression
in interface GroovyCodeVisitor
visitClosureExpression
in class CodeVisitorSupport
public void visitTupleExpression(TupleExpression expression)
visitTupleExpression
in interface GroovyCodeVisitor
visitTupleExpression
in class CodeVisitorSupport
public void visitListExpression(ListExpression expression)
visitListExpression
in interface GroovyCodeVisitor
visitListExpression
in class CodeVisitorSupport
public void visitArrayExpression(ArrayExpression expression)
visitArrayExpression
in interface GroovyCodeVisitor
visitArrayExpression
in class CodeVisitorSupport
public void visitMapExpression(MapExpression expression)
visitMapExpression
in interface GroovyCodeVisitor
visitMapExpression
in class CodeVisitorSupport
public void visitMapEntryExpression(MapEntryExpression expression)
visitMapEntryExpression
in interface GroovyCodeVisitor
visitMapEntryExpression
in class CodeVisitorSupport
public void visitRangeExpression(RangeExpression expression)
visitRangeExpression
in interface GroovyCodeVisitor
visitRangeExpression
in class CodeVisitorSupport
public void visitSpreadExpression(SpreadExpression expression)
visitSpreadExpression
in interface GroovyCodeVisitor
visitSpreadExpression
in class CodeVisitorSupport
public void visitSpreadMapExpression(SpreadMapExpression expression)
visitSpreadMapExpression
in interface GroovyCodeVisitor
visitSpreadMapExpression
in class CodeVisitorSupport
public void visitMethodPointerExpression(MethodPointerExpression expression)
visitMethodPointerExpression
in interface GroovyCodeVisitor
visitMethodPointerExpression
in class CodeVisitorSupport
public void visitUnaryMinusExpression(UnaryMinusExpression expression)
visitUnaryMinusExpression
in interface GroovyCodeVisitor
visitUnaryMinusExpression
in class CodeVisitorSupport
public void visitUnaryPlusExpression(UnaryPlusExpression expression)
visitUnaryPlusExpression
in interface GroovyCodeVisitor
visitUnaryPlusExpression
in class CodeVisitorSupport
public void visitBitwiseNegationExpression(BitwiseNegationExpression expression)
visitBitwiseNegationExpression
in interface GroovyCodeVisitor
visitBitwiseNegationExpression
in class CodeVisitorSupport
public void visitCastExpression(CastExpression expression)
visitCastExpression
in interface GroovyCodeVisitor
visitCastExpression
in class CodeVisitorSupport
public void visitConstantExpression(ConstantExpression expression)
visitConstantExpression
in interface GroovyCodeVisitor
visitConstantExpression
in class CodeVisitorSupport
public void visitClassExpression(ClassExpression expression)
visitClassExpression
in interface GroovyCodeVisitor
visitClassExpression
in class CodeVisitorSupport
public void visitVariableExpression(VariableExpression expression)
visitVariableExpression
in interface GroovyCodeVisitor
visitVariableExpression
in class CodeVisitorSupport
public void visitPropertyExpression(PropertyExpression expression)
visitPropertyExpression
in interface GroovyCodeVisitor
visitPropertyExpression
in class CodeVisitorSupport
public void visitAttributeExpression(AttributeExpression expression)
visitAttributeExpression
in interface GroovyCodeVisitor
visitAttributeExpression
in class CodeVisitorSupport
public void visitFieldExpression(FieldExpression expression)
visitFieldExpression
in interface GroovyCodeVisitor
visitFieldExpression
in class CodeVisitorSupport
public void visitGStringExpression(GStringExpression expression)
visitGStringExpression
in interface GroovyCodeVisitor
visitGStringExpression
in class CodeVisitorSupport
public void visitClosureListExpression(ClosureListExpression cle)
visitClosureListExpression
in interface GroovyCodeVisitor
visitClosureListExpression
in class CodeVisitorSupport
public void visitBytecodeExpression(BytecodeExpression cle)
visitBytecodeExpression
in interface GroovyCodeVisitor
visitBytecodeExpression
in class CodeVisitorSupport
public void visitAssertStatement(AssertStatement statement)
visitAssertStatement
in interface GroovyCodeVisitor
visitAssertStatement
in class ClassCodeVisitorSupport
public void visitBlockStatement(BlockStatement block)
visitBlockStatement
in interface GroovyCodeVisitor
visitBlockStatement
in class ClassCodeVisitorSupport
public void visitBreakStatement(BreakStatement statement)
visitBreakStatement
in interface GroovyCodeVisitor
visitBreakStatement
in class ClassCodeVisitorSupport
public void visitCaseStatement(CaseStatement statement)
visitCaseStatement
in interface GroovyCodeVisitor
visitCaseStatement
in class ClassCodeVisitorSupport
public void visitCatchStatement(CatchStatement statement)
visitCatchStatement
in interface GroovyCodeVisitor
visitCatchStatement
in class ClassCodeVisitorSupport
public void visitContinueStatement(ContinueStatement statement)
visitContinueStatement
in interface GroovyCodeVisitor
visitContinueStatement
in class ClassCodeVisitorSupport
public void visitDoWhileLoop(DoWhileStatement loop)
visitDoWhileLoop
in interface GroovyCodeVisitor
visitDoWhileLoop
in class ClassCodeVisitorSupport
public void visitExpressionStatement(ExpressionStatement statement)
visitExpressionStatement
in interface GroovyCodeVisitor
visitExpressionStatement
in class ClassCodeVisitorSupport
public void visitForLoop(ForStatement forLoop)
visitForLoop
in interface GroovyCodeVisitor
visitForLoop
in class ClassCodeVisitorSupport
public void visitIfElse(IfStatement ifElse)
visitIfElse
in interface GroovyCodeVisitor
visitIfElse
in class ClassCodeVisitorSupport
public void visitReturnStatement(ReturnStatement statement)
visitReturnStatement
in interface GroovyCodeVisitor
visitReturnStatement
in class ClassCodeVisitorSupport
public void visitSwitch(SwitchStatement statement)
visitSwitch
in interface GroovyCodeVisitor
visitSwitch
in class ClassCodeVisitorSupport
public void visitSynchronizedStatement(SynchronizedStatement statement)
visitSynchronizedStatement
in interface GroovyCodeVisitor
visitSynchronizedStatement
in class ClassCodeVisitorSupport
public void visitThrowStatement(ThrowStatement statement)
visitThrowStatement
in interface GroovyCodeVisitor
visitThrowStatement
in class ClassCodeVisitorSupport
public void visitTryCatchFinally(TryCatchStatement statement)
visitTryCatchFinally
in interface GroovyCodeVisitor
visitTryCatchFinally
in class ClassCodeVisitorSupport
public void visitWhileLoop(WhileStatement loop)
visitWhileLoop
in interface GroovyCodeVisitor
visitWhileLoop
in class ClassCodeVisitorSupport
protected void visitEmptyStatement(EmptyStatement statement)
visitEmptyStatement
in class CodeVisitorSupport
public List<TreeContext> getTreePath()
public List<TreeContext> pathMatches(List<ASTNodePredicate> predicates)
public List<TreeContext> pathUpTo(ASTNodePredicate predicate)
public List<TreeContext> pathUpTo(Class<ASTNode> node)
public List<TreeContext> pathUpTo(Class<ASTNode> node, ASTNodePredicate predicate)
public static List<ASTNodePredicate> matchByClass(Class<ASTNode>... classes)