it.haefelinger.flaka
Class When

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by it.haefelinger.flaka.Task
              extended by it.haefelinger.flaka.When
All Implemented Interfaces:
Cloneable, TaskContainer
Direct Known Subclasses:
Unless

public class When
extends Task
implements TaskContainer

A task to simulate a else-less if statement.

Since:
1.0
Author:
merzedes

Field Summary
protected  List tasklist
           
protected  String test
           
 
Fields inherited from class it.haefelinger.flaka.Task
debug, el
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
When()
           
 
Method Summary
 void addTask(Task task)
           
protected  boolean eval()
          Evalutes the internal test condition.
 void exec()
          Executes the when body.
 void execute()
          Evalutes the test condition and if true, executes the body.
 void setTest(String s)
          The test that must evaluate to true in order to execute the body.
 
Methods inherited from class it.haefelinger.flaka.Task
debug, debug, error, error, getProperty, getref, info, log, setDebug, setEl, throwbx, throwbx, toFile, verbose, warn, warn
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

test

protected String test

tasklist

protected List tasklist
Constructor Detail

When

public When()
Method Detail

setTest

public void setTest(String s)
The test that must evaluate to true in order to execute the body.


addTask

public void addTask(Task task)
Specified by:
addTask in interface TaskContainer

eval

protected boolean eval()
                throws BuildException
Evalutes the internal test condition.

Returns:
true if the condition evalutes to true of if no condition is given.
Throws:
BuildException

exec

public void exec()
          throws BuildException
Executes the when body.

Throws:
BuildException

execute

public void execute()
             throws BuildException
Evalutes the test condition and if true, executes the body.

Overrides:
execute in class Task
Throws:
BuildException
See Also:
Sequential.execute()