Top Description Fields Constructors Methods
org.apache.tools.ant.types.resources

public Class MappedResource

extends ResourceDecorator
Class Inheritance
Imports
org.apache.tools.ant.types.Reference, .Resource, org.apache.tools.ant.util.FileNameMapper

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

Modifier and TypeField and Description
private final FileNameMapper

Constructor Summary

AccessConstructor and Description
public
MappedResource(Resource
Resource to wrap
r
,
FileNameMapper
FileNameMapper that handles mapping
m
)

Wraps an existing resource.

Method Summary

Modifier and TypeMethod and Description
public <T> T
as(Class<T>
the type to implement
clazz
)

Overrides org.apache.tools.ant.types.resources.ResourceDecorator.as.

Suppress FileProvider
public boolean
equals(Object
the object to check against.
other
)

Overrides org.apache.tools.ant.types.Resource.equals.

Equality check based on the resource's name in addition to the resource itself.
public String
public int
hashCode()

Overrides org.apache.tools.ant.types.resources.ResourceDecorator.hashCode.

Get the hash code for this Resource.
public void
setRefid(Reference
reference to set
r
)

Overrides org.apache.tools.ant.types.resources.ResourceDecorator.setRefid.

Not really supported since mapper is never null.
public String
toString()

Overrides org.apache.tools.ant.types.Resource.toString.

Get the string representation of this Resource.
Inherited from org.apache.tools.ant.types.resources.ResourceDecorator:
addConfiguredcompareTodieOnCircularReferencegetInputStreamgetLastModifiedgetOutputStreamgetResourcegetSizeisDirectoryisExistsisFilesystemOnlysetDirectorysetExistssetLastModifiedsetNamesetSize

Field Detail

mapperback to summary
private final FileNameMapper mapper

Constructor Detail

MappedResourceback to summary
public MappedResource(Resource r, FileNameMapper m)

Wraps an existing resource.

Parameters
r:Resource

Resource to wrap

m:FileNameMapper

FileNameMapper that handles mapping

Method Detail

asback to summary
public <T> T as(Class<T> clazz)

Overrides org.apache.tools.ant.types.resources.ResourceDecorator.as.

Suppress FileProvider

Parameters
<T>

Doc from org.apache.tools.ant.types.Resource.as. desired type

clazz:Class<T>

the type to implement

Returns:T

Doc from org.apache.tools.ant.types.Resource.as.

resource of a desired type

Annotations
@Override
equalsback to summary
public boolean equals(Object other)

Overrides org.apache.tools.ant.types.Resource.equals.

Equality check based on the resource's name in addition to the resource itself.

Parameters
other:Object

Doc from org.apache.tools.ant.types.Resource.equals.

the object to check against.

Returns:boolean

Doc from org.apache.tools.ant.types.Resource.equals.

true if the specified Object is equal to this Resource.

Annotations
@Override
Since
Ant 1.8.1
getNameback to summary
public String getName()

Overrides org.apache.tools.ant.types.resources.ResourceDecorator.getName.

Maps the name.

Returns:String

Doc from org.apache.tools.ant.types.resources.ResourceDecorator.getName.

the name of the wrapped resource.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides org.apache.tools.ant.types.resources.ResourceDecorator.hashCode.

Get the hash code for this Resource.

Returns:int

Doc from org.apache.tools.ant.types.resources.ResourceDecorator.hashCode.

hash code as int.

Annotations
@Override
Since
Ant 1.8.1
setRefidback to summary
public void setRefid(Reference r)

Overrides org.apache.tools.ant.types.resources.ResourceDecorator.setRefid.

Not really supported since mapper is never null.

Parameters
r:Reference

reference to set

Annotations
@Override
toStringback to summary
public String toString()

Overrides org.apache.tools.ant.types.Resource.toString.

Doc from org.apache.tools.ant.types.Resource.toString.

Get the string representation of this Resource.

Returns:String

this Resource formatted as a String.

Annotations
@Override