Package net.sf.basedb.util.formatter
Class ItemTypeFormatter
java.lang.Object
net.sf.basedb.util.formatter.ItemTypeFormatter
Formatter implementation that converts an integer into it's Item
representation and the uses name() as the formatted value.
- Since:
- 3.0
- Author:
- Nicklas
- Last modified
- $Date: 2011-06-23 11:53:05 +0200 (to, 23 jun 2011) $
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreate a new formatter.ItemTypeFormatter
(String nullValue) Create a new formatter. -
Method Summary
-
Field Details
-
nullValue
-
-
Constructor Details
-
ItemTypeFormatter
public ItemTypeFormatter()Create a new formatter. Null values are formatted as an empty string. -
ItemTypeFormatter
Create a new formatter.- Parameters:
nullValue
- The string to return if a null item is passed toformat(Integer)
-
-
Method Details
-
format
Description copied from interface:Formatter
Format a value by converting it to a string. -
parseString
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<Integer>
- Parameters:
value
- The string to parse- Returns:
- An object
-