FileDocCategorySizeDatePackage
UnPackageNameMapper.javaAPI DocApache Ant 1.701760Wed Dec 13 06:16:20 GMT 2006org.apache.tools.ant.util

UnPackageNameMapper

public class UnPackageNameMapper extends GlobPatternMapper
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">

Fields Summary
Constructors Summary
Methods Summary
protected java.lang.StringextractVariablePart(java.lang.String name)
Returns the part of the given string that matches the * in the "from" pattern replacing dots with file separators

param
name Source filename
return
Replaced variable part

        String var = name.substring(prefixLength,
                name.length() - postfixLength);
        return var.replace('.", File.separatorChar);