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

public Class ResourceCount

extends Task
implements Condition
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.taskdefs.condition.Condition
Imports
org.apache.tools.ant.BuildException, .Task, org.apache.tools.ant.taskdefs.condition.Condition, org.apache.tools.ant.types.Comparison, .Reference, .ResourceCollection

Count resources from a ResourceCollection, storing to a property or writing to the log. Can also be used as a Condition.
Since
Ant 1.7

Field Summary

Modifier and TypeField and Description
private Integer
private static final String
private static final String
private String
private ResourceCollection
private Comparison
Inherited from org.apache.tools.ant.Task:
targettaskNametaskTypewrapper

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
add(ResourceCollection
the ResourceCollection to count.
r
)

Add the ResourceCollection to count.

public boolean

Returns:

true if the specified ResourceCollection satisfies the set criteria.
eval
()

Implements org.apache.tools.ant.taskdefs.condition.Condition.eval.

Fulfill the condition contract.
public void
execute()

Overrides org.apache.tools.ant.Task.execute.

Execute as a Task.
public void
setCount(int
number of Resources as int.
c
)

Set the target count number for use as a Condition.

public void
setProperty(String
the property name to set.
p
)

Set the name of the property to set in task mode.

public void
setRefid(Reference
the Reference.
r
)

Set the ResourceCollection reference.

public void
setWhen(Comparison
Comparison (an EnumeratedAttribute) When.
c
)

Set the comparison for use as a Condition.

Inherited from org.apache.tools.ant.Task:
bindToOwnergetOwningTargetgetRuntimeConfigurableWrappergetTaskNamegetTaskTypegetWrapperhandleErrorFlushhandleErrorOutputhandleFlushhandleInputhandleOutputinitisInvalidloglogloglogmaybeConfigureperformreconfiguresetOwningTargetsetRuntimeConfigurableWrappersetTaskNamesetTaskType

Field Detail

countback to summary
private Integer count
COUNT_REQUIREDback to summary
private static final String COUNT_REQUIRED
ONE_NESTED_MESSAGEback to summary
private static final String ONE_NESTED_MESSAGE
propertyback to summary
private String property
rcback to summary
private ResourceCollection rc
whenback to summary
private Comparison when

Constructor Detail

ResourceCountback to summary
public ResourceCount()

Method Detail

addback to summary
public void add(ResourceCollection r)

Add the ResourceCollection to count.

Parameters
r:ResourceCollection

the ResourceCollection to count.

Exceptions
BuildException:
if already set.
evalback to summary
public boolean eval()

Implements org.apache.tools.ant.taskdefs.condition.Condition.eval.

Fulfill the condition contract.

Returns:boolean

true if the specified ResourceCollection satisfies the set criteria.

Annotations
@Override
Exceptions
BuildException:
if an error occurs.
executeback to summary
public void execute()

Overrides org.apache.tools.ant.Task.execute.

Execute as a Task.

Annotations
@Override
setCountback to summary
public void setCount(int c)

Set the target count number for use as a Condition.

Parameters
c:int

number of Resources as int.

setPropertyback to summary
public void setProperty(String p)

Set the name of the property to set in task mode.

Parameters
p:String

the property name to set.

setRefidback to summary
public void setRefid(Reference r)

Set the ResourceCollection reference.

Parameters
r:Reference

the Reference.

setWhenback to summary
public void setWhen(Comparison c)

Set the comparison for use as a Condition.

Parameters
c:Comparison

Comparison (an EnumeratedAttribute) When.

See Also
org.apache.tools.ant.types.Comparison