org.apache.tools.ant.util

Class PackageNameMapper

Implemented Interfaces:
FileNameMapper

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"/>
 

Field Summary

Fields inherited from class org.apache.tools.ant.util.GlobPatternMapper

fromPostfix, fromPrefix, postfixLength, prefixLength, toPostfix, toPrefix

Method Summary

protected String
extractVariablePart(String name)
Returns the part of the given string that matches the * in the "from" pattern replacing file separators with dots

Methods inherited from class org.apache.tools.ant.util.GlobPatternMapper

extractVariablePart, mapFileName, setFrom, setTo

Method Details

extractVariablePart

protected String extractVariablePart(String name)
Returns the part of the given string that matches the * in the "from" pattern replacing file separators with dots
Overrides:
extractVariablePart in interface GlobPatternMapper

Parameters:
name - Source filename

Returns:
Replaced variable part


Copyright B) 2000-2005 Apache Software Foundation. All Rights Reserved.