public final class StringEscapeUtils extends Object
Escapes and unescapes Strings for
Java, Java Script, HTML and XML.
#ThreadSafe#
This code has been adapted from Apache Commons Lang 3.5.
| Modifier and Type | Field and Description |
|---|---|
static org.apache.cxf.transport.commons_text.CharSequenceTranslator |
ESCAPE_HTML4
Translator object for escaping HTML version 4.0.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
escapeHtml4(String input)
Escapes the characters in a
String using HTML entities. |
public static final org.apache.cxf.transport.commons_text.CharSequenceTranslator ESCAPE_HTML4
escapeHtml4(String) is the expected method of use, this
object allows the HTML escaping functionality to be used
as the foundation for a custom translator.public static String escapeHtml4(String input)
Escapes the characters in a String using HTML entities.
For example:
"bread" & "butter"
"bread" & "butter".
Supports all known HTML 4.0 entities, including funky accents. Note that the commonly used apostrophe escape character (') is not a legal entity and so is not supported).
input - the String to escape, may be nullString, null if null string inputApache CXF