Class ExportableFieldFormatter
- java.lang.Object
-
- net.sf.basedb.util.export.spotdata.ExportableFieldFormatter
-
- All Implemented Interfaces:
Formatter<ExportableField>
public class ExportableFieldFormatter extends Object implements Formatter<ExportableField>
Formatter implementation that formats an exportable field by returning the column title. SeeExportableField.getTitle()
.Note! Do not confuse this formatter with the formatter returned from
ExportableField.getFormatter()
. That formatter is about formatting the exported values, while this formatter is about formatting the column header.- Version:
- 2.12
- Author:
- Nicklas
- Last modified
- $Date: 2009-05-08 13:30:36 +0200 (fr, 08 maj 2009) $
-
-
Constructor Summary
Constructors Constructor Description ExportableFieldFormatter()
Create a new formatter.ExportableFieldFormatter(String nullValue)
Create a new formatter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
format(ExportableField value)
Format a value by converting it to a string.ExportableField
parseString(String value)
Parse a string and return a value of the correct type.
-
-
-
Field Detail
-
nullValue
private String nullValue
-
-
Constructor Detail
-
ExportableFieldFormatter
public ExportableFieldFormatter()
Create a new formatter. Null values are formatted as an empty string.
-
ExportableFieldFormatter
public ExportableFieldFormatter(String nullValue)
Create a new formatter.- Parameters:
nullValue
- The string to return if a null item is passed toformat(ExportableField)
-
-
Method Detail
-
format
public String format(ExportableField value)
Description copied from interface:Formatter
Format a value by converting it to a string.- Specified by:
format
in interfaceFormatter<ExportableField>
- Parameters:
value
- The value to format- Returns:
- A formatted string
-
parseString
public ExportableField parseString(String value)
Description copied from interface:Formatter
Parse a string and return a value of the correct type. A null input string should (unless otherwise documented by a specific formatter implementation) be allowed and may return null or any other "default" value.- Specified by:
parseString
in interfaceFormatter<ExportableField>
- Parameters:
value
- The string to parse- Returns:
- An object
- Throws:
UnsupportedOperationException
- Always
-
-