net.sf.antcontrib.logic
Class For

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--net.sf.antcontrib.logic.For

public class For
extends org.apache.tools.ant.Task

Task definition for the for task. This is based on the foreach task but takes a sequential element instead of a target and only works for ant >= 1.6Beta3

Author:
Peter Reilly

Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
For()
          Creates a new For instance.
 
Method Summary
 org.apache.tools.ant.types.Path createPath()
          This is a path that can be used instread of the list attribute to interate over.
 java.lang.Object createSequential()
           
 void execute()
          Run the for task.
 void setDelimiter(java.lang.String delimiter)
          Set the delimiter attribute.
 void setList(java.lang.String list)
          Set the list attribute.
 void setParam(java.lang.String param)
          Set the param attribute.
 void setTrim(boolean trim)
          Set the trim attribute.
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorFlush, handleErrorOutput, handleFlush, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

For

public For()
Creates a new For instance. This checks if the ant version is correct to run this task.

Method Detail

setTrim

public void setTrim(boolean trim)
Set the trim attribute.

Parameters:
trim - if true, trim the value for each iterator.

setList

public void setList(java.lang.String list)
Set the list attribute.

Parameters:
list - a list of delimiter separated tokens.

setDelimiter

public void setDelimiter(java.lang.String delimiter)
Set the delimiter attribute.

Parameters:
delimiter - the delimitier used to separate the tokens in the list attribute. The default is ",".

setParam

public void setParam(java.lang.String param)
Set the param attribute. This is the name of the macrodef attribute that gets set for each iterator of the sequential element.

Parameters:
param - the name of the macrodef attribute.

createPath

public org.apache.tools.ant.types.Path createPath()
This is a path that can be used instread of the list attribute to interate over. If this is set, each path element in the path is used for an interator of the sequential element.

Returns:
the path to be set by the ant script.

createSequential

public java.lang.Object createSequential()
Returns:
a MacroDef#NestedSequential object to be configured

execute

public void execute()
Run the for task. This checks the attributes and nested elements, and if there are ok, it calls doTheTasks() which constructes a macrodef task and a for each interation a macrodef instance.

Overrides:
execute in class org.apache.tools.ant.Task