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

public abstract Class BaseResourceCollectionContainer

extends DataType
implements AppendableResourceCollection, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, org.apache.tools.ant.types.resources.AppendableResourceCollection, org.apache.tools.ant.types.ResourceCollection, java.lang.Iterable
Known Direct Subclasses
org.apache.tools.ant.types.resources.Difference, org.apache.tools.ant.types.resources.Intersect, org.apache.tools.ant.types.resources.Union
Imports
java.io.File, java.util.ArrayList, .Collection, .Collections, .Iterator, .List, .Stack, java.util.stream.Collectors, org.apache.tools.ant.BuildException, .Project, org.apache.tools.ant.types.DataType, .Resource, .ResourceCollection

Base class for ResourceCollections that nest multiple ResourceCollections.
Since
Ant 1.7

Field Summary

Modifier and TypeField and Description
private boolean
private Collection<Resource>
private List<ResourceCollection>
Inherited from org.apache.tools.ant.types.DataType:
checkedref

Constructor Summary

AccessConstructor and Description
public
BaseResourceCollectionContainer()

Create a new BaseResourceCollectionContainer.

public
BaseResourceCollectionContainer(Project
Project
project
)

Create a new BaseResourceCollectionContainer.

Method Summary

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

Implements org.apache.tools.ant.types.resources.AppendableResourceCollection.add.

Add a ResourceCollection to the container.
public synchronized void
addAll(Collection<? extends ResourceCollection>
the Collection whose elements to add.
c
)

Add the Collection of ResourceCollections to the container.

private synchronized Collection<Resource>
public synchronized void
clear()

Clear the container.

public Object

Returns:

a cloned instance.
clone
()

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

Implement clone.
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.
protected abstract Collection<Resource>

Returns:

Collection.
getCollection
()

Template method for subclasses to return a Collection object of Resources.

private BaseResourceCollectionContainer
public final synchronized List<ResourceCollection>

Returns:

List.
getResourceCollections
()

Get the nested ResourceCollections.

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:

a "fail-fast" Iterator.
iterator
()

Implements java.lang.Iterable.iterator.

Fulfill the ResourceCollection contract.
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 BaseResourceCollectionContainer as a String.
Inherited from org.apache.tools.ant.types.DataType:
checkAttributesAllowedcheckChildrenAllowedcircularReferencedieOnCircularReferencedieOnCircularReferencegetCheckedRefgetCheckedRefgetCheckedRefgetCheckedRefgetCheckedRefgetDataTypeNamegetRefidinvokeCircularReferenceCheckisCheckedisReferencenoChildrenAllowedpushAndInvokeCircularReferenceChecksetCheckedsetRefidtooManyAttributes

Field Detail

cacheback to summary
private boolean cache
collback to summary
private Collection<Resource> coll
rcback to summary
private List<ResourceCollection> rc

Constructor Detail

BaseResourceCollectionContainerback to summary
public BaseResourceCollectionContainer()

Create a new BaseResourceCollectionContainer.

BaseResourceCollectionContainerback to summary
public BaseResourceCollectionContainer(Project project)

Create a new BaseResourceCollectionContainer.

Parameters
project:Project

Project

Since
Ant 1.8

Method Detail

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

Implements org.apache.tools.ant.types.resources.AppendableResourceCollection.add.

Add a ResourceCollection to the container.

Parameters
c:ResourceCollection

the ResourceCollection to add.

Annotations
@Override
Exceptions
BuildException:
on error.
addAllback to summary
public synchronized void addAll(Collection<? extends ResourceCollection> c) throws BuildException

Add the Collection of ResourceCollections to the container.

Parameters
c:Collection<? extends ResourceCollection>

the Collection whose elements to add.

Exceptions
BuildException:
on error.
cacheCollectionback to summary
private synchronized Collection<Resource> cacheCollection()
clearback to summary
public synchronized void clear() throws BuildException

Clear the container.

Exceptions
BuildException:
on error.
cloneback to summary
public Object clone()

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

Implement clone. The set of nested resource collections is shallowly cloned.

Returns:Object

a cloned instance.

Annotations
@Override
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.
getCollectionback to summary
protected abstract Collection<Resource> getCollection()

Template method for subclasses to return a Collection object of Resources.

Returns:Collection<Resource>

Collection.

getRefback to summary
private BaseResourceCollectionContainer getRef()
getResourceCollectionsback to summary
public final synchronized List<ResourceCollection> getResourceCollections()

Get the nested ResourceCollections.

Returns:List<ResourceCollection>

List.

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.

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

Implements java.lang.Iterable.iterator.

Fulfill the ResourceCollection contract. The Iterator returned will throw ConcurrentModificationExceptions if ResourceCollections are added to this container while the Iterator is in use.

Returns:Iterator<Resource>

a "fail-fast" Iterator.

Annotations
@Override
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 BaseResourceCollectionContainer as a String.

Returns:String

a descriptive String.

Annotations
@Override