Package: org.codehaus.groovy.control.customizers

## [Java] Class DelegatingCustomizer

- org.codehaus.groovy.control.customizers.DelegatingCustomizer

- All Implemented Interfaces and Traits:
    CompilationUnitAware

      public abstract class DelegatingCustomizer
      extends CompilationCustomizer
      implements CompilationUnitAware

  Base class for compilation customizers which delegate to another customizer. The phase this customizer runs at is retrieved from the phase of the delegate.

  Since:
    2.1.0

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `protected CompilationCustomizer` | `delegate` | Customizer that receives delegated callbacks.

  - ### Constructor Summary

    Constructors
    Constructor and description
    `DelegatingCustomizer(CompilationCustomizer delegate)` Creates a delegating customizer backed by another customizer.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `call(SourceUnit source, GeneratorContext context, ClassNode classNode)` Delegates customization of the supplied class node.
    `` | `public void` | `setCompilationUnit(CompilationUnit compilationUnit)` Forwards the compilation unit to the delegate when it supports the callback.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class CompilationCustomizer` | `getPhase`

- - ### Field Detail

    - #### protected final CompilationCustomizer delegate

      Customizer that receives delegated callbacks.

  - ### Constructor Detail

    - #### public DelegatingCustomizer(CompilationCustomizer delegate)

      Creates a delegating customizer backed by another customizer.

      Parameters:
        `delegate` - the customizer to delegate to

  - ### Method Detail

    - #### public void call(SourceUnit source, GeneratorContext context, ClassNode classNode)

      Delegates customization of the supplied class node.

      throws:
        CompilationFailedException if the delegate fails
      Parameters:
        `source` - the source unit being compiled
        `context` - the current generator context
        `classNode` - the class node being customized

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

      Forwards the compilation unit to the delegate when it supports the callback.

      Parameters:
        `compilationUnit` - the active compilation unit