Top Description Fields Constructors Methods
org.apache.tools.ant.taskdefs

public Class ConditionTask

extends ConditionBase
Class Inheritance
Imports
org.apache.tools.ant.BuildException, .Project, .PropertyHelper, org.apache.tools.ant.taskdefs.condition.Condition, .ConditionBase

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 Summary

Modifier and TypeField and Description
private Object
private String
private Object

Constructor Summary

AccessConstructor and Description
public
ConditionTask()

Constructor, names this task "condition".

Method Summary

Modifier and TypeMethod and Description
public void
execute()

See whether our nested condition holds and set the property.

public void
setElse(Object
the alternate value of the property.
alt
)

The value for the property to set, if condition evaluates to false.

public void
setElse(String
the alternate value of the property.
e
)

The value for the property to set, if condition evaluates to false.

public void
setProperty(String
the name of the property
p
)

The name of the property to set.

public void
setValue(Object
the (Object) value of the property
value
)

The value for the property to set, if condition evaluates to true.

public void
setValue(String
the value of the property
v
)

The value for the property to set, if condition evaluates to true.

Inherited from org.apache.tools.ant.taskdefs.condition.ConditionBase:
addaddAndaddAvailableaddChecksumaddContainsaddEqualsaddFilesMatchaddHttpaddIsFalseaddIsFileSelectedaddIsReferenceaddIsSetaddIsTrueaddNotaddOraddOsaddSocketaddUptodatecountConditionsgetConditionsgetTaskNamesetTaskName

Field Detail

alternativeback to summary
private Object alternative
propertyback to summary
private String property
valueback to summary
private Object value

Constructor Detail

ConditionTaskback to summary
public ConditionTask()

Constructor, names this task "condition".

Method Detail

executeback to summary
public void execute() throws BuildException

See whether our nested condition holds and set the property.

Exceptions
BuildException:
if an error occurs
Since
Ant 1.4
setElseback to summary
public void setElse(Object alt)

The 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:Object

the alternate value of the property.

Since
Ant 1.8
setElseback to summary
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.

Parameters
e:String

the alternate value of the property.

Since
Ant 1.6.3
setPropertyback to summary
public void setProperty(String p)

The name of the property to set. Required.

Parameters
p:String

the name of the property

Since
Ant 1.4
setValueback to summary
public void setValue(Object value)

The value for the property to set, if condition evaluates to true. Defaults to "true".

Parameters
value:Object

the (Object) value of the property

Since
Ant 1.8
setValueback to summary
public void setValue(String v)

The value for the property to set, if condition evaluates to true. Defaults to "true".

Parameters
v:String

the value of the property

Since
Ant 1.4