Package: org.codehaus.groovy.control.customizers.builder

## [Groovy] Class ASTTransformationCustomizerFactory

- org.codehaus.groovy.control.customizers.builder.ASTTransformationCustomizerFactory

-     @CompileStatic
      class ASTTransformationCustomizerFactory
      extends AbstractFactory

  This factory generates an ast transformation customizer.

  Simple syntax:

      builder.ast(ToString)

  With AST transformation options:

      builder.ast(includeNames:true, ToString)

  Since:
    2.1.0

- - ### Constructor Summary

    Constructors
    Constructor and description
    `ASTTransformationCustomizerFactory()`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `boolean` | `isLeaf()` Indicates that `ast` nodes do not accept nested builder content.
    `` | `Object` | `newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes)` Creates an ASTTransformationCustomizer for the supplied annotation and attributes.
    `` | `boolean` | `onHandleNodeAttributes(FactoryBuilderSupport builder, Object node, Map attributes)` Leaves attribute handling to newInstance(FactoryBuilderSupport, Object, Object, Map).

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class AbstractFactory` | `isHandlesNodeChildren, isLeaf, onFactoryRegistration, onHandleNodeAttributes, onNodeChildren, onNodeCompleted, setChild, setParent`

- - ### Constructor Detail

    - #### ASTTransformationCustomizerFactory()

  - ### Method Detail

    - #### @Override
      boolean isLeaf()

      Indicates that `ast` nodes do not accept nested builder content.

      Returns:
        `true`

    - #### @Override
      @CompileDynamic
      Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes)

      Creates an ASTTransformationCustomizer for the supplied annotation and attributes.

      throws:
        InstantiationException if the customizer cannot be instantiated
      throws:
        IllegalAccessException if the customizer cannot be accessed
      Parameters:
        `builder` - the active builder
        `name` - the node name
        `value` - the transformation annotation class
        `attributes` - annotation member values to apply
      Returns:
        a configured ASTTransformationCustomizer

    - #### @Override
      boolean onHandleNodeAttributes(FactoryBuilderSupport builder, Object node, Map attributes)

      Leaves attribute handling to newInstance(FactoryBuilderSupport, Object, Object, Map).

      Parameters:
        `builder` - the active builder
        `node` - the current node
        `attributes` - the node attributes
      Returns:
        `false` to keep the attributes available for instance creation