org.apache.myfaces.renderkit.html.util

Class HTMLEncoder

public abstract class HTMLEncoder extends Object

Converts Strings so that they can be used within HTML-Code.
Method Summary
static Stringencode(String string)
Variant of HTMLEncoder where encodeNewline is false and encodeNbsp is true.
static Stringencode(String string, boolean encodeNewline)
Variant of HTMLEncoder 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 HTMLEncoder where encodeNewline is false and encodeNbsp is true.

encode

public static String encode(String string, boolean encodeNewline)
Variant of HTMLEncoder 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