2.17.2: 2011-06-17

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

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

public class StringFormatter
extends Object
implements Formatter<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: 2008-09-11 22:05:50 +0200 (Thu, 11 Sep 2008) $

Constructor Summary
StringFormatter()
          Create a new string formatter.
 
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
 

Constructor Detail

StringFormatter

public StringFormatter()
Create a new string formatter.

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

2.17.2: 2011-06-17