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

# Class CustomizersFactory

java.lang.Object
groovy.util.AbstractFactory
org.codehaus.groovy.control.customizers.builder.CustomizersFactory

All Implemented Interfaces:
  `Factory`, `PostCompletionFactory`

public class CustomizersFactory extends AbstractFactory implements PostCompletionFactory
This factory generates an array of compilation customizers.

Since:
  2.1.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CustomizersFactory()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes)`
  Creates the mutable collection that accumulates compilation customizers.
  `Object`
  `postCompleteNode(FactoryBuilderSupport factory, Object parent, Object node)`
  Converts the collected customizers to an array when node construction completes.
  `void`
  `setChild(FactoryBuilderSupport builder, Object parent, Object child)`
  Adds child customizers to the current collection node.

  ### Methods inherited from class groovy.util.AbstractFactory

  `isHandlesNodeChildren, isLeaf, onFactoryRegistration, onHandleNodeAttributes, onNodeChildren, onNodeCompleted, setParent`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### CustomizersFactory

    public CustomizersFactory()

- ## Method Details

  - ### newInstance

    public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException
    Creates the mutable collection that accumulates compilation customizers.
    Specified by:
      `newInstance` in interface `Factory`
    Parameters:
      `builder` - the active builder
      `name` - the node name
      `value` - the supplied node value
      `attributes` - the node attributes
    Returns:
      a new collection used to gather customizers
    Throws:
      `InstantiationException` - if instance creation fails
      `IllegalAccessException` - if access fails

  - ### setChild

    public void setChild(FactoryBuilderSupport builder, Object parent, Object child)
    Adds child customizers to the current collection node.
    Specified by:
      `setChild` in interface `Factory`
    Overrides:
      `setChild` in class `AbstractFactory`
    Parameters:
      `builder` - the active builder
      `parent` - the parent node
      `child` - the child node

  - ### postCompleteNode

    public Object postCompleteNode(FactoryBuilderSupport factory, Object parent, Object node)
    Converts the collected customizers to an array when node construction completes.
    Specified by:
      `postCompleteNode` in interface `PostCompletionFactory`
    Parameters:
      `factory` - the active builder
      `parent` - the parent node
      `node` - the completed node
    Returns:
      a customizer array or the original node