net.sf.antcontrib.logic.condition

Class BooleanConditionTask

Implemented Interfaces:
Condition

public class BooleanConditionTask
extends TaskAdapter
implements Condition

Wraps a ConditionBase so that the If task can use standard Ant Conditions as its evaluated boolean expression. Wrapping like this means that future additions to ConditionBase will automatically be picked up without modifying this class.

Developed for use with Antelope, migrated to ant-contrib Oct 2003.

Version:
$Revision: 1.3 $
Author:
Dale Anson, danson@germane-software.com

Method Summary

boolean
eval()
Evaluates the condition object.
void
execute()
Forwards to eval().
Object
getProxy()
void
maybeConfigure()
Override maybeConfigure in a way that leaves the nested tasks unconfigured until they get executed.
void
setProperty(String p)
The name of the property to set.
void
setProxy(Object proxy)
void
setValue(String v)
The value for the property to set, if condition evaluates to true.

Method Details

eval

public boolean eval()
Evaluates the condition object.
Returns:
true or false, depending on the evaluation of the condition.

execute

public void execute()
            throws BuildException
Forwards to eval().

getProxy

public Object getProxy()

maybeConfigure

public void maybeConfigure()
            throws BuildException
Override maybeConfigure in a way that leaves the nested tasks unconfigured until they get executed.
Since:
Ant 1.5

setProperty

public void setProperty(String p)
The name of the property to set. Optional.

setProxy

public void setProxy(Object proxy)

setValue

public void setValue(String v)
The value for the property to set, if condition evaluates to true. Defaults to "true".