Package: org.codehaus.groovy.ast

## [Java] Class GroovyCodeVisitorAdapter

- org.codehaus.groovy.ast.GroovyCodeVisitorAdapter

- All Implemented Interfaces and Traits:
    GroovyCodeVisitor

      public class GroovyCodeVisitorAdapter
      extends Object
      implements GroovyCodeVisitor

  Adapter class providing default no-op implementations of all methods in the GroovyCodeVisitor interface. Subclasses can override only the visitor methods relevant to their use case, simplifying implementation of custom AST visitors that do not need to handle all node types.

  The adapter includes delegation strategies for related expression types: `visitDeclarationExpression()` delegates to `visitBinaryExpression()`; `visitNotExpression()` delegates to `visitBooleanExpression()`; `visitLambdaExpression()` delegates to `visitClosureExpression()`; `visitAttributeExpression()` delegates to `visitPropertyExpression()`; `visitArgumentlistExpression()` delegates to `visitTupleExpression()`; `visitClosureListExpression()` delegates to `visitListExpression()`; `visitMethodReferenceExpression()` delegates to `visitMethodPointerExpression()`; `visitShortTernaryExpression()` (elvis operator) delegates to `visitTernaryExpression()`.

  See Also:
    GroovyCodeVisitor
  Since:
    4.0.0

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `visitArgumentlistExpression(ArgumentListExpression expression)` Visits an ArgumentListExpression.
    `` | `public void` | `visitArrayExpression(ArrayExpression expression)` Visits an ArrayExpression.
    `` | `public void` | `visitAssertStatement(AssertStatement statement)` Visits an AssertStatement.
    `` | `public void` | `visitAttributeExpression(AttributeExpression expression)` Visits an AttributeExpression.
    `` | `public void` | `visitBinaryExpression(BinaryExpression expression)` Visits a BinaryExpression.
    `` | `public void` | `visitBitwiseNegationExpression(BitwiseNegationExpression expression)` Visits a BitwiseNegationExpression.
    `` | `public void` | `visitBlockStatement(BlockStatement statement)` Visits a BlockStatement.
    `` | `public void` | `visitBooleanExpression(BooleanExpression expression)` Visits a BooleanExpression.
    `` | `public void` | `visitBreakStatement(BreakStatement statement)` Visits a BreakStatement.
    `` | `public void` | `visitBytecodeExpression(BytecodeExpression expression)` Visits a BytecodeExpression.
    `` | `public void` | `visitCaseStatement(CaseStatement statement)` Visits a CaseStatement.
    `` | `public void` | `visitCastExpression(CastExpression expression)` Visits a CastExpression.
    `` | `public void` | `visitCatchStatement(CatchStatement statement)` Visits a CatchStatement.
    `` | `public void` | `visitClassExpression(ClassExpression expression)` Visits a ClassExpression.
    `` | `public void` | `visitClosureExpression(ClosureExpression expression)` Visits a ClosureExpression.
    `` | `public void` | `visitClosureListExpression(ClosureListExpression expression)` Visits a ClosureListExpression.
    `` | `public void` | `visitConstantExpression(ConstantExpression expression)` Visits a ConstantExpression.
    `` | `public void` | `visitConstructorCallExpression(ConstructorCallExpression expression)` Visits a ConstructorCallExpression.
    `` | `public void` | `visitContinueStatement(ContinueStatement statement)` Visits a ContinueStatement.
    `` | `public void` | `visitDeclarationExpression(DeclarationExpression expression)` Visits a DeclarationExpression.
    `` | `public void` | `visitDoWhileLoop(DoWhileStatement statement)` Visits a DoWhileStatement.
    `` | `public void` | `visitEmptyExpression(EmptyExpression expression)` Visits an EmptyExpression.
    `` | `public void` | `visitEmptyStatement(EmptyStatement statement)` Visits an EmptyStatement.
    `` | `public void` | `visitExpressionStatement(ExpressionStatement statement)` Visits an ExpressionStatement.
    `` | `public void` | `visitFieldExpression(FieldExpression expression)` Visits a FieldExpression.
    `` | `public void` | `visitForLoop(ForStatement statement)` Visits a ForStatement.
    `` | `public void` | `visitGStringExpression(GStringExpression expression)` Visits a GStringExpression.
    `` | `public void` | `visitIfElse(IfStatement statement)` Visits an IfStatement.
    `` | `public void` | `visitLambdaExpression(LambdaExpression expression)` Visits a LambdaExpression.
    `` | `public void` | `visitListExpression(ListExpression expression)` Visits a ListExpression.
    `` | `public void` | `visitMapEntryExpression(MapEntryExpression expression)` Visits a MapEntryExpression.
    `` | `public void` | `visitMapExpression(MapExpression expression)` Visits a MapExpression.
    `` | `public void` | `visitMethodCallExpression(MethodCallExpression expression)` Visits a MethodCallExpression.
    `` | `public void` | `visitMethodPointerExpression(MethodPointerExpression expression)` Visits a MethodPointerExpression.
    `` | `public void` | `visitMethodReferenceExpression(MethodReferenceExpression expression)` Visits a MethodReferenceExpression.
    `` | `public void` | `visitNotExpression(NotExpression expression)` Visits a NotExpression.
    `` | `public void` | `visitPostfixExpression(PostfixExpression expression)` Visits a PostfixExpression.
    `` | `public void` | `visitPrefixExpression(PrefixExpression expression)` Visits a PrefixExpression.
    `` | `public void` | `visitPropertyExpression(PropertyExpression expression)` Visits a PropertyExpression.
    `` | `public void` | `visitRangeExpression(RangeExpression expression)` Visits a RangeExpression.
    `` | `public void` | `visitReturnStatement(ReturnStatement statement)` Visits a ReturnStatement.
    `` | `public void` | `visitShortTernaryExpression(ElvisOperatorExpression expression)` Visits an ElvisOperatorExpression (short ternary operator).
    `` | `public void` | `visitSpreadExpression(SpreadExpression expression)` Visits a SpreadExpression.
    `` | `public void` | `visitSpreadMapExpression(SpreadMapExpression expression)` Visits a SpreadMapExpression.
    `` | `public void` | `visitStaticMethodCallExpression(StaticMethodCallExpression expression)` Visits a StaticMethodCallExpression.
    `` | `public void` | `visitSwitch(SwitchStatement statement)` Visits a SwitchStatement.
    `` | `public void` | `visitSynchronizedStatement(SynchronizedStatement statement)` Visits a SynchronizedStatement.
    `` | `public void` | `visitTernaryExpression(TernaryExpression expression)` Visits a TernaryExpression.
    `` | `public void` | `visitThrowStatement(ThrowStatement statement)` Visits a ThrowStatement.
    `` | `public void` | `visitTryCatchFinally(TryCatchStatement statement)` Visits a TryCatchStatement.
    `` | `public void` | `visitTupleExpression(TupleExpression expression)` Visits a TupleExpression.
    `` | `public void` | `visitUnaryMinusExpression(UnaryMinusExpression expression)` Visits a UnaryMinusExpression.
    `` | `public void` | `visitUnaryPlusExpression(UnaryPlusExpression expression)` Visits a UnaryPlusExpression.
    `` | `public void` | `visitVariableExpression(VariableExpression expression)` Visits a VariableExpression.
    `` | `public void` | `visitWhileLoop(WhileStatement statement)` Visits a WhileStatement.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### public void visitArgumentlistExpression(ArgumentListExpression expression)

      Visits an ArgumentListExpression. Default implementation delegates to visitTupleExpression(TupleExpression).

      Parameters:
        `expression` - the argument list expression

    - #### public void visitArrayExpression(ArrayExpression expression)

      Visits an ArrayExpression. Default implementation is no-op.

      Parameters:
        `expression` - the array expression

    - #### public void visitAssertStatement(AssertStatement statement)

      Visits an AssertStatement. Default implementation is no-op.

      Parameters:
        `statement` - the assert statement

    - #### public void visitAttributeExpression(AttributeExpression expression)

      Visits an AttributeExpression. Default implementation delegates to visitPropertyExpression(PropertyExpression).

      Parameters:
        `expression` - the attribute expression

    - #### public void visitBinaryExpression(BinaryExpression expression)

      Visits a BinaryExpression. Default implementation is no-op.

      Parameters:
        `expression` - the binary expression

    - #### public void visitBitwiseNegationExpression(BitwiseNegationExpression expression)

      Visits a BitwiseNegationExpression. Default implementation is no-op.

      Parameters:
        `expression` - the bitwise negation expression

    - #### public void visitBlockStatement(BlockStatement statement)

      Visits a BlockStatement. Default implementation is no-op.

      Parameters:
        `statement` - the block statement

    - #### public void visitBooleanExpression(BooleanExpression expression)

      Visits a BooleanExpression. Default implementation is no-op.

      Parameters:
        `expression` - the boolean expression

    - #### public void visitBreakStatement(BreakStatement statement)

      Visits a BreakStatement. Default implementation is no-op.

      Parameters:
        `statement` - the break statement

    - #### public void visitBytecodeExpression(BytecodeExpression expression)

      Visits a BytecodeExpression. Default implementation is no-op.

      Parameters:
        `expression` - the bytecode expression

    - #### public void visitCaseStatement(CaseStatement statement)

      Visits a CaseStatement. Default implementation is no-op.

      Parameters:
        `statement` - the case statement

    - #### public void visitCastExpression(CastExpression expression)

      Visits a CastExpression. Default implementation is no-op.

      Parameters:
        `expression` - the cast expression

    - #### public void visitCatchStatement(CatchStatement statement)

      Visits a CatchStatement. Default implementation is no-op.

      Parameters:
        `statement` - the catch statement

    - #### public void visitClassExpression(ClassExpression expression)

      Visits a ClassExpression. Default implementation is no-op.

      Parameters:
        `expression` - the class expression

    - #### public void visitClosureExpression(ClosureExpression expression)

      Visits a ClosureExpression. Default implementation is no-op.

      Parameters:
        `expression` - the closure expression

    - #### public void visitClosureListExpression(ClosureListExpression expression)

      Visits a ClosureListExpression. Default implementation delegates to visitListExpression(ListExpression).

      Parameters:
        `expression` - the closure list expression

    - #### public void visitConstantExpression(ConstantExpression expression)

      Visits a ConstantExpression. Default implementation is no-op.

      Parameters:
        `expression` - the constant expression

    - #### public void visitConstructorCallExpression(ConstructorCallExpression expression)

      Visits a ConstructorCallExpression. Default implementation is no-op.

      Parameters:
        `expression` - the constructor call expression

    - #### public void visitContinueStatement(ContinueStatement statement)

      Visits a ContinueStatement. Default implementation is no-op.

      Parameters:
        `statement` - the continue statement

    - #### public void visitDeclarationExpression(DeclarationExpression expression)

      Visits a DeclarationExpression. Default implementation delegates to visitBinaryExpression(BinaryExpression).

      Parameters:
        `expression` - the declaration expression

    - #### public void visitDoWhileLoop(DoWhileStatement statement)

      Visits a DoWhileStatement. Default implementation is no-op.

      Parameters:
        `statement` - the do-while loop statement

    - #### public void visitEmptyExpression(EmptyExpression expression)

      Visits an EmptyExpression. Default implementation is no-op.

      Parameters:
        `expression` - the empty expression

    - #### public void visitEmptyStatement(EmptyStatement statement)

      Visits an EmptyStatement. Default implementation is no-op.

      Parameters:
        `statement` - the empty statement

    - #### public void visitExpressionStatement(ExpressionStatement statement)

      Visits an ExpressionStatement. Default implementation is no-op.

      Parameters:
        `statement` - the expression statement

    - #### public void visitFieldExpression(FieldExpression expression)

      Visits a FieldExpression. Default implementation is no-op.

      Parameters:
        `expression` - the field expression

    - #### public void visitForLoop(ForStatement statement)

      Visits a ForStatement. Default implementation is no-op.

      Parameters:
        `statement` - the for loop statement

    - #### public void visitGStringExpression(GStringExpression expression)

      Visits a GStringExpression. Default implementation is no-op.

      Parameters:
        `expression` - the GString expression

    - #### public void visitIfElse(IfStatement statement)

      Visits an IfStatement. Default implementation is no-op.

      Parameters:
        `statement` - the if-else statement

    - #### public void visitLambdaExpression(LambdaExpression expression)

      Visits a LambdaExpression. Default implementation delegates to visitClosureExpression(ClosureExpression).

      Parameters:
        `expression` - the lambda expression

    - #### public void visitListExpression(ListExpression expression)

      Visits a ListExpression. Default implementation is no-op.

      Parameters:
        `expression` - the list expression

    - #### public void visitMapEntryExpression(MapEntryExpression expression)

      Visits a MapEntryExpression. Default implementation is no-op.

      Parameters:
        `expression` - the map entry expression

    - #### public void visitMapExpression(MapExpression expression)

      Visits a MapExpression. Default implementation is no-op.

      Parameters:
        `expression` - the map expression

    - #### public void visitMethodCallExpression(MethodCallExpression expression)

      Visits a MethodCallExpression. Default implementation is no-op.

      Parameters:
        `expression` - the method call expression

    - #### public void visitMethodPointerExpression(MethodPointerExpression expression)

      Visits a MethodPointerExpression. Default implementation is no-op.

      Parameters:
        `expression` - the method pointer expression

    - #### public void visitMethodReferenceExpression(MethodReferenceExpression expression)

      Visits a MethodReferenceExpression. Default implementation delegates to visitMethodPointerExpression(MethodPointerExpression).

      Parameters:
        `expression` - the method reference expression

    - #### public void visitNotExpression(NotExpression expression)

      Visits a NotExpression. Default implementation delegates to visitBooleanExpression(BooleanExpression).

      Parameters:
        `expression` - the not expression

    - #### public void visitPostfixExpression(PostfixExpression expression)

      Visits a PostfixExpression. Default implementation is no-op.

      Parameters:
        `expression` - the postfix expression

    - #### public void visitPrefixExpression(PrefixExpression expression)

      Visits a PrefixExpression. Default implementation is no-op.

      Parameters:
        `expression` - the prefix expression

    - #### public void visitPropertyExpression(PropertyExpression expression)

      Visits a PropertyExpression. Default implementation is no-op.

      Parameters:
        `expression` - the property expression

    - #### public void visitRangeExpression(RangeExpression expression)

      Visits a RangeExpression. Default implementation is no-op.

      Parameters:
        `expression` - the range expression

    - #### public void visitReturnStatement(ReturnStatement statement)

      Visits a ReturnStatement. Default implementation is no-op.

      Parameters:
        `statement` - the return statement

    - #### public void visitShortTernaryExpression(ElvisOperatorExpression expression)

      Visits an ElvisOperatorExpression (short ternary operator). Default implementation delegates to visitTernaryExpression(TernaryExpression).

      Parameters:
        `expression` - the elvis operator expression

    - #### public void visitSpreadExpression(SpreadExpression expression)

      Visits a SpreadExpression. Default implementation is no-op.

      Parameters:
        `expression` - the spread expression

    - #### public void visitSpreadMapExpression(SpreadMapExpression expression)

      Visits a SpreadMapExpression. Default implementation is no-op.

      Parameters:
        `expression` - the spread map expression

    - #### public void visitStaticMethodCallExpression(StaticMethodCallExpression expression)

      Visits a StaticMethodCallExpression. Default implementation is no-op.

      Parameters:
        `expression` - the static method call expression

    - #### public void visitSwitch(SwitchStatement statement)

      Visits a SwitchStatement. Default implementation is no-op.

      Parameters:
        `statement` - the switch statement

    - #### public void visitSynchronizedStatement(SynchronizedStatement statement)

      Visits a SynchronizedStatement. Default implementation is no-op.

      Parameters:
        `statement` - the synchronized statement

    - #### public void visitTernaryExpression(TernaryExpression expression)

      Visits a TernaryExpression. Default implementation is no-op.

      Parameters:
        `expression` - the ternary expression

    - #### public void visitThrowStatement(ThrowStatement statement)

      Visits a ThrowStatement. Default implementation is no-op.

      Parameters:
        `statement` - the throw statement

    - #### public void visitTryCatchFinally(TryCatchStatement statement)

      Visits a TryCatchStatement. Default implementation is no-op.

      Parameters:
        `statement` - the try-catch-finally statement

    - #### public void visitTupleExpression(TupleExpression expression)

      Visits a TupleExpression. Default implementation is no-op.

      Parameters:
        `expression` - the tuple expression

    - #### public void visitUnaryMinusExpression(UnaryMinusExpression expression)

      Visits a UnaryMinusExpression. Default implementation is no-op.

      Parameters:
        `expression` - the unary minus expression

    - #### public void visitUnaryPlusExpression(UnaryPlusExpression expression)

      Visits a UnaryPlusExpression. Default implementation is no-op.

      Parameters:
        `expression` - the unary plus expression

    - #### public void visitVariableExpression(VariableExpression expression)

      Visits a VariableExpression. Default implementation is no-op.

      Parameters:
        `expression` - the variable expression

    - #### public void visitWhileLoop(WhileStatement statement)

      Visits a WhileStatement. Default implementation is no-op.

      Parameters:
        `statement` - the while loop statement