org.apache.tools.ant.util
Class RegexpPatternMapper
java.lang.Object
org.apache.tools.ant.util.RegexpPatternMapper
- FileNameMapper
public class RegexpPatternMapper
extends java.lang.Object
Implementation of FileNameMapper that does regular expression
replacements.
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.
|
protected String | replaceReferences(String source) - Replace all backreferences in the to pattern with the matched
groups of the source.
|
void | setCaseSensitive(boolean caseSensitive) - Attribute specifing whether to ignore the case difference
in the names.
|
void | setFrom(String from) - Sets the "from" pattern.
|
void | setHandleDirSep(boolean handleDirSep) - Attribute specifing whether to ignore the difference
between / and \ (the two common directory characters).
|
void | setTo(String to) - Sets the "to" pattern.
|
result
protected StringBuffer result
RegexpPatternMapper
public RegexpPatternMapper()
throws BuildException
Constructor for RegexpPatternMapper.
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
sourceFileName
- the source file name
- a one-element array containing the translated file or
null if the to pattern did not match
replaceReferences
protected String replaceReferences(String source)
Replace all backreferences in the to pattern with the matched
groups of the source.
source
- the source file name.
- the translated file name.
setCaseSensitive
public void setCaseSensitive(boolean caseSensitive)
Attribute specifing whether to ignore the case difference
in the names.
caseSensitive
- a boolean, default is false.
setHandleDirSep
public void setHandleDirSep(boolean handleDirSep)
Attribute specifing whether to ignore the difference
between / and \ (the two common directory characters).
handleDirSep
- a boolean, default is false.
setTo
public void setTo(String to)
Sets the "to" pattern. Required.
- setTo in interface FileNameMapper