Class MappedResourceCollection
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.types.DataType
org.apache.tools.ant.types.resources.MappedResourceCollection
- All Implemented Interfaces:
- Cloneable,- Iterable<Resource>,- ResourceCollection
Wrapper around a resource collections that maps the names of the
 other collection using a configured mapper.
- Since:
- Ant 1.8.0
- 
Field SummaryFields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds the required nested ResourceCollection.voidadd(FileNameMapper fileNameMapper) Add a nested filenamemapper.clone()Implement clone.Define the mapper to map source to destination files.protected voiddieOnCircularReference(Stack<Object> stk, Project p) Overrides the version of DataType to recurse on all DataType child elements that may have been added.booleanIndicate whether this ResourceCollection is composed entirely of Resources accessible via local filesystem conventions.iterator()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.voidOverrides the base version.intsize()Learn the number of contained Resources.toString()Format this resource collection as a String.Methods inherited from class org.apache.tools.ant.types.DataTypecheckAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributesMethods inherited from class org.apache.tools.ant.ProjectComponentgetDescription, getLocation, getProject, log, log, setDescription, setLocation, setProjectMethods inherited from class java.lang.Objectequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliteratorMethods inherited from interface org.apache.tools.ant.types.ResourceCollectionisEmpty, stream
- 
Constructor Details- 
MappedResourceCollectionpublic MappedResourceCollection()
 
- 
- 
Method Details- 
addAdds the required nested ResourceCollection.- Parameters:
- c- the ResourceCollection to add.
- Throws:
- BuildException- on error.
 
- 
createMapperDefine the mapper to map source to destination files.- Returns:
- a mapper to be configured.
- Throws:
- BuildException- if more than one mapper is defined.
 
- 
addAdd a nested filenamemapper.- Parameters:
- fileNameMapper- the mapper to add.
- Since:
- Ant 1.6.3
 
- 
setEnableMultipleMappingspublic 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
 
- 
setCachepublic void setCache(boolean cache) Set whether to cache collections.- Parameters:
- cache- boolean
- Since:
- Ant 1.8.1
 
- 
isFilesystemOnlypublic boolean isFilesystemOnly()Indicate whether this ResourceCollection is composed entirely of Resources accessible via local filesystem conventions. If true, all resources returned from this collection should respond with aFileProviderwhen asked viaResource.as(java.lang.Class<T>).- Specified by:
- isFilesystemOnlyin interface- ResourceCollection
- Returns:
- whether this is a filesystem-only resource collection.
 
- 
sizepublic int size()Learn the number of contained Resources.- Specified by:
- sizein interface- ResourceCollection
- Returns:
- number of elements as int.
 
- 
iterator
- 
setRefid
- 
clone
- 
dieOnCircularReferenceOverrides the version of DataType to recurse on all DataType child elements that may have been added.- Overrides:
- dieOnCircularReferencein class- DataType
- Parameters:
- stk- the stack of data types to use (recursively).
- p- the project to use to dereference the references.
- Throws:
- BuildException- on error.
 
- 
toString
 
-