Class StringFormatter
java.lang.Object
net.sf.basedb.clients.web.formatter.StringFormatter
- All Implemented Interfaces:
ExcelFormatter<String,
,String> Formatter<String>
public class StringFormatter
extends Object
implements Formatter<String>, ExcelFormatter<String,String>
Format a string for output on a web page. This means that the string is
encoded by the
HTML.encodeTags(String)
method to prevent pollution
of the generated HTML.- Version:
- 2.0
- Author:
- nicklas
- Last modified
- $Date: 2019-03-13 15:33:25 +0100 (ons, 13 mars 2019) $
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionFormat a value by converting it to a string.parseString
(String value) Parse a string and return a value of the correct type.toExcelValue
(String value) No escaping is needed.
-
Constructor Details
-
StringFormatter
public StringFormatter()Create a new string formatter.
-
-
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<String>
- Parameters:
value
- The string to parse- Returns:
- An object
-
toExcelValue
No escaping is needed.- Specified by:
toExcelValue
in interfaceExcelFormatter<String,
String> - Since:
- 3.15
-