Class ConditionBase
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.taskdefs.condition.ConditionBase
- All Implemented Interfaces:
Cloneable
Baseclass for the <condition> task as well as several
conditions - ensures that the types of conditions inside the task
and the "container" conditions are in sync.
- Since:
- Ant 1.4
-
Field Summary
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
-
Constructor Summary
ModifierConstructorDescriptionprotected
Simple constructor.protected
ConditionBase
(String taskName) Constructor that takes the name of the task in the task name. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add an arbitrary conditionvoid
Add an <and> condition "container".void
Add an <available> condition.void
Add an <checksum> condition.void
addContains
(Contains test) Add a <contains> condition.void
Add an <equals> condition.void
addFilesMatch
(FilesMatch test) Add a <filesmatch> condition.void
Add an <http> condition.void
addIsFalse
(IsFalse test) Add a <isfalse> condition.void
Add an <isfileselected> condition.void
Add an <isreference> condition.void
Add an <isset> condition.void
Add a <istrue> condition.void
Add an <not> condition "container".void
Add an <or> condition "container".void
Add an <os> condition.void
Add a <socket> condition.void
Add an <uptodate> condition.protected int
Count the conditions.protected final Enumeration
<Condition> Iterate through all conditions.Returns the name to use in logging messages.void
setTaskName
(String name) Sets the name to use in logging messages.Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
-
Constructor Details
-
ConditionBase
protected ConditionBase()Simple constructor. -
ConditionBase
Constructor that takes the name of the task in the task name.- Parameters:
taskName
- the name of the task.- Since:
- Ant 1.7
-
-
Method Details
-
countConditions
protected int countConditions()Count the conditions.- Returns:
- the number of conditions in the container
- Since:
- 1.1
-
getConditions
Iterate through all conditions.- Returns:
- an enumeration to use for iteration
- Since:
- 1.1
-
setTaskName
Sets the name to use in logging messages.- Parameters:
name
- The name to use in logging messages. Should not benull
.- Since:
- Ant 1.7
-
getTaskName
Returns the name to use in logging messages.- Returns:
- the name to use in logging messages.
- Since:
- Ant 1.7
-
addAvailable
Add an <available> condition.- Parameters:
a
- an available condition- Since:
- 1.1
-
addChecksum
Add an <checksum> condition.- Parameters:
c
- a Checksum condition- Since:
- 1.4, Ant 1.5
-
addUptodate
Add an <uptodate> condition.- Parameters:
u
- an UpToDate condition- Since:
- 1.1
-
addNot
Add an <not> condition "container".- Parameters:
n
- a Not condition- Since:
- 1.1
-
addAnd
Add an <and> condition "container".- Parameters:
a
- an And condition- Since:
- 1.1
-
addOr
Add an <or> condition "container".- Parameters:
o
- an Or condition- Since:
- 1.1
-
addEquals
Add an <equals> condition.- Parameters:
e
- an Equals condition- Since:
- 1.1
-
addOs
-
addIsSet
Add an <isset> condition.- Parameters:
i
- an IsSet condition- Since:
- Ant 1.5
-
addHttp
Add an <http> condition.- Parameters:
h
- an Http condition- Since:
- Ant 1.5
-
addSocket
Add a <socket> condition.- Parameters:
s
- a Socket condition- Since:
- Ant 1.5
-
addFilesMatch
Add a <filesmatch> condition.- Parameters:
test
- a FilesMatch condition- Since:
- Ant 1.5
-
addContains
Add a <contains> condition.- Parameters:
test
- a Contains condition- Since:
- Ant 1.5
-
addIsTrue
Add a <istrue> condition.- Parameters:
test
- an IsTrue condition- Since:
- Ant 1.5
-
addIsFalse
Add a <isfalse> condition.- Parameters:
test
- an IsFalse condition- Since:
- Ant 1.5
-
addIsReference
Add an <isreference> condition.- Parameters:
i
- an IsReference condition- Since:
- Ant 1.6
-
addIsFileSelected
Add an <isfileselected> condition.- Parameters:
test
- the condition
-
add
-