Top Description Methods
org.apache.tools.ant.util

public Interface FileNameMapper

Known Direct Implementers
org.apache.tools.ant.util.FlatFileNameMapper, org.apache.tools.ant.util.GlobPatternMapper, org.apache.tools.ant.util.IdentityMapper, org.apache.tools.ant.util.MergingMapper, org.apache.tools.ant.util.RegexpPatternMapper, org.apache.tools.ant.taskdefs.Jar.IndexJarsFilenameMapper, org.apache.tools.ant.taskdefs.XSLTProcess.StyleMapper, org.apache.tools.ant.taskdefs.optional.Native2Ascii.ExtMapper, org.apache.tools.ant.taskdefs.rmic.DefaultRmicAdapter.RmicFileNameMapper, org.apache.tools.ant.types.mappers.CutDirsMapper, org.apache.tools.ant.types.mappers.FilterMapper, org.apache.tools.ant.types.optional.ScriptMapper, org.apache.tools.ant.util.ContainerMapper

Interface to be used by SourceFileScanner.

Used to find the name of the target file(s) corresponding to a source file.

The rule by which the file names are transformed is specified via the setFrom and setTo methods. The exact meaning of these is implementation dependent.

Method Summary

Modifier and TypeMethod and Description
public String[]

Returns:

an array of strings if the rule applies to the source file, or null if it does not.
mapFileName
(String
the name of the source file relative to some given basedirectory. Might be null for resources that don't provide a name.
sourceFileName
)

Returns an array containing the target filename(s) for the given source file.

public void
setFrom(String
a string.
from
)

Sets the from part of the transformation rule.

public void
setTo(String
a string.
to
)

Sets the to part of the transformation rule.

Method Detail

mapFileNameback to summary
public String[] mapFileName(String sourceFileName)

Returns an array containing the target filename(s) for the given source file.

if the given rule doesn't apply to the source file, implementation must return null. SourceFileScanner will then omit the source file in question.

Parameters
sourceFileName:String

the name of the source file relative to some given basedirectory. Might be null for resources that don't provide a name.

Returns:String[]

an array of strings if the rule applies to the source file, or null if it does not.

setFromback to summary
public void setFrom(String from)

Sets the from part of the transformation rule.

Parameters
from:String

a string.

setToback to summary
public void setTo(String to)

Sets the to part of the transformation rule.

Parameters
to:String

a string.