org.apache.tools.ant.util
Class GlobPatternMapper
java.lang.Object
org.apache.tools.ant.util.GlobPatternMapper
- FileNameMapper
public class GlobPatternMapper
extends java.lang.Object
Implementation of FileNameMapper that does simple wildcard pattern
replacements.
This does simple translations like *.foo -> *.bar where the
prefix to .foo will be left unchanged. It only handles a single *
character, use regular expressions for more complicated
situations.
This is one of the more useful Mappers, it is used by javac for
example.
protected String | fromPostfix - Part of "from" pattern after the *.
|
protected String | fromPrefix - Part of "from" pattern before the *.
|
protected int | postfixLength - Length of the postfix ("from" pattern).
|
protected int | prefixLength - Length of the prefix ("from" pattern).
|
protected String | toPostfix - Part of "to" pattern after the *.
|
protected String | toPrefix - Part of "to" pattern before the *.
|
protected String | extractVariablePart(String name) - Returns the part of the given string that matches the * in the
"from" pattern.
|
String[] | mapFileName(String sourceFileName) - Returns null if the source file name doesn't match the
"from" pattern, an one-element array containing the
translated file otherwise.
|
void | setFrom(String from) - Sets the "from" pattern.
|
void | setTo(String to) - Sets the "to" pattern.
|
fromPostfix
protected String fromPostfix
Part of "from" pattern after the *.
fromPrefix
protected String fromPrefix
Part of "from" pattern before the *.
postfixLength
protected int postfixLength
Length of the postfix ("from" pattern).
prefixLength
protected int prefixLength
Length of the prefix ("from" pattern).
toPostfix
protected String toPostfix
Part of "to" pattern after the *.
toPrefix
protected String toPrefix
Part of "to" pattern before the *.
extractVariablePart
protected String extractVariablePart(String name)
Returns the part of the given string that matches the * in the
"from" pattern.
mapFileName
public String[] mapFileName(String sourceFileName)
Returns null if the source file name doesn't match the
"from" pattern, an one-element array containing the
translated file otherwise.
- mapFileName in interface FileNameMapper
setFrom
public void setFrom(String from)
Sets the "from" pattern. Required.
- setFrom in interface FileNameMapper
setTo
public void setTo(String to)
Sets the "to" pattern. Required.
- setTo in interface FileNameMapper
Copyright B) 2000-2005 Apache Software Foundation. All Rights Reserved.