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

public abstract Class AbstractResourceCollectionWrapper

extends DataType
implements ResourceCollection, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, org.apache.tools.ant.types.ResourceCollection, java.lang.Iterable
Known Direct Subclasses
org.apache.tools.ant.types.resources.BaseResourceCollectionWrapper, org.apache.tools.ant.types.resources.LazyResourceCollectionWrapper
Imports
java.io.File, java.util.Iterator, .Stack, java.util.stream.Collectors, org.apache.tools.ant.BuildException, .Project, org.apache.tools.ant.types.DataType, .Resource, .ResourceCollection

Base class for a ResourceCollection that wraps a single nested ResourceCollection.
Since
Ant 1.8.2

Field Summary

Modifier and TypeField and Description
private boolean
private static final String
private ResourceCollection
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(ResourceCollection
the ResourceCollection to add.
c
)

Add a ResourceCollection to the container.

protected abstract Iterator<Resource>

Returns:

the iterator on the resource collection
createIterator
()

Do create an iterator on the resource collection.

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 of DataType to recurse on all DataType child elements that may have been added.
private AbstractResourceCollectionWrapper
protected final synchronized ResourceCollection

Returns:

a ResourceCollection.
getResourceCollection
()

Get the nested ResourceCollection.

protected abstract int

Returns:

size of resource collection.
getSize
()

Do compute the size of the resource collection.

public synchronized boolean

Returns:

boolean cache flag.
isCache
()

Learn whether to cache collections.

public synchronized boolean

Returns:

whether this is a filesystem-only resource collection.
isFilesystemOnly
()

Implements org.apache.tools.ant.types.ResourceCollection.isFilesystemOnly.

Fulfill the ResourceCollection contract.
public final synchronized Iterator<Resource>

Returns:

an Iterator of Resources.
iterator
()

Implements java.lang.Iterable.iterator.

Fulfill the ResourceCollection contract.
private BuildException
public synchronized void
setCache(boolean
boolean cache flag.
b
)

Set whether to cache collections.

public synchronized int

Returns:

number of elements as int.
size
()

Implements org.apache.tools.ant.types.ResourceCollection.size.

Fulfill the ResourceCollection contract.
public synchronized String

Returns:

a descriptive String.
toString
()

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

Format this AbstractResourceCollectionWrapper as a String.
Inherited from org.apache.tools.ant.types.DataType:
checkAttributesAllowedcheckChildrenAllowedcircularReferenceclonedieOnCircularReferencedieOnCircularReferencegetCheckedRefgetCheckedRefgetCheckedRefgetCheckedRefgetCheckedRefgetDataTypeNamegetRefidinvokeCircularReferenceCheckisCheckedisReferencenoChildrenAllowedpushAndInvokeCircularReferenceChecksetCheckedsetRefidtooManyAttributes

Field Detail

cacheback to summary
private boolean cache
ONE_NESTED_MESSAGEback to summary
private static final String ONE_NESTED_MESSAGE
rcback to summary
private ResourceCollection rc

Constructor Detail

AbstractResourceCollectionWrapperback to summary
public AbstractResourceCollectionWrapper()

Method Detail

addback to summary
public synchronized void add(ResourceCollection c) throws BuildException

Add a ResourceCollection to the container.

Parameters
c:ResourceCollection

the ResourceCollection to add.

Exceptions
BuildException:
on error.
createIteratorback to summary
protected abstract Iterator<Resource> createIterator()

Do create an iterator on the resource collection. The creation of the iterator is allowed to not be thread safe whereas the iterator itself should. The returned iterator will be wrapped into the FailFast one.

Returns:Iterator<Resource>

the iterator on the resource collection

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 of DataType to recurse on all DataType child elements that may have been added.

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 AbstractResourceCollectionWrapper getRef()
getResourceCollectionback to summary
protected final synchronized ResourceCollection getResourceCollection()

Get the nested ResourceCollection.

Returns:ResourceCollection

a ResourceCollection.

Exceptions
BuildException:
if no nested ResourceCollection has been provided.
getSizeback to summary
protected abstract int getSize()

Do compute the size of the resource collection. The implementation of this function is allowed to be not thread safe.

Returns:int

size of resource collection.

isCacheback to summary
public synchronized boolean isCache()

Learn whether to cache collections. Default is true.

Returns:boolean

boolean cache flag.

isFilesystemOnlyback to summary
public synchronized boolean isFilesystemOnly()

Implements org.apache.tools.ant.types.ResourceCollection.isFilesystemOnly.

Fulfill the ResourceCollection contract.

Returns:boolean

whether this is a filesystem-only resource collection.

iteratorback to summary
public final synchronized Iterator<Resource> iterator()

Implements java.lang.Iterable.iterator.

Fulfill the ResourceCollection contract.

Returns:Iterator<Resource>

an Iterator of Resources.

Annotations
@Override
oneNestedback to summary
private BuildException oneNested()
setCacheback to summary
public synchronized void setCache(boolean b)

Set whether to cache collections.

Parameters
b:boolean

boolean cache flag.

sizeback to summary
public synchronized int size()

Implements org.apache.tools.ant.types.ResourceCollection.size.

Fulfill the ResourceCollection contract.

Returns:int

number of elements as int.

Annotations
@Override
toStringback to summary
public synchronized String toString()

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

Format this AbstractResourceCollectionWrapper as a String.

Returns:String

a descriptive String.

Annotations
@Override