org.apache.tools.ant.types.resources

Class Resources

public class Resources extends DataType implements ResourceCollection

Generic ResourceCollection: Either stores nested ResourceCollections, making no attempt to remove duplicates, or references another ResourceCollection.

Since: Ant 1.7

Field Summary
static IteratorEMPTY_ITERATOR
static empty Iterator
static ResourceCollectionNONE
static empty ResourceCollection
Method Summary
voidadd(ResourceCollection c)
Add a ResourceCollection.
protected voiddieOnCircularReference(Stack stk, Project p)
Overrides the version of DataType to recurse on all DataType child elements that may have been added.
booleanisFilesystemOnly()
Fulfill the ResourceCollection contract.
Iteratoriterator()
Fulfill the ResourceCollection contract.
intsize()
Fulfill the ResourceCollection contract.
StringtoString()
Format this BaseResourceCollectionContainer as a String.

Field Detail

EMPTY_ITERATOR

public static final Iterator EMPTY_ITERATOR
static empty Iterator

NONE

public static final ResourceCollection NONE
static empty ResourceCollection

Method Detail

add

public void add(ResourceCollection c)
Add a ResourceCollection.

Parameters: c the ResourceCollection to add.

dieOnCircularReference

protected void dieOnCircularReference(Stack stk, Project p)
Overrides the version of DataType to recurse on all DataType child elements that may have been added.

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

Throws: BuildException on error.

isFilesystemOnly

public boolean isFilesystemOnly()
Fulfill the ResourceCollection contract.

Returns: true if all Resources represent files.

iterator

public Iterator iterator()
Fulfill the ResourceCollection contract.

Returns: an Iterator of Resources.

size

public int size()
Fulfill the ResourceCollection contract.

Returns: number of elements as int.

toString

public String toString()
Format this BaseResourceCollectionContainer as a String.

Returns: a descriptive String.