public class RegexpPatternMapper extends Object implements FileNameMapper
| Modifier and Type | Field and Description |
|---|---|
protected RegexpMatcher |
reg |
protected StringBuffer |
result |
protected char[] |
to |
| Constructor and Description |
|---|
RegexpPatternMapper()
Constructor for RegexpPatternMapper.
|
| Modifier and Type | Method and Description |
|---|---|
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 specifying whether to ignore the case difference
in the names.
|
void |
setFrom(String from)
Sets the "from" pattern.
|
void |
setHandleDirSep(boolean handleDirSep)
Attribute specifying whether to ignore the difference
between / and \ (the two common directory characters).
|
void |
setTo(String to)
Sets the "to" pattern.
|
protected RegexpMatcher reg
protected StringBuffer result
protected char[] to
public RegexpPatternMapper()
throws BuildException
BuildException - on error.public String[] mapFileName(String sourceFileName)
mapFileName in interface FileNameMappersourceFileName - the source file nameprotected String replaceReferences(String source)
source - the source file name.public void setCaseSensitive(boolean caseSensitive)
caseSensitive - a boolean, default is false.public void setFrom(String from) throws BuildException
setFrom in interface FileNameMapperfrom - the from pattern.BuildException - on error.public void setHandleDirSep(boolean handleDirSep)
handleDirSep - a boolean, default is false.public void setTo(String to)
setTo in interface FileNameMapperto - the to pattern.BuildException - on error.