Package: org.codehaus.groovy.macro.transform

## [Java] Class MacroTransformation

- org.codehaus.groovy.macro.transform.MacroTransformation

- All Implemented Interfaces and Traits:
    CompilationUnitAware

      public class MacroTransformation
      extends MethodCallTransformation
      implements CompilationUnitAware

  Since:
    2.5.0

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `protected CompilationUnit` | `unit` | Compilation unit that owns the current transformation.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected GroovyCodeVisitor` | `getTransformer(ASTNode[] nodes, SourceUnit sourceUnit)` Creates the visitor that rewrites macro method calls.
    `` | `public void` | `setCompilationUnit(CompilationUnit unit)` Stores the current compilation unit for later macro expansion.

  - ### Inherited Methods Summary

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

- - ### Field Detail

    - #### protected CompilationUnit unit

      Compilation unit that owns the current transformation.

  - ### Method Detail

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

      Creates the visitor that rewrites macro method calls.

      Parameters:
        `nodes` - the visited nodes
        `sourceUnit` - the current source unit
      Returns:
        the macro-transforming visitor

    - #### public void setCompilationUnit(CompilationUnit unit)

      Stores the current compilation unit for later macro expansion.

      Parameters:
        `unit` - the current compilation unit