Class StringEscapeUtils
java.lang.Object
org.apache.cxf.transport.commons_text.StringEscapeUtils
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
FieldsModifier and TypeFieldDescriptionstatic final org.apache.cxf.transport.commons_text.CharSequenceTranslatorTranslator object for escaping HTML version 4.0. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringescapeHtml4(String input) Escapes the characters in aStringusing HTML entities.
-
Field Details
-
ESCAPE_HTML4
public static final org.apache.cxf.transport.commons_text.CharSequenceTranslator ESCAPE_HTML4Translator 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 Details
-
escapeHtml4
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:
-