Class StringEscapeUtils
- java.lang.Object
-
- org.apache.cxf.transport.commons_text.StringEscapeUtils
-
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.
- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.cxf.transport.commons_text.CharSequenceTranslatorESCAPE_HTML4Translator object for escaping HTML version 4.0.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringescapeHtml4(String input)Escapes the characters in aStringusing HTML entities.
-
-
-
Field Detail
-
ESCAPE_HTML4
public static final org.apache.cxf.transport.commons_text.CharSequenceTranslator ESCAPE_HTML4
Translator object for escaping HTML version 4.0. WhileescapeHtml4(String)is the expected method of use, this object allows the HTML escaping functionality to be used as the foundation for a custom translator.
-
-
Method Detail
-
escapeHtml4
public static String escapeHtml4(String input)
Escapes the characters in a
Stringusing HTML entities.For example:
becomes:"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).
- Parameters:
input- theStringto escape, may be null- Returns:
- a new escaped
String,nullif null string input - See Also:
- ISO Entities, HTML 3.2 Character Entities for ISO Latin-1, HTML 4.0 Character entity references, HTML 4.01 Character References, HTML 4.01 Code positions
-
-