2.17.2: 2011-06-17

net.sf.basedb.util.formatter
Interface Formatter<T>

All Known Implementing Classes:
BooleanFormatter, ColorFormatter, DateFormatter, ExportableFieldFormatter, ExtendedPropertyFormatter, FilePathFormatter, IdentifiableFormatter, IntegerFormatter, LookupFormatter, MultiFormatter, NameableFormatter, NumberFormatter, PrefixSuffixFormatter, SpotImageFormatter, StringFormatter, ToStringFormatter, WellCoordinateFormatter

public interface Formatter<T>

A Formatter formats an object to a string suitable for output in a client application. The formatter may optionally also do the reverse, ie. parse a string to an object.

Version:
2.0
Author:
nicklas
Last modified
$Date: 2010-09-29 11:21:45 +0200 (Wed, 29 Sep 2010) $

Method Summary
 String format(T value)
          Format a value by converting it to a string.
 T parseString(String value)
          Parse a string and return a value of the correct type.
 

Method Detail

format

String format(T value)
Format a value by converting it to a string.

Parameters:
value - The value to format
Returns:
A formatted string

parseString

T parseString(String value)
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.

Parameters:
value - The string to parse
Returns:
An object
Since:
2.2

2.17.2: 2011-06-17