Class MappedResource
- java.lang.Object
- 
- org.apache.tools.ant.ProjectComponent
- 
- org.apache.tools.ant.types.DataType
- 
- org.apache.tools.ant.types.Resource
- 
- org.apache.tools.ant.types.resources.ResourceDecorator
- 
- org.apache.tools.ant.types.resources.MappedResource
 
 
 
 
 
- 
- All Implemented Interfaces:
- java.lang.Cloneable,- java.lang.Comparable<Resource>,- java.lang.Iterable<Resource>,- ResourceCollection
 
 public class MappedResource extends ResourceDecorator A decorator around a different resource that uses a mapper to dynamically remap the resource's name.Strips the FileProvider interface from decorated resources since it may be used to circumvent name mapping. - Since:
- Ant 1.8.0
 
- 
- 
Field Summary- 
Fields inherited from class org.apache.tools.ant.types.ResourceMAGIC, UNKNOWN_DATETIME, UNKNOWN_SIZE
 - 
Fields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
 
- 
 - 
Constructor SummaryConstructors Constructor Description MappedResource(Resource r, FileNameMapper m)Wraps an existing resource.
 - 
Method SummaryModifier and Type Method Description <T> Tas(java.lang.Class<T> clazz)Suppress FileProviderbooleanequals(java.lang.Object other)Equality check based on the resource's name in addition to the resource itself.java.lang.StringgetName()Maps the name.inthashCode()Get the hash code for this Resource.voidsetRefid(Reference r)Not really supported since mapper is never null.java.lang.StringtoString()Get the string representation of this Resource.- 
Methods inherited from class org.apache.tools.ant.types.resources.ResourceDecoratoraddConfigured, compareTo, dieOnCircularReference, getInputStream, getLastModified, getOutputStream, getResource, getSize, isDirectory, isExists, isFilesystemOnly, setDirectory, setExists, setLastModified, setName, setSize
 - 
Methods inherited from class org.apache.tools.ant.types.ResourceasOptional, clone, getMagicNumber, getRef, iterator, size, toLongString
 - 
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, tooManyAttributes
 - 
Methods inherited from class org.apache.tools.ant.ProjectComponentgetDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
 - 
Methods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.apache.tools.ant.types.ResourceCollectionisEmpty, stream
 
- 
 
- 
- 
- 
Constructor Detail- 
MappedResourcepublic MappedResource(Resource r, FileNameMapper m) Wraps an existing resource.- Parameters:
- r- Resource to wrap
- m- FileNameMapper that handles mapping
 
 
- 
 - 
Method Detail- 
getNamepublic java.lang.String getName() Maps the name.- Overrides:
- getNamein class- ResourceDecorator
- Returns:
- the name of the wrapped resource.
 
 - 
setRefidpublic void setRefid(Reference r) Not really supported since mapper is never null.- Overrides:
- setRefidin class- ResourceDecorator
- Parameters:
- r- reference to set
 
 - 
aspublic <T> T as(java.lang.Class<T> clazz) Suppress FileProvider- Overrides:
- asin class- ResourceDecorator
- Type Parameters:
- T- desired type
- Parameters:
- clazz- the type to implement
- Returns:
- resource of a desired type
 
 - 
hashCodepublic int hashCode() Get the hash code for this Resource.- Overrides:
- hashCodein class- ResourceDecorator
- Returns:
- hash code as int.
- Since:
- Ant 1.8.1
 
 - 
equalspublic boolean equals(java.lang.Object other) Equality check based on the resource's name in addition to the resource itself.
 
- 
 
-