Package net.sf.antcontrib.logic
Class ForEach
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- net.sf.antcontrib.logic.ForEach
-
- All Implemented Interfaces:
java.lang.Cloneable
public class ForEach extends org.apache.tools.ant.TaskTask definition for the foreach task. The foreach task iterates over a list, a list of filesets, or both.Usage: Task declaration in the project:
<taskdef name="foreach" classname="net.sf.antcontrib.logic.ForEach" />Call Syntax:<foreach list="values" target="targ" param="name" [parallel="true|false"] [delimiter="delim"] />Attributes: list --> The list of values to process, with the delimiter character, indicated by the "delim" attribute, separating each value target --> The target to call for each token, passing the token as the parameter with the name indicated by the "param" attribute param --> The name of the parameter to pass the tokens in as to the target delimiter --> The delimiter string that separates the values in the "list" parameter. The default is "," parallel --> Should all targets execute in parallel. The default is false. trim --> Should we trim the list item before calling the target?- Author:
- Matthew Inger
-
-
Constructor Summary
Constructors Constructor Description ForEach()Default Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddFileset(org.apache.tools.ant.types.FileSet set)Deprecated.Use createPath instead.voidaddParam(org.apache.tools.ant.taskdefs.Property p)Corresponds to<antcall>'s nested<param>element.voidaddReference(org.apache.tools.ant.taskdefs.Ant.Reference r)Corresponds to<antcall>'s nested<reference>element.org.apache.tools.ant.types.MappercreateMapper()org.apache.tools.ant.types.PathcreatePath()voidexecute()protected voidhandleErrorOutput(java.lang.String line)protected voidhandleOutput(java.lang.String line)voidsetDelimiter(java.lang.String delimiter)voidsetInheritall(boolean b)Corresponds to<antcall>'sinheritallattribute.voidsetInheritrefs(boolean b)Corresponds to<antcall>'sinheritrefsattribute.voidsetList(java.lang.String list)voidsetMaxThreads(int maxThreads)Set the maximum amount of threads we're going to allow at once to executevoidsetParallel(boolean parallel)voidsetParam(java.lang.String param)voidsetTarget(java.lang.String target)voidsetTrim(boolean trim)-
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleFlush, handleInput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
-
-
-
-
Method Detail
-
execute
public void execute() throws org.apache.tools.ant.BuildException- Overrides:
executein classorg.apache.tools.ant.Task- Throws:
org.apache.tools.ant.BuildException
-
setTrim
public void setTrim(boolean trim)
-
setList
public void setList(java.lang.String list)
-
setDelimiter
public void setDelimiter(java.lang.String delimiter)
-
setParam
public void setParam(java.lang.String param)
-
setTarget
public void setTarget(java.lang.String target)
-
setParallel
public void setParallel(boolean parallel)
-
setInheritall
public void setInheritall(boolean b)
Corresponds to<antcall>'sinheritallattribute.
-
setInheritrefs
public void setInheritrefs(boolean b)
Corresponds to<antcall>'sinheritrefsattribute.
-
setMaxThreads
public void setMaxThreads(int maxThreads)
Set the maximum amount of threads we're going to allow at once to execute- Parameters:
maxThreads-
-
addParam
public void addParam(org.apache.tools.ant.taskdefs.Property p)
Corresponds to<antcall>'s nested<param>element.
-
addReference
public void addReference(org.apache.tools.ant.taskdefs.Ant.Reference r)
Corresponds to<antcall>'s nested<reference>element.
-
addFileset
public void addFileset(org.apache.tools.ant.types.FileSet set)
Deprecated.Use createPath instead.
-
createPath
public org.apache.tools.ant.types.Path createPath()
-
createMapper
public org.apache.tools.ant.types.Mapper createMapper()
-
handleOutput
protected void handleOutput(java.lang.String line)
- Overrides:
handleOutputin classorg.apache.tools.ant.Task
-
handleErrorOutput
protected void handleErrorOutput(java.lang.String line)
- Overrides:
handleErrorOutputin classorg.apache.tools.ant.Task
-
-