Package: groovy.ant

## [Java] Class AntBuilder

- groovy.ant.AntBuilder

-     public class AntBuilder
      extends BuilderSupport

  Allows Ant tasks to be used with a Groovy builder-style markup. Requires that `ant.jar` is on your classpath which will happen automatically if you are using the Groovy distribution but will be up to you to organize if you are embedding Groovy. If you wish to use the optional tasks you will need to add one or more additional jars from the ant distribution to your classpath - see the library dependencies for more details.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `AntBuilder ()`
    `AntBuilder (Project project)`
    `AntBuilder (Project project, Target owningTarget)`
    `AntBuilder (Task parentTask)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected static Attributes` | `buildAttributes(Map attributes)` Builds an Attributes from a Map
    `` | `protected Object` | `createNode(Object tagName)`
    `` | `protected Object` | `createNode(Object name, Object value)`
    `` | `protected Object` | `createNode(Object name, Map attributes, Object value)`
    `` | `protected Object` | `createNode(Object name, Map attributes)`
    `` | `protected static Project` | `createProject()` Returns: Factory method to create new Project instances
    `` | `protected Object` | `doInvokeMethod(String methodName, Object name, Object args)` We don't want to return the node as created in createNode(Object, Map, Object) but the one made ready by nodeCompleted(Object, Object)
    `` | `public Project` | `getAntProject()`
    `` | `public AntXMLContext` | `getAntXmlContext()` Gets the xml context of Ant used while creating tasks
    `` | `public Project` | `getProject()` # Gets the Ant project in which the tasks are executed
    `` | `public boolean` | `isSaveStreams()` Whether stdin, stdout, stderr streams are saved.
    `` | `protected void` | `nodeCompleted(Object parent, Object node)` Determines, when the ANT Task that is represented by the "node" should perform.
    `` | `protected void` | `setParent(Object parent, Object child)`
    `` | `public void` | `setSaveStreams(boolean saveStreams)` Indicates that we save stdin, stdout, stderr and replace them while AntBuilder is executing tasks with streams that funnel the normal streams into Ant's logs.
    `` | `protected void` | `setText(Object task, String text)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class BuilderSupport` | `createNode, createNode, createNode, createNode, doInvokeMethod, getCurrent, getName, invokeMethod, invokeMethod, nodeCompleted, postNodeCompletion, setClosureDelegate, setCurrent, setParent`
    `class GroovyObjectSupport` | `getMetaClass, setMetaClass`

- - ### Constructor Detail

    - #### public AntBuilder()

    - #### public AntBuilder(Project project)

    - #### public AntBuilder(Project project, Target owningTarget)

    - #### public AntBuilder(Task parentTask)

  - ### Method Detail

    - #### protected static Attributes buildAttributes(Map attributes)

      Builds an Attributes from a Map

      Parameters:
        `attributes` - the attributes to wrap
      Returns:
        the wrapped attributes

    - #### protected Object createNode(Object tagName)

    - #### protected Object createNode(Object name, Object value)

    - #### protected Object createNode(Object name, Map attributes, Object value)

    - #### protected Object createNode(Object name, Map attributes)

    - #### protected static Project createProject()

      Returns:
        Factory method to create new Project instances

    - #### protected Object doInvokeMethod(String methodName, Object name, Object args)

      We don't want to return the node as created in createNode(Object, Map, Object) but the one made ready by nodeCompleted(Object, Object)

      See Also:
        BuilderSupport.doInvokeMethod

    - #### public Project getAntProject()

    - #### public AntXMLContext getAntXmlContext()

      Gets the xml context of Ant used while creating tasks

      Returns:
        the Ant xml context

    - #### public Project getProject()

      # Gets the Ant project in which the tasks are executed

      Returns:
        the project

    - #### public boolean isSaveStreams()

      Whether stdin, stdout, stderr streams are saved.

      Returns:
        true if we are saving streams
      See Also:
        setSaveStreams(boolean)

    - #### @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value = "DLS_DEAD_LOCAL_STORE", justification = "False positive: bytecode needlessly but harmlessly assigns local to JVM register") protected void nodeCompleted(Object parent, Object node)

      Determines, when the ANT Task that is represented by the "node" should perform. Node must be an ANT Task or no "perform" is called. If node is an ANT Task, it performs right after complete construction. If node is nested in a TaskContainer, calling "perform" is delegated to that TaskContainer.

      Parameters:
        `parent` - note: null when node is root
        `node` - the node that now has all its children applied

    - #### protected void setParent(Object parent, Object child)

    - #### public void setSaveStreams(boolean saveStreams)

      Indicates that we save stdin, stdout, stderr and replace them while AntBuilder is executing tasks with streams that funnel the normal streams into Ant's logs.

      Parameters:
        `saveStreams` - set to false to disable this behavior

    - #### protected void setText(Object task, String text)