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

PackageNameMapper

public class PackageNameMapper extends GlobPatternMapper
Maps directory name matches into a dotted package name. This is useful for matching JUnit test cases againt their XML formatter results.
<mapper classname="org.apache.tools.ant.util.PackageNameMapper"
from="*Test.java" to="${test.data.dir}/TEST-*Test.xml"/>

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 file separators with dots

param
name Source filename
return
Replaced variable part

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