Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tools.ant.types.resources
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, 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.Resource
`MAGIC, UNKNOWN_DATETIME, UNKNOWN_SIZE`

Fields inherited from class org.apache.tools.ant.types.DataType
`checked, ref`

Fields inherited from class org.apache.tools.ant.ProjectComponent
`description, location, project`

Constructor Summary
`MappedResource(Resource r, FileNameMapper m)` Wraps an existing resource.

Method Summary
`java.lang.Object` | `as(java.lang.Class clazz)` Suppress FileProvider
`java.lang.String` | `getName()` Maps the name.
`void` | `setRefid(Reference r)` Not really supported since mapper is never null.

Methods inherited from class org.apache.tools.ant.types.resources.ResourceDecorator
`addConfigured, compareTo, dieOnCircularReference, getInputStream, getLastModified, getOutputStream, getResource, getSize, hashCode, isDirectory, isExists, isFilesystemOnly, setDirectory, setExists, setLastModified, setName, setSize`

Methods inherited from class org.apache.tools.ant.types.Resource
`clone, equals, getMagicNumber, iterator, size, toLongString, toString`

Methods inherited from class org.apache.tools.ant.types.DataType
`checkAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributes`

Methods inherited from class org.apache.tools.ant.ProjectComponent
`getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### MappedResource

    public MappedResource(Resource r,
                          FileNameMapper m)

  Wraps an existing resource.

  Parameters:
    `r` - Resource to wrap
    `m` - FileNameMapper that handles mapping

Method Detail

### getName

    public java.lang.String getName()

  Maps the name.

  Overrides:
    `getName` in class `ResourceDecorator`
  Returns:
    the name of the wrapped resource.

### setRefid

    public void setRefid(Reference r)

  Not really supported since mapper is never null.

  Overrides:
    `setRefid` in class `ResourceDecorator`
  Parameters:
    `r` - reference to set

### as

    public java.lang.Object as(java.lang.Class clazz)

  Suppress FileProvider

  Overrides:
    `as` in class `ResourceDecorator`
  Parameters:
    `clazz` - the type to implement

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD