| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tools.ant.util.RegexpPatternMapper
public class RegexpPatternMapper
Implementation of FileNameMapper that does regular expression replacements.
| Field Summary | |
|---|---|
| protected  RegexpMatcher | reg | 
| protected  java.lang.StringBuffer | result | 
| protected  char[] | to | 
| Constructor Summary | |
|---|---|
| RegexpPatternMapper()Constructor for RegexpPatternMapper. | |
| Method Summary | |
|---|---|
|  java.lang.String[] | mapFileName(java.lang.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  java.lang.String | replaceReferences(java.lang.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(java.lang.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(java.lang.String to)Sets the "to" pattern. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected RegexpMatcher reg
protected char[] to
protected java.lang.StringBuffer result
| Constructor Detail | 
|---|
public RegexpPatternMapper()
                    throws BuildException
BuildException - on error.| Method Detail | 
|---|
public void setHandleDirSep(boolean handleDirSep)
handleDirSep - a boolean, default is false.public void setCaseSensitive(boolean caseSensitive)
caseSensitive - a boolean, default is false.
public void setFrom(java.lang.String from)
             throws BuildException
setFrom in interface FileNameMapperfrom - the from pattern.
BuildException - on error.public void setTo(java.lang.String to)
setTo in interface FileNameMapperto - the to pattern.
BuildException - on error.public java.lang.String[] mapFileName(java.lang.String sourceFileName)
mapFileName in interface FileNameMappersourceFileName - the source file name
protected java.lang.String replaceReferences(java.lang.String source)
source - the source file name.
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||