org.xins.common.ant
Class HungarianMapper

java.lang.Object
  extended byorg.xins.common.ant.HungarianMapper
All Implemented Interfaces:
FileNameMapper

public class HungarianMapper
extends Object
implements FileNameMapper

Apache Ant mapper that change the case of the first character of a filename to upper, if it is a lowercase letter.

Since:
XINS 1.0.0
Version:
$Revision: 1.16 $ $Date: 2006/08/28 09:12:35 $
Author:
Anthony Goubard

Constructor Summary
HungarianMapper()
           
 
Method Summary
 String[] mapFileName(String sourceFileName)
          Returns an array containing the target filename(s) for the given source file.
 void setFrom(String from)
          Sets the from part of the transformation rule.
 void setTo(String to)
          Sets the to part of the transformation rule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HungarianMapper

public HungarianMapper()
Method Detail

setFrom

public void setFrom(String from)
Sets the from part of the transformation rule.

Specified by:
setFrom in interface FileNameMapper
Parameters:
from - the from part of the transformation rule.

setTo

public void setTo(String to)
Sets the to part of the transformation rule.

Specified by:
setTo in interface FileNameMapper
Parameters:
to - the to part of the transformation rule.

mapFileName

public String[] mapFileName(String sourceFileName)
                     throws IllegalArgumentException
Returns an array containing the target filename(s) for the given source file.

The implementation of this method checks if the name of the file identified by the specified path starts with a lowercase letter. If it does, then it returns the name with the first character converted to an uppercase character.

Specified by:
mapFileName in interface FileNameMapper
Parameters:
sourceFileName - the path to the file, should not be null.
Returns:
the target filename(s) for the given source file; this implementation always returns a 1-size array, and the element is never null.
Throws:
IllegalArgumentException - if sourceFileName == null.


See http://www.xins.org/.