org.apache.tools.ant.taskdefs
Class ConditionTask
- Cloneable, DynamicElement
public class ConditionTask
Task to set a property conditionally using <uptodate>, <available>,
and many other supported conditions.
This task supports boolean logic as well as pluggable conditions
to decide, whether a property should be set.
This task does not extend Task to take advantage of
ConditionBase.
void | execute() - See whether our nested condition holds and set the property.
|
void | setElse(String e) - The value for the property to set, if condition evaluates to false.
|
void | setProperty(String p) - The name of the property to set.
|
void | setValue(String v) - The value for the property to set, if condition evaluates to true.
|
add , addAnd , addAvailable , addChecksum , addContains , addEquals , addFilesMatch , addHttp , addIsFalse , addIsFileSelected , addIsReference , addIsSet , addIsTrue , addNot , addOr , addOs , addSocket , addUptodate , countConditions , createDynamicElement , getConditions , getTaskName , setTaskName |
ConditionTask
public ConditionTask()
Constructor, names this task "condition".
execute
public void execute()
throws BuildException
See whether our nested condition holds and set the property.
setElse
public void setElse(String e)
The value for the property to set, if condition evaluates to false.
If this attribute is not specified, the property will not be set.
e
- the alternate value of the property.
setProperty
public void setProperty(String p)
The name of the property to set. Required.
p
- the name of the property
setValue
public void setValue(String v)
The value for the property to set, if condition evaluates to true.
Defaults to "true".
v
- the value of the property