com.projectnine.csvmapper
Class StringToTrimmedStringCsvFieldFormatter

java.lang.Object
  extended by com.projectnine.csvmapper.StringToTrimmedStringCsvFieldFormatter
All Implemented Interfaces:
CsvFieldFormatter

public class StringToTrimmedStringCsvFieldFormatter
extends java.lang.Object
implements CsvFieldFormatter

This CsvFieldFormatter returns the same String it is given except that the white space on either extremity has been removed.

Author:
robweber

Constructor Summary
StringToTrimmedStringCsvFieldFormatter()
           
 
Method Summary
 java.lang.String formatObject(java.lang.Object object)
          Converts an Object to a String.
 java.lang.Object formatString(java.lang.String rawPropertyValue)
          This method converts the String to an Object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringToTrimmedStringCsvFieldFormatter

public StringToTrimmedStringCsvFieldFormatter()
Method Detail

formatString

public java.lang.Object formatString(java.lang.String rawPropertyValue)
Description copied from interface: CsvFieldFormatter
This method converts the String to an Object. If an error occurs during the conversion, a RuntimeException may be thrown here. If that does happen, it is possible that only the current CSV record is tainted. Invoke CsvToObjectMapper.loadNextRecord() and try again.

Specified by:
formatString in interface CsvFieldFormatter
Returns:
An Object representation of the given String.

formatObject

public java.lang.String formatObject(java.lang.Object object)
Description copied from interface: CsvFieldFormatter
Converts an Object to a String.

Specified by:
formatObject in interface CsvFieldFormatter
Parameters:
object - The Object to convert into a String.
Returns:
A String representation of the given Object.


Copyright © 2008. All Rights Reserved.