Package org.apache.commons.text
Class StringEscapeUtils.Builder
java.lang.Object
org.apache.commons.text.StringEscapeUtils.Builder
- Enclosing class:
- StringEscapeUtils
Convenience wrapper for
StringBuilder
providing escape methods.
Example:
new Builder(ESCAPE_HTML4) .append("<p>") .escape("This is paragraph 1 and special chars like & get escaped.") .append("</p><p>") .escape("This is paragraph 2 & more...") .append("</p>") .toString()
-
Method Summary
Modifier and TypeMethodDescriptionLiteral append, no escaping being done.Escapeinput
according to the givenCharSequenceTranslator
.toString()
Return the escaped string.
-
Method Details
-
append
Literal append, no escaping being done.- Parameters:
input
- the String to append- Returns:
this
, to enable chaining
-
escape
Escapeinput
according to the givenCharSequenceTranslator
.- Parameters:
input
- the String to escape- Returns:
this
, to enable chaining
-
toString
Return the escaped string.
-