ERXSimpleHTMLFormatter Class Reference

Collaboration diagram for ERXSimpleHTMLFormatter:

Collaboration graph
[legend]

List of all members.

Public Member Functions

String applyFormat (Object anObject) throws IllegalArgumentException
StringBuffer format (Object object, StringBuffer buffer, FieldPosition fp)
String htmlStringFromString (String aString)
Object parseObject (String string, ParsePosition p)
Object parseObject (String inString) throws java.text.ParseException
String stringForObjectValue (Object anObject) throws IllegalArgumentException

Static Public Member Functions

static ERXSimpleHTMLFormatter formatter ()

Static Public Attributes

static final Logger log = Logger.getLogger(ERXSimpleHTMLFormatter.class)

Static Protected Member Functions

static String HTMLTab ()

Static Private Attributes

static ERXSimpleHTMLFormatter _formatter
static String _HTMLTab
static final String ASCIIReturn = "\n"
static final String ASCIITab = "\t"
static final String HTMLReturn = "<br />"


Detailed Description

This is a simple class for converting ASCII strings to HTML and vice versa. In the current implementation, all this class does is convert newlines to HTML breaks and tab characters to HTML <spacer> tags.

Member Function Documentation

String applyFormat ( Object  anObject  )  throws IllegalArgumentException

Applies the HTML formatting to a given string object replacing ASCII formatting with HTML formatting.

Parameters:
anObject to have the formatting applied to
Returns:
formatted object

StringBuffer format ( Object  object,
StringBuffer  buffer,
FieldPosition  fp 
)

The FieldPosition is not important, so this method just calls applyFormat and appends that string to the buffer.

Parameters:
object to be formatted
buffer to have the formatted object appended to
fp ignored parameter
Returns:
buffer after having the format appended to it.

static ERXSimpleHTMLFormatter formatter (  )  [static]

Method used to retrieve the shared instance of the html formatter.

Returns:
shared instance of the html formatter

String htmlStringFromString ( String  aString  ) 

Converts an ASCII string into an HTML string.

Parameters:
aString to be converted
Returns:
html-ified string

static String HTMLTab (  )  [static, protected]

Simple method used to get the url to the spacer gif s.gif from the WOResourceManager.

Returns:
url to the space gif image set in an image ref

Object parseObject ( String  string,
ParsePosition  p 
)

Converts an HTML string into an ASCII string starting from a given parse position.

Parameters:
string HTML string
p current parsing position
Returns:
ASCII representation of the string

Object parseObject ( String  inString  )  throws java.text.ParseException

Converts an HTML string into an ASCII string.

Parameters:
inString HTML string
Returns:
ASCII-fied string

String stringForObjectValue ( Object  anObject  )  throws IllegalArgumentException

Accessor method used to convert an ASCII string into an HTML string.

Parameters:
anObject string to convert


Member Data Documentation

holds the reference to the shared formatter

String _HTMLTab [static, private]

holds a reference to the url of the spacer image

final String ASCIIReturn = "\n" [static, private]

holds the ASCII return string

final String ASCIITab = "\t" [static, private]

holds the ASCII tab string

final String HTMLReturn = "<br />" [static, private]

holds the HTML return string

final Logger log = Logger.getLogger(ERXSimpleHTMLFormatter.class) [static]

logging support


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:12 2012 for Project Wonder by  doxygen 1.5.8