public class ForEach
extends org.apache.tools.ant.Task
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?
| Constructor and Description |
|---|
ForEach()
Default Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFileset(org.apache.tools.ant.types.FileSet set)
Deprecated.
Use createPath instead.
|
void |
addParam(org.apache.tools.ant.taskdefs.Property p)
Corresponds to
<antcall>'s nested
<param> element. |
void |
addReference(org.apache.tools.ant.taskdefs.Ant.Reference r)
Corresponds to
<antcall>'s nested
<reference> element. |
org.apache.tools.ant.types.Mapper |
createMapper() |
org.apache.tools.ant.types.Path |
createPath() |
void |
execute() |
protected void |
handleErrorOutput(java.lang.String line) |
protected void |
handleOutput(java.lang.String line) |
void |
setDelimiter(java.lang.String delimiter) |
void |
setInheritall(boolean b)
Corresponds to
<antcall>'s inheritall
attribute. |
void |
setInheritrefs(boolean b)
Corresponds to
<antcall>'s inheritrefs
attribute. |
void |
setList(java.lang.String list) |
void |
setMaxThreads(int maxThreads)
Set the maximum amount of threads we're going to allow
at once to execute
|
void |
setParallel(boolean parallel) |
void |
setParam(java.lang.String param) |
void |
setTarget(java.lang.String target) |
void |
setTrim(boolean trim) |
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleFlush, handleInput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypepublic void execute()
throws org.apache.tools.ant.BuildException
execute in class org.apache.tools.ant.Taskorg.apache.tools.ant.BuildExceptionpublic void setTrim(boolean trim)
public void setList(java.lang.String list)
public void setDelimiter(java.lang.String delimiter)
public void setParam(java.lang.String param)
public void setTarget(java.lang.String target)
public void setParallel(boolean parallel)
public void setInheritall(boolean b)
<antcall>'s inheritall
attribute.public void setInheritrefs(boolean b)
<antcall>'s inheritrefs
attribute.public void setMaxThreads(int maxThreads)
maxThreads - public void addParam(org.apache.tools.ant.taskdefs.Property p)
<antcall>'s nested
<param> element.public void addReference(org.apache.tools.ant.taskdefs.Ant.Reference r)
<antcall>'s nested
<reference> element.public void addFileset(org.apache.tools.ant.types.FileSet set)
public org.apache.tools.ant.types.Path createPath()
public org.apache.tools.ant.types.Mapper createMapper()
protected void handleOutput(java.lang.String line)
handleOutput in class org.apache.tools.ant.Taskprotected void handleErrorOutput(java.lang.String line)
handleErrorOutput in class org.apache.tools.ant.Task