org.apache.tools.ant.types.resources.selectors

Class Compare

public class Compare extends DataType implements ResourceSelector

ResourceSelector that compares against "control" Resource(s) using ResourceComparators.

Since: Ant 1.7

Method Summary
voidadd(ResourceComparator c)
Add a ResourceComparator to this Compare selector.
ResourceCollectioncreateControl()
Create the nested control element.
protected voiddieOnCircularReference(Stack stk, Project p)
Overrides the version from DataType to recurse on nested ResourceComparators.
booleanisSelected(Resource r)
voidsetAgainst(Quantifier against)
Set the quantifier to be used.
voidsetWhen(Comparison when)
Set the comparison to be used.

Method Detail

add

public void add(ResourceComparator c)
Add a ResourceComparator to this Compare selector. If multiple ResourceComparators are added, they will be processed in LIFO order.

Parameters: c the ResourceComparator to add.

createControl

public ResourceCollection createControl()
Create the nested control element. These are the resources to compare against.

Returns: ResourceCollection.

dieOnCircularReference

protected void dieOnCircularReference(Stack stk, Project p)
Overrides the version from DataType to recurse on nested ResourceComparators.

Parameters: stk the stack of data types to use (recursively). p the project to use to dereference the references.

Throws: BuildException on error.

isSelected

public boolean isSelected(Resource r)
{@inheritDoc }

setAgainst

public void setAgainst(Quantifier against)
Set the quantifier to be used. Default "all".

Parameters: against the Quantifier EnumeratedAttribute to use.

setWhen

public void setWhen(Comparison when)
Set the comparison to be used. Default "equal".

Parameters: when the Comparison EnumeratedAttribute to use.