net.sf.anupam.csv.formatters
Class FirstWordFormatter
java.lang.Object
net.sf.anupam.csv.formatters.FirstWordFormatter
- All Implemented Interfaces:
- CSVFieldFormatter
final class FirstWordFormatter
- extends Object
- implements CSVFieldFormatter
A formatter
that returns the first word
of the specified CSV value. This is useful in situations such as
extracting the first name.
- Since:
- 1.5
- Version:
- $Revision: 1.3 $
- Author:
- Anupam Sengupta
- See Also:
LastWordFormatter
- CSV Formatter Mapping:
CSV Formatter Name: "firstWord" |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FirstWordFormatter
public FirstWordFormatter()
- Constructor for FirstWordFormatter.
format
public String format(String value)
- Formats the value and returns the first word.
- Specified by:
format
in interface CSVFieldFormatter
- Parameters:
value
- the value to be transformed
- Returns:
- the first word from the input value
- See Also:
CSVFieldFormatter.format(String)
© Anupam Sengupta 2005