net.sf.antcontrib.logic
Class ForEach
Task
net.sf.antcontrib.logic.ForEach
public class ForEach
extends Task
Task 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?
ForEach
public ForEach()
Default Constructor
addFileset
public void addFileset(FileSet set)
Use createPath instead.
addParam
public void addParam(Property p)
Corresponds to <antcall>
's nested
<param>
element.
addReference
public void addReference(Ant.Reference r)
Corresponds to <antcall>
's nested
<reference>
element.
createMapper
public Mapper createMapper()
createPath
public Path createPath()
execute
public void execute()
throws BuildException
handleErrorOutput
protected void handleErrorOutput(String line)
handleOutput
protected void handleOutput(String line)
setDelimiter
public void setDelimiter(String delimiter)
setInheritall
public void setInheritall(boolean b)
Corresponds to <antcall>
's inheritall
attribute.
setInheritrefs
public void setInheritrefs(boolean b)
Corresponds to <antcall>
's inheritrefs
attribute.
setList
public void setList(String list)
setMaxThreads
public void setMaxThreads(int maxThreads)
Set the maximum amount of threads we're going to allow
at once to execute
setParallel
public void setParallel(boolean parallel)
setParam
public void setParam(String param)
setTarget
public void setTarget(String target)
setTrim
public void setTrim(boolean trim)