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

public abstract Class ConditionBase

extends ProjectComponent
Class Inheritance
Known Direct Subclasses
org.apache.tools.ant.taskdefs.condition.Not, org.apache.tools.ant.taskdefs.condition.Or, org.apache.tools.ant.taskdefs.condition.Xor, org.apache.tools.ant.taskdefs.optional.testing.Funtest.NestedCondition, org.apache.tools.ant.taskdefs.ConditionTask, org.apache.tools.ant.taskdefs.Exit.NestedCondition, org.apache.tools.ant.taskdefs.WaitFor, org.apache.tools.ant.taskdefs.condition.And
Imports
java.util.Collections, .Enumeration, .List, .Vector, org.apache.tools.ant.ProjectComponent, org.apache.tools.ant.taskdefs.Available, .Checksum, .UpToDate

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

Modifier and TypeField and Description
private List<Condition>
private String
taskName

name of the component

Inherited from org.apache.tools.ant.ProjectComponent:
descriptionlocationproject

Constructor Summary

AccessConstructor and Description
protected
ConditionBase()

Simple constructor.

protected
ConditionBase(String
the name of the task.
taskName
)

Constructor that takes the name of the task in the task name.

Method Summary

Modifier and TypeMethod and Description
public void
add(Condition
a condition
c
)

Add an arbitrary condition

public void
addAnd(And
an And condition
a
)

Add an <and> condition "container".

public void
addAvailable(Available
an available condition
a
)

Add an <available> condition.

public void
addChecksum(Checksum
a Checksum condition
c
)

Add an <checksum> condition.

public void
addContains(Contains
a Contains condition
test
)

Add a <contains> condition.

public void
addEquals(Equals
an Equals condition
e
)

Add an <equals> condition.

public void
addFilesMatch(FilesMatch
a FilesMatch condition
test
)

Add a <filesmatch> condition.

public void
addHttp(Http
an Http condition
h
)

Add an <http> condition.

public void
addIsFalse(IsFalse
an IsFalse condition
test
)

Add a <isfalse> condition.

public void
addIsFileSelected(IsFileSelected
the condition
test
)

Add an <isfileselected> condition.

public void
addIsReference(IsReference
an IsReference condition
i
)

Add an <isreference> condition.

public void
addIsSet(IsSet
an IsSet condition
i
)

Add an <isset> condition.

public void
addIsTrue(IsTrue
an IsTrue condition
test
)

Add a <istrue> condition.

public void
addNot(Not
a Not condition
n
)

Add an <not> condition "container".

public void
addOr(Or
an Or condition
o
)

Add an <or> condition "container".

public void
addOs(Os
an Os condition
o
)

Add an <os> condition.

public void
addSocket(Socket
a Socket condition
s
)

Add a <socket> condition.

public void
addUptodate(UpToDate
an UpToDate condition
u
)

Add an <uptodate> condition.

protected int

Returns:

the number of conditions in the container
countConditions
()

Count the conditions.

protected final Enumeration<Condition>

Returns:

an enumeration to use for iteration
getConditions
()

Iterate through all conditions.

public String

Returns:

the name to use in logging messages.
getTaskName
()

Returns the name to use in logging messages.

public void
setTaskName(String
The name to use in logging messages. Should not be null.
name
)

Sets the name to use in logging messages.

Inherited from org.apache.tools.ant.ProjectComponent:
clonegetDescriptiongetLocationgetProjectloglogsetDescriptionsetLocationsetProject

Field Detail

conditionsback to summary
private List<Condition> conditions
taskNameback to summary
private String taskName

name of the component

Constructor Detail

ConditionBaseback to summary
protected ConditionBase()

Simple constructor.

ConditionBaseback to summary
protected ConditionBase(String taskName)

Constructor that takes the name of the task in the task name.

Parameters
taskName:String

the name of the task.

Since
Ant 1.7

Method Detail

addback to summary
public void add(Condition c)

Add an arbitrary condition

Parameters
c:Condition

a condition

Since
Ant 1.6
addAndback to summary
public void addAnd(And a)

Add an <and> condition "container".

Parameters
a:And

an And condition

Since
1.1
addAvailableback to summary
public void addAvailable(Available a)

Add an <available> condition.

Parameters
a:Available

an available condition

Since
1.1
addChecksumback to summary
public void addChecksum(Checksum c)

Add an <checksum> condition.

Parameters
c:Checksum

a Checksum condition

Since
1.4, Ant 1.5
addContainsback to summary
public void addContains(Contains test)

Add a <contains> condition.

Parameters
test:Contains

a Contains condition

Since
Ant 1.5
addEqualsback to summary
public void addEquals(Equals e)

Add an <equals> condition.

Parameters
e:Equals

an Equals condition

Since
1.1
addFilesMatchback to summary
public void addFilesMatch(FilesMatch test)

Add a <filesmatch> condition.

Parameters
test:FilesMatch

a FilesMatch condition

Since
Ant 1.5
addHttpback to summary
public void addHttp(Http h)

Add an <http> condition.

Parameters
h:Http

an Http condition

Since
Ant 1.5
addIsFalseback to summary
public void addIsFalse(IsFalse test)

Add a <isfalse> condition.

Parameters
test:IsFalse

an IsFalse condition

Since
Ant 1.5
addIsFileSelectedback to summary
public void addIsFileSelected(IsFileSelected test)

Add an <isfileselected> condition.

Parameters
test:IsFileSelected

the condition

addIsReferenceback to summary
public void addIsReference(IsReference i)

Add an <isreference> condition.

Parameters
i:IsReference

an IsReference condition

Since
Ant 1.6
addIsSetback to summary
public void addIsSet(IsSet i)

Add an <isset> condition.

Parameters
i:IsSet

an IsSet condition

Since
Ant 1.5
addIsTrueback to summary
public void addIsTrue(IsTrue test)

Add a <istrue> condition.

Parameters
test:IsTrue

an IsTrue condition

Since
Ant 1.5
addNotback to summary
public void addNot(Not n)

Add an <not> condition "container".

Parameters
n:Not

a Not condition

Since
1.1
addOrback to summary
public void addOr(Or o)

Add an <or> condition "container".

Parameters
o:Or

an Or condition

Since
1.1
addOsback to summary
public void addOs(Os o)

Add an <os> condition.

Parameters
o:Os

an Os condition

Since
1.1
addSocketback to summary
public void addSocket(Socket s)

Add a <socket> condition.

Parameters
s:Socket

a Socket condition

Since
Ant 1.5
addUptodateback to summary
public void addUptodate(UpToDate u)

Add an <uptodate> condition.

Parameters
u:UpToDate

an UpToDate condition

Since
1.1
countConditionsback to summary
protected int countConditions()

Count the conditions.

Returns:int

the number of conditions in the container

Since
1.1
getConditionsback to summary
protected final Enumeration<Condition> getConditions()

Iterate through all conditions.

Returns:Enumeration<Condition>

an enumeration to use for iteration

Since
1.1
getTaskNameback to summary
public String getTaskName()

Returns the name to use in logging messages.

Returns:String

the name to use in logging messages.

Since
Ant 1.7
setTaskNameback to summary
public void setTaskName(String name)

Sets the name to use in logging messages.

Parameters
name:String

The name to use in logging messages. Should not be null.

Since
Ant 1.7