| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.apache.tools.ant.util.GlobPatternMapper
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.
| Field Summary | |
| protected  java.lang.String | fromPostfixPart of "from" pattern after the *. | 
| protected  java.lang.String | fromPrefixPart of "from" pattern before the *. | 
| protected  int | postfixLengthLength of the postfix ("from" pattern). | 
| protected  int | prefixLengthLength of the prefix ("from" pattern). | 
| protected  java.lang.String | toPostfixPart of "to" pattern after the *. | 
| protected  java.lang.String | toPrefixPart of "to" pattern before the *. | 
| Constructor Summary | |
| GlobPatternMapper() | |
| Method Summary | |
| protected  java.lang.String | extractVariablePart(java.lang.String name)Returns the part of the given string that matches the * in the "from" pattern. | 
|  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. | 
|  void | setCaseSensitive(boolean caseSensitive)Attribute specifing whether to ignore the case difference in the names. | 
|  void | setFrom(java.lang.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(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 java.lang.String fromPrefix
protected java.lang.String fromPostfix
protected int prefixLength
protected int postfixLength
protected java.lang.String toPrefix
protected java.lang.String toPostfix
| Constructor Detail | 
public GlobPatternMapper()
| 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)
setFrom in interface FileNameMapperfrom - a stringpublic void setTo(java.lang.String to)
setTo in interface FileNameMapperto - a stringpublic java.lang.String[] mapFileName(java.lang.String sourceFileName)
mapFileName in interface FileNameMappersourceFileName - the filename to map
protected java.lang.String extractVariablePart(java.lang.String name)
name - the source file name
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||