Class UnPackageNameMapper
java.lang.Object
org.apache.tools.ant.util.GlobPatternMapper
org.apache.tools.ant.util.UnPackageNameMapper
- All Implemented Interfaces:
FileNameMapper
Maps dotted package name matches to a directory name.
This is the inverse of the package mapper.
This is useful for matching XML formatter results against their JUnit test
cases.
<mapper classname="org.apache.tools.ant.util.UnPackageNameMapper"
from="${test.data.dir}/TEST-*Test.xml" to="*Test.java">
-
Field Summary
Fields inherited from class GlobPatternMapper
fromPostfix, fromPrefix, postfixLength, prefixLength, toPostfix, toPrefixModifier and TypeFieldDescriptionprotected StringPart of "from" pattern after the *.protected StringPart of "from" pattern before the *.protected intLength of the postfix ("from" pattern).protected intLength of the prefix ("from" pattern).protected StringPart of "to" pattern after the *.protected StringPart of "to" pattern before the *. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringextractVariablePart(String name) Returns the part of the given string that matches the * in the "from" pattern replacing dots with file separatorsMethods inherited from class GlobPatternMapper
getHandleDirSep, mapFileName, setCaseSensitive, setFrom, setHandleDirSep, setToModifier and TypeMethodDescriptionbooleanAttribute specifying whether to ignore the difference between / and \ (the two common directory characters).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.voidsetCaseSensitive(boolean caseSensitive) Attribute specifying whether to ignore the case difference in the names.voidSets the "from" pattern.voidsetHandleDirSep(boolean handleDirSep) Attribute specifying whether to ignore the difference between / and \ (the two common directory characters).voidSets the "to" pattern.
-
Constructor Details
-
UnPackageNameMapper
public UnPackageNameMapper()
-
-
Method Details
-
extractVariablePart
Returns the part of the given string that matches the * in the "from" pattern replacing dots with file separators- Overrides:
extractVariablePartin classGlobPatternMapper- Parameters:
name- Source filename- Returns:
- Replaced variable part
-