Package org.apache.tools.ant.taskdefs
Class ConditionTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.taskdefs.condition.ConditionBase
org.apache.tools.ant.taskdefs.ConditionTask
- All Implemented Interfaces:
- Cloneable
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.
- Since:
- Ant 1.4
- 
Field SummaryFields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidexecute()See whether our nested condition holds and set the property.voidThe value for the property to set, if condition evaluates to false.voidThe value for the property to set, if condition evaluates to false.voidThe name of the property to set.voidThe value for the property to set, if condition evaluates to true.voidThe value for the property to set, if condition evaluates to true.Methods inherited from class org.apache.tools.ant.taskdefs.condition.ConditionBaseadd, addAnd, addAvailable, addChecksum, addContains, addEquals, addFilesMatch, addHttp, addIsFalse, addIsFileSelected, addIsReference, addIsSet, addIsTrue, addNot, addOr, addOs, addSocket, addUptodate, countConditions, getConditions, getTaskName, setTaskNameMethods inherited from class org.apache.tools.ant.ProjectComponentclone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
- 
Constructor Details- 
ConditionTaskpublic ConditionTask()Constructor, names this task "condition".
 
- 
- 
Method Details- 
setPropertyThe name of the property to set. Required.- Parameters:
- p- the name of the property
- Since:
- Ant 1.4
 
- 
setValueThe value for the property to set, if condition evaluates to true. Defaults to "true".- Parameters:
- value- the (Object) value of the property
- Since:
- Ant 1.8
 
- 
setValueThe value for the property to set, if condition evaluates to true. Defaults to "true".- Parameters:
- v- the value of the property
- Since:
- Ant 1.4
 
- 
setElseThe value for the property to set, if condition evaluates to false. If this attribute is not specified, the property will not be set.- Parameters:
- alt- the alternate value of the property.
- Since:
- Ant 1.8
 
- 
setElseThe value for the property to set, if condition evaluates to false. If this attribute is not specified, the property will not be set.- Parameters:
- e- the alternate value of the property.
- Since:
- Ant 1.6.3
 
- 
executeSee whether our nested condition holds and set the property.- Throws:
- BuildException- if an error occurs
- Since:
- Ant 1.4
 
 
-