Class NiceFormatter
java.lang.Object
net.sf.basedb.clients.web.formatter.NiceFormatter
- All Implemented Interfaces:
ExcelFormatter<String,String>
,Formatter<String>
public class NiceFormatter extends Object implements Formatter<String>, ExcelFormatter<String,String>
Nicely format a string for output on a web page. This means that the string is
encoded by one of the
HTML.niceFormat(String)
methods to prevent pollution
of the generated HTML.- Since:
- 3.2
- Author:
- nicklas
- Last modified
- $Date$
-
Field Summary
Fields Modifier and Type Field Description private int
flags
-
Constructor Summary
Constructors Constructor Description NiceFormatter()
NiceFormatter(int flags)
Create a new formatter with options. -
Method Summary
Modifier and Type Method Description String
format(String value)
Format a value by converting it to a string.String
parseString(String value)
Parse a string and return a value of the correct type.ExcelValue<String>
toExcelValue(String value)
No escaping is needed.
-
Field Details
-
flags
private int flags
-
-
Constructor Details
-
NiceFormatter
public NiceFormatter() -
NiceFormatter
public NiceFormatter(int flags)Create a new formatter with options.- Parameters:
flags
- The flags to use when formatting- See Also:
HTML.niceFormat(String, int)
-
-
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
-