org.apache.tools.ant.types.resources

Class MappedResource

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

Constructor Summary
MappedResource(Resource r, FileNameMapper m)
Wraps an existing resource.
Method Summary
Objectas(Class clazz)
Suppress FileProvider
booleanequals(Object other)
Equality check based on the resource's name in addition to the resource itself.
StringgetName()
Maps the name.
inthashCode()
Get the hash code for this Resource.
voidsetRefid(Reference r)
Not really supported since mapper is never null.

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

as

public Object as(Class clazz)
Suppress FileProvider

Parameters: clazz the type to implement

equals

public boolean equals(Object other)
Equality check based on the resource's name in addition to the resource itself.

Since: Ant 1.8.1

getName

public String getName()
Maps the name.

hashCode

public int hashCode()
Get the hash code for this Resource.

Since: Ant 1.8.1

setRefid

public void setRefid(Reference r)
Not really supported since mapper is never null.

Parameters: r reference to set