3.2.4: 2013-12-06

net.sf.basedb.clients.web.formatter
Class NiceFormatter

java.lang.Object
  extended by net.sf.basedb.clients.web.formatter.NiceFormatter
All Implemented Interfaces:
Formatter<String>

public class NiceFormatter
extends Object
implements Formatter<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
private  int flags
           
 
Constructor Summary
NiceFormatter()
          Create a new formatter with default options: HTML.LINK_EMAIL + HTML.LINK_URL + HTML.SMART_IMAGES
NiceFormatter(int flags)
          Create a new formatter with options.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

flags

private int flags
Constructor Detail

NiceFormatter

public NiceFormatter()
Create a new formatter with default options: HTML.LINK_EMAIL + HTML.LINK_URL + HTML.SMART_IMAGES


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 Detail

format

public String format(String value)
Description copied from interface: Formatter
Format a value by converting it to a string.

Specified by:
format in interface Formatter<String>
Parameters:
value - The value to format
Returns:
A formatted string

parseString

public String 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<String>
Parameters:
value - The string to parse
Returns:
An object

3.2.4: 2013-12-06