Package: org.codehaus.groovy.ast

## [Java] Class ClassCodeExpressionTransformer

- org.codehaus.groovy.ast.ClassCodeExpressionTransformer

- All Implemented Interfaces and Traits:
    ExpressionTransformer

      public abstract class ClassCodeExpressionTransformer
      extends ClassCodeVisitorSupport
      implements ExpressionTransformer

  Transforms expressions in a whole class. Transformed expressions are usually not visited.

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected static void` | `setSourcePosition(Expression target, Expression source)` Transfers the source position to target including its property expression if it has one.
    `` | `public Expression` | `transform(Expression expr)` NOTE: This method does not visit Expressions within Closures, for performance and historical reasons.
    `` | `protected void` | `visitAnnotation(AnnotationNode node)`
    `` | `public void` | `visitAssertStatement(AssertStatement stmt)`
    `` | `public void` | `visitCaseStatement(CaseStatement stmt)`
    `` | `public void` | `visitClosureExpression(ClosureExpression expr)`
    `` | `protected void` | `visitConstructorOrMethod(MethodNode node, boolean isConstructor)`
    `` | `public void` | `visitDoWhileLoop(DoWhileStatement stmt)`
    `` | `public void` | `visitExpressionStatement(ExpressionStatement stmt)`
    `` | `public void` | `visitField(FieldNode node)`
    `` | `public void` | `visitForLoop(ForStatement stmt)`
    `` | `public void` | `visitIfElse(IfStatement stmt)`
    `` | `public void` | `visitProperty(PropertyNode node)`
    `` | `public void` | `visitReturnStatement(ReturnStatement stmt)`
    `` | `public void` | `visitSwitch(SwitchStatement stmt)`
    `` | `public void` | `visitSwitchExpression(SwitchExpression expression)`
    `` | `public void` | `visitSynchronizedStatement(SynchronizedStatement stmt)`
    `` | `public void` | `visitThrowStatement(ThrowStatement stmt)`
    `` | `public void` | `visitWhileLoop(WhileStatement stmt)`
    `` | `public void` | `visitYieldStatement(YieldStatement stmt)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class ClassCodeVisitorSupport` | `addError, getSourceUnit, visitAnnotation, visitAnnotations, visitAnnotations, visitAssertStatement, visitBlockStatement, visitBreakStatement, visitCaseStatement, visitCatchStatement, visitClass, visitClassCodeContainer, visitClosureExpression, visitConstructor, visitConstructorOrMethod, visitContinueStatement, visitDeclarationExpression, visitDoWhileLoop, visitExpressionStatement, visitField, visitForLoop, visitIfElse, visitImports, visitMethod, visitObjectInitializerStatements, visitPackage, visitProperty, visitReturnStatement, visitStatement, visitStatementAnnotations, visitSwitch, visitSynchronizedStatement, visitThrowStatement, visitTryCatchFinally, visitWhileLoop, visitYieldStatement`
    `class CodeVisitorSupport` | `afterSwitchCaseStatementsVisited, afterSwitchCaseStatementsVisited, afterSwitchConditionExpressionVisited, afterSwitchConditionExpressionVisited, visitArgumentlistExpression, visitArrayExpression, visitAssertStatement, visitAttributeExpression, visitBinaryExpression, visitBitwiseNegationExpression, visitBlockStatement, visitBooleanExpression, visitBreakStatement, visitBytecodeExpression, visitCaseStatement, visitCastExpression, visitCatchStatement, visitClassExpression, visitClosureExpression, visitClosureListExpression, visitConstantExpression, visitConstructorCallExpression, visitContinueStatement, visitDeclarationExpression, visitDoWhileLoop, visitEmptyStatement, visitExpressionStatement, visitFieldExpression, visitForLoop, visitGStringExpression, visitIfElse, visitLambdaExpression, visitListExpression, visitMapEntryExpression, visitMapExpression, visitMethodCallExpression, visitMethodPointerExpression, visitMethodReferenceExpression, visitNotExpression, visitPostfixExpression, visitPrefixExpression, visitPropertyExpression, visitRangeExpression, visitReturnStatement, visitShortTernaryExpression, visitSpreadExpression, visitSpreadMapExpression, visitStaticMethodCallExpression, visitSwitch, visitSwitchExpression, visitSynchronizedStatement, visitTernaryExpression, visitThrowStatement, visitTryCatchFinally, visitTupleExpression, visitUnaryMinusExpression, visitUnaryPlusExpression, visitVariableExpression, visitWhileLoop, visitYieldStatement`

- - ### Method Detail

    - #### protected static void setSourcePosition(Expression target, Expression source)

      Transfers the source position to target including its property expression if it has one.

      Parameters:
        `target` - resulting node
        `source` - original node

    - #### public Expression transform(Expression expr)

      NOTE: This method does not visit Expressions within Closures, for performance and historical reasons. If you want those Expressions to be visited, you can do this:

           public class YourTransformer extends ClassCodeExpressionTransformer {
             ...

             @Override
             public Expression transform(final Expression expr) {
               if (expr instanceof ClosureExpression) {
                 expr.visit(this);

                 return expr;
               }
               // ...
             }
           }

    - #### protected void visitAnnotation(AnnotationNode node)

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

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

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

    - #### protected void visitConstructorOrMethod(MethodNode node, boolean isConstructor)

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

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

    - #### public void visitField(FieldNode node)

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

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

    - #### public void visitProperty(PropertyNode node)

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

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

    - #### public void visitSwitchExpression(SwitchExpression expression)

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

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

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

    - #### public void visitYieldStatement(YieldStatement stmt)