public static class StringEscapeUtils.Builder extends Object
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()
Modifier and Type | Method and Description |
---|---|
StringEscapeUtils.Builder |
append(String input)
Literal append, no escaping being done.
|
StringEscapeUtils.Builder |
escape(String input)
Escape
input according to the given CharSequenceTranslator . |
String |
toString()
Return the escaped string.
|
public StringEscapeUtils.Builder escape(String input)
Escape input
according to the given CharSequenceTranslator
.
input
- the String to escapethis
, to enable chainingpublic StringEscapeUtils.Builder append(String input)
input
- the String to appendthis
, to enable chainingCopyright © 2014–2017 The Apache Software Foundation. All rights reserved.