Package editor.util
Class HTMLEscapeUtil
- java.lang.Object
-
- editor.util.HTMLEscapeUtil
-
public class HTMLEscapeUtil extends Object
Static utilities for writing out HTML
-
-
Field Summary
Fields Modifier and Type Field Description static String
NBSP
Constant representing non-breaking space escape characterstatic String
URL_PARAMETER_SEPARATOR
Character used to separate parameters in a URL query string
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
escape(String string)
Escape a string by replacing all occurrences of special characters (such as > and <) by their corresponding escapes.static String
escape(String string, boolean escapeNewLine)
static String
escapeAttribute(String string)
Escape a string for use as an HTML attribute by replacing all double quotes and '&'.static String
escapeForTextArea(String string)
-
-
-
Field Detail
-
NBSP
public static final String NBSP
Constant representing non-breaking space escape character- See Also:
- Constant Field Values
-
URL_PARAMETER_SEPARATOR
public static final String URL_PARAMETER_SEPARATOR
Character used to separate parameters in a URL query string- See Also:
- Constant Field Values
-
-
Method Detail
-
escape
public static String escape(String string)
Escape a string by replacing all occurrences of special characters (such as > and <) by their corresponding escapes.- Parameters:
string
- the string to be escaped- Returns:
- the escaped string or, if the original string does not contain any special characters, the original string.
-
-