Package groovy.util
Class AntBuilder
- java.lang.Object
- 
- groovy.lang.GroovyObjectSupport
- 
- groovy.util.BuilderSupport
- 
- groovy.util.AntBuilder
 
 
 
- 
- All Implemented Interfaces:
- GroovyObject
 
 public class AntBuilder extends BuilderSupport Allows Ant tasks to be used with a Groovy builder-style markup. Requires thatant.jaris 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 SummaryConstructors Constructor Description AntBuilder()AntBuilder(org.apache.tools.ant.Project project)AntBuilder(org.apache.tools.ant.Project project, org.apache.tools.ant.Target owningTarget)AntBuilder(org.apache.tools.ant.Task parentTask)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static org.xml.sax.AttributesbuildAttributes(java.util.Map attributes)Builds anAttributesfrom aMapprotected java.lang.ObjectcreateNode(java.lang.Object tagName)protected java.lang.ObjectcreateNode(java.lang.Object name, java.lang.Object value)protected java.lang.ObjectcreateNode(java.lang.Object name, java.util.Map attributes)protected java.lang.ObjectcreateNode(java.lang.Object name, java.util.Map attributes, java.lang.Object value)protected static org.apache.tools.ant.ProjectcreateProject()protected java.lang.ObjectdoInvokeMethod(java.lang.String methodName, java.lang.Object name, java.lang.Object args)We don't want to return the node as created increateNode(Object, Map, Object)but the one made ready bynodeCompleted(Object, Object)org.apache.tools.ant.ProjectgetAntProject()org.apache.tools.ant.helper.AntXMLContextgetAntXmlContext()Gets the xml context of Ant used while creating tasksorg.apache.tools.ant.ProjectgetProject()# Gets the Ant project in which the tasks are executedbooleanisSaveStreams()Whether stdin, stdout, stderr streams are saved.protected voidnodeCompleted(java.lang.Object parent, java.lang.Object node)Determines, when the ANT Task that is represented by the "node" should perform.protected voidsetParent(java.lang.Object parent, java.lang.Object child)voidsetSaveStreams(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 voidsetText(java.lang.Object task, java.lang.String text)- 
Methods inherited from class groovy.util.BuilderSupportgetCurrent, getName, invokeMethod, invokeMethod, postNodeCompletion, setClosureDelegate, setCurrent
 - 
Methods inherited from class groovy.lang.GroovyObjectSupportgetMetaClass, getProperty, setMetaClass, setProperty
 
- 
 
- 
- 
- 
Method Detail- 
getProjectpublic org.apache.tools.ant.Project getProject() # Gets the Ant project in which the tasks are executed- Returns:
- the project
 
 - 
getAntXmlContextpublic org.apache.tools.ant.helper.AntXMLContext getAntXmlContext() Gets the xml context of Ant used while creating tasks- Returns:
- the Ant xml context
 
 - 
isSaveStreamspublic boolean isSaveStreams() Whether stdin, stdout, stderr streams are saved.- Returns:
- true if we are saving streams
- See Also:
- setSaveStreams(boolean)
 
 - 
setSaveStreamspublic 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
 
 - 
createProjectprotected static org.apache.tools.ant.Project createProject() - Returns:
- Factory method to create new Project instances
 
 - 
setParentprotected void setParent(java.lang.Object parent, java.lang.Object child)- Specified by:
- setParentin class- BuilderSupport
 
 - 
doInvokeMethodprotected java.lang.Object doInvokeMethod(java.lang.String methodName, java.lang.Object name, java.lang.Object args)We don't want to return the node as created increateNode(Object, Map, Object)but the one made ready bynodeCompleted(Object, Object)- Overrides:
- doInvokeMethodin class- BuilderSupport
- See Also:
- BuilderSupport.doInvokeMethod(java.lang.String, java.lang.Object, java.lang.Object)
 
 - 
nodeCompletedprotected void nodeCompleted(java.lang.Object parent, java.lang.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.- Overrides:
- nodeCompletedin class- BuilderSupport
- Parameters:
- parent- note: null when node is root
- node- the node that now has all its children applied
 
 - 
createNodeprotected java.lang.Object createNode(java.lang.Object tagName) - Specified by:
- createNodein class- BuilderSupport
 
 - 
createNodeprotected java.lang.Object createNode(java.lang.Object name, java.lang.Object value)- Specified by:
- createNodein class- BuilderSupport
 
 - 
createNodeprotected java.lang.Object createNode(java.lang.Object name, java.util.Map attributes, java.lang.Object value)- Specified by:
- createNodein class- BuilderSupport
 
 - 
buildAttributesprotected static org.xml.sax.Attributes buildAttributes(java.util.Map attributes) Builds anAttributesfrom aMap- Parameters:
- attributes- the attributes to wrap
- Returns:
- the wrapped attributes
 
 - 
createNodeprotected java.lang.Object createNode(java.lang.Object name, java.util.Map attributes)- Specified by:
- createNodein class- BuilderSupport
 
 - 
setTextprotected void setText(java.lang.Object task, java.lang.String text)
 - 
getAntProjectpublic org.apache.tools.ant.Project getAntProject() 
 
- 
 
-