org.apache.myfaces.renderkit.html.util

Class UnicodeEncoder

public abstract class UnicodeEncoder extends Object

Converts Strings so that they can be used within HTML-Code.
Method Summary
static Stringencode(String string)
Variant of UnicodeEncoder where encodeNewline is false and encodeNbsp is true.
static Stringencode(String string, boolean encodeNewline)
Variant of UnicodeEncoder where encodeNbsp is true.
static Stringencode(String string, boolean encodeNewline, boolean encodeSubsequentBlanksToNbsp)
Encodes the given string, so that it can be used within a html page.

Method Detail

encode

public static String encode(String string)
Variant of UnicodeEncoder where encodeNewline is false and encodeNbsp is true.

encode

public static String encode(String string, boolean encodeNewline)
Variant of UnicodeEncoder where encodeNbsp is true.

encode

public static String encode(String string, boolean encodeNewline, boolean encodeSubsequentBlanksToNbsp)
Encodes the given string, so that it can be used within a html page.

Parameters: string the string to convert encodeNewline if true newline characters are converted to <br>'s encodeSubsequentBlanksToNbsp if true subsequent blanks are converted to &nbsp;'s