Package: org.apache.groovy.ast.builder

## [Java] Class AstBuilderTransformation

- org.apache.groovy.ast.builder.AstBuilderTransformation

-     public class AstBuilderTransformation
      extends MethodCallTransformation

  Transformation to capture ASTBuilder from code statements.

  The AstBuilder "from code" approach is used with a single Closure parameter. This transformation converts the ClosureExpression back into source code and rewrites the AST so that the "from string" builder is invoked on the source. In order for this to work, the closure source must be given a goto label. It is the "from string" approach's responsibility to remove the BlockStatement created by the label.

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected GroovyCodeVisitor` | `getTransformer(ASTNode[] nodes, SourceUnit sourceUnit)` Creates the visitor that rewrites `AstBuilder` closure invocations into string-based builder calls.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class MethodCallTransformation` | `getTransformer, visit`

- - ### Method Detail

    - #### protected GroovyCodeVisitor getTransformer(ASTNode[] nodes, SourceUnit sourceUnit)

      Creates the visitor that rewrites `AstBuilder` closure invocations into string-based builder calls.

      Parameters:
        `nodes` - the AST nodes being transformed
        `sourceUnit` - the source unit currently under compilation
      Returns:
        the visitor that performs the rewrite