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 theExtendedProperty.getUrl(Object)
method.- Version:
- 2.0
- Author:
- nicklas
- Last modified
- $Date: 2012-09-21 10:13:29 +0200 (fr, 21 sep 2012) $
-
-
Field Summary
Fields Modifier and Type Field Description private ExtendedProperty
ep
private Formatter<T>
valueFormatter
-
Constructor Summary
Constructors Constructor Description ExtendedPropertyFormatter(ExtendedProperty ep, Formatter<T> valueFormatter)
Create an extended property formatter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
Field Detail
-
ep
private ExtendedProperty ep
-
-
Constructor Detail
-
ExtendedPropertyFormatter
public ExtendedPropertyFormatter(ExtendedProperty ep, Formatter<T> valueFormatter)
Create an extended property formatter.- Parameters:
ep
- The extended propertyvalueFormatter
- Formatter to use for the values
-
-
Method Detail
-
format
public String format(T value)
Description copied from interface:Formatter
Format a value by converting it to a 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 interfaceFormatter<T>
- Parameters:
value
- The string to parse- Returns:
- An object
-
-