org.apache.tools.ant.types.resources

Class MappedResourceCollection

public class MappedResourceCollection extends DataType implements ResourceCollection, Cloneable

Wrapper around a resource collections that maps the names of the other collection using a configured mapper.

Since: Ant 1.8.0

Method Summary
voidadd(ResourceCollection c)
Adds the required nested ResourceCollection.
voidadd(FileNameMapper fileNameMapper)
Add a nested filenamemapper.
Objectclone()
Implement clone.
MappercreateMapper()
Define the mapper to map source to destination files.
protected voiddieOnCircularReference(Stack stk, Project p)
Overrides the version of DataType to recurse on all DataType child elements that may have been added.
booleanisFilesystemOnly()
Iteratoriterator()
voidsetCache(boolean cache)
Set whether to cache collections.
voidsetEnableMultipleMappings(boolean enableMultipleMappings)
Set method of handling mappers that return multiple mappings for a given source path.
voidsetRefid(Reference r)
Overrides the base version.
intsize()

Method Detail

add

public void add(ResourceCollection c)
Adds the required nested ResourceCollection.

Parameters: c the ResourceCollection to add.

Throws: BuildException on error.

add

public void add(FileNameMapper fileNameMapper)
Add a nested filenamemapper.

Parameters: fileNameMapper the mapper to add.

Since: Ant 1.6.3

clone

public Object clone()
Implement clone. The nested resource collection and mapper are copied.

Returns: a cloned instance.

createMapper

public Mapper createMapper()
Define the mapper to map source to destination files.

Returns: a mapper to be configured.

Throws: BuildException if more than one mapper is defined.

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()
{@inheritDoc }

iterator

public Iterator iterator()
{@inheritDoc }

setCache

public void setCache(boolean cache)
Set whether to cache collections.

Since: Ant 1.8.1

setEnableMultipleMappings

public void setEnableMultipleMappings(boolean enableMultipleMappings)
Set method of handling mappers that return multiple mappings for a given source path.

Parameters: enableMultipleMappings If true the type will use all the mappings for a given source path, if false, only the first mapped name is processed. By default, this setting is false to provide backward compatibility with earlier releases.

Since: Ant 1.8.1

setRefid

public void setRefid(Reference r)
Overrides the base version.

Parameters: r the Reference to set.

size

public int size()
{@inheritDoc }