Top Description Fields Constructors Methods
org.apache.tools.ant.types.resources.selectors

public Class Compare

extends DataType
implements ResourceSelector
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.types.resources.selectors.ResourceSelector
Imports
java.util.Stack, org.apache.tools.ant.BuildException, .Project, org.apache.tools.ant.types.Comparison, .DataType, .Quantifier, .Resource, .ResourceCollection, org.apache.tools.ant.types.resources.Union, org.apache.tools.ant.types.resources.comparators.DelegatedResourceComparator, .ResourceComparator

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

Field Summary

Modifier and TypeField and Description
private Quantifier
private DelegatedResourceComparator
private Union
private Comparison
Inherited from org.apache.tools.ant.types.DataType:
checkedref

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public synchronized void
add(ResourceComparator
the ResourceComparator to add.
c
)

Add a ResourceComparator to this Compare selector.

public synchronized ResourceCollection

Returns:

ResourceCollection.
createControl
()

Create the nested control element.

protected synchronized void
dieOnCircularReference(Stack<Object>
the stack of data types to use (recursively).
stk
,
Project
the project to use to dereference the references.
p
)

Overrides org.apache.tools.ant.types.DataType.dieOnCircularReference.

Overrides the version from DataType to recurse on nested ResourceComparators.
private ResourceSelector
public synchronized boolean
isSelected(Resource
the Resource to check.
r
)

Implements org.apache.tools.ant.types.resources.selectors.ResourceSelector.isSelected.

Return true if this Resource is selected.
private BuildException
public synchronized void
setAgainst(Quantifier
the Quantifier EnumeratedAttribute to use.
against
)

Set the quantifier to be used.

public synchronized void
setWhen(Comparison
the Comparison EnumeratedAttribute to use.
when
)

Set the comparison to be used.

Inherited from org.apache.tools.ant.types.DataType:
checkAttributesAllowedcheckChildrenAllowedcircularReferenceclonedieOnCircularReferencedieOnCircularReferencegetCheckedRefgetCheckedRefgetCheckedRefgetCheckedRefgetCheckedRefgetDataTypeNamegetRefidinvokeCircularReferenceCheckisCheckedisReferencenoChildrenAllowedpushAndInvokeCircularReferenceChecksetCheckedsetRefidtooManyAttributestoString

Field Detail

againstback to summary
private Quantifier against
compback to summary
private DelegatedResourceComparator comp
controlback to summary
private Union control
whenback to summary
private Comparison when

Constructor Detail

Compareback to summary
public Compare()

Method Detail

addback to summary
public synchronized 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:ResourceComparator

the ResourceComparator to add.

createControlback to summary
public synchronized ResourceCollection createControl()

Create the nested control element. These are the resources to compare against.

Returns:ResourceCollection

ResourceCollection.

dieOnCircularReferenceback to summary
protected synchronized void dieOnCircularReference(Stack<Object> stk, Project p) throws BuildException

Overrides org.apache.tools.ant.types.DataType.dieOnCircularReference.

Overrides the version from DataType to recurse on nested ResourceComparators.

Parameters
stk:Stack<Object>

the stack of data types to use (recursively).

p:Project

the project to use to dereference the references.

Exceptions
BuildException:
on error.
getRefback to summary
private ResourceSelector getRef()
isSelectedback to summary
public synchronized boolean isSelected(Resource r)

Implements org.apache.tools.ant.types.resources.selectors.ResourceSelector.isSelected.

Doc from org.apache.tools.ant.types.resources.selectors.ResourceSelector.isSelected.

Return true if this Resource is selected.

Parameters
r:Resource

the Resource to check.

Returns:boolean

whether the Resource was selected.

oneControlback to summary
private BuildException oneControl()
setAgainstback to summary
public synchronized void setAgainst(Quantifier against)

Set the quantifier to be used. Default "all".

Parameters
against:Quantifier

the Quantifier EnumeratedAttribute to use.

setWhenback to summary
public synchronized void setWhen(Comparison when)

Set the comparison to be used. Default "equal".

Parameters
when:Comparison

the Comparison EnumeratedAttribute to use.