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

# Class ImportCustomizerFactory

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

All Implemented Interfaces:
  `Factory`

public class ImportCustomizerFactory extends AbstractFactory
This factory allows the generation of an `import customizer`. You may embed several elements:

- normal for "regular" imports
- star for "star" imports
- staticStar for "static star" imports
- alias for imports with alias
- staticMember for static imports of individual members
- module for module imports (JEP 476)

For example:

    builder.imports {
     alias 'AI', 'java.util.concurrent.atomic.AtomicInteger'
     alias 'AL', 'java.util.concurrent.atomic.AtomicLong'
    }

Since:
  2.1.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ImportCustomizerFactory()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `isHandlesNodeChildren()`
  Indicates that import customizer nodes accept nested closure content.
  `Object`
  `newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes)`
  Creates an import customizer and applies any inline import value.
  `boolean`
  `onNodeChildren(FactoryBuilderSupport builder, Object node, Closure childContent)`
  Executes nested builder content against a helper bound to the import customizer.

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

  `isLeaf, onFactoryRegistration, onHandleNodeAttributes, onNodeCompleted, setChild, setParent`

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

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

- ## Constructor Details

  - ### ImportCustomizerFactory

    public ImportCustomizerFactory()

- ## Method Details

  - ### isHandlesNodeChildren

    public boolean isHandlesNodeChildren()
    Indicates that import customizer nodes accept nested closure content.
    Specified by:
      `isHandlesNodeChildren` in interface `Factory`
    Overrides:
      `isHandlesNodeChildren` in class `AbstractFactory`
    Returns:
      `true`

  - ### newInstance

    public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException
    Creates an import customizer and applies any inline import value.
    Parameters:
      `builder` - the active builder
      `name` - the node name
      `value` - the supplied node value
      `attributes` - the node attributes
    Returns:
      a configured `ImportCustomizer`
    Throws:
      `InstantiationException` - if instantiation fails
      `IllegalAccessException` - if access fails

  - ### onNodeChildren

    public boolean onNodeChildren(FactoryBuilderSupport builder, Object node, Closure childContent)
    Executes nested builder content against a helper bound to the import customizer.
    Specified by:
      `onNodeChildren` in interface `Factory`
    Overrides:
      `onNodeChildren` in class `AbstractFactory`
    Parameters:
      `builder` - the active builder
      `node` - the current node
      `childContent` - the nested closure content
    Returns:
      `false` to continue normal processing