Class PackageNameMapper
java.lang.Object
org.apache.tools.ant.util.GlobPatternMapper
org.apache.tools.ant.util.PackageNameMapper
- All Implemented Interfaces:
FileNameMapper
Maps directory name matches into a dotted package name. This is
useful for matching JUnit test cases against their XML formatter
results.
<mapper classname="org.apache.tools.ant.util.PackageNameMapper"
from="*Test.java" to="${test.data.dir}/TEST-*Test.xml"/>
-
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 file separators with dotsMethods 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
-
PackageNameMapper
public PackageNameMapper()
-
-
Method Details
-
extractVariablePart
Returns the part of the given string that matches the * in the "from" pattern replacing file separators with dots- Overrides:
extractVariablePartin classGlobPatternMapper- Parameters:
name- Source filename- Returns:
- Replaced variable part
-