net.sf.antcontrib.logic

Class 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?

 
Author:
Matthew Inger

Constructor Summary

ForEach()
Default Constructor

Method Summary

void
addFileset(FileSet set)
Deprecated. Use createPath instead.
void
addParam(Property p)
Corresponds to <antcall>'s nested <param> element.
void
addReference(Ant.Reference r)
Corresponds to <antcall>'s nested <reference> element.
Mapper
createMapper()
Path
createPath()
void
execute()
protected void
handleErrorOutput(String line)
protected void
handleOutput(String line)
void
setDelimiter(String delimiter)
void
setInheritall(boolean b)
Corresponds to <antcall>'s inheritall attribute.
void
setInheritrefs(boolean b)
Corresponds to <antcall>'s inheritrefs attribute.
void
setList(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(String param)
void
setTarget(String target)
void
setTrim(boolean trim)

Constructor Details

ForEach

public ForEach()
Default Constructor

Method Details

addFileset

public void addFileset(FileSet set)

Deprecated. 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
Parameters:
maxThreads -

setParallel

public void setParallel(boolean parallel)

setParam

public void setParam(String param)

setTarget

public void setTarget(String target)

setTrim

public void setTrim(boolean trim)