org.apache.myfaces.renderkit.html.util

Class UnicodeEncoder


public abstract class UnicodeEncoder
extends java.lang.Object

Converts Strings so that they can be used within HTML-Code.

Method Summary

static String
encode(String string)
Variant of encode where encodeNewline is false and encodeNbsp is true.
static String
encode(String string, boolean encodeNewline)
Variant of encode where encodeNbsp is true.
static String
encode(String string, boolean encodeNewline, boolean encodeSubsequentBlanksToNbsp)
Encodes the given string, so that it can be used within a html page.

Method Details

encode

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

encode

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