net.sf.basedb.clients.web.formatter
Class ExtendedPropertyFormatter<T>
java.lang.Object
net.sf.basedb.clients.web.formatter.ExtendedPropertyFormatter<T>
- All Implemented Interfaces:
- Formatter<T>
public class ExtendedPropertyFormatter<T>
- extends Object
- implements Formatter<T>
Formatter for extended property values. The actual property value is formatted
by the supplied formatter. This formatter then checks if the extended
property should be linked by calling the ExtendedProperty.getUrl(Object)
method.
- Version:
- 2.0
- Author:
- nicklas
- Last modified
- $Date: 2008-09-11 22:05:50 +0200 (Thu, 11 Sep 2008) $
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ep
private ExtendedProperty ep
valueFormatter
private Formatter<T> valueFormatter
ExtendedPropertyFormatter
public ExtendedPropertyFormatter(ExtendedProperty ep,
Formatter<T> valueFormatter)
- Create an extended property formatter.
- Parameters:
ep
- The extended propertyvalueFormatter
- Formatter to use for the values
format
public String format(T value)
- Description copied from interface:
Formatter
- Format a value by converting it to a string.
- Specified by:
format
in interface Formatter<T>
- Parameters:
value
- The value to format
- Returns:
- A formatted string
parseString
public T 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 interface Formatter<T>
- Parameters:
value
- The string to parse
- Returns:
- An object