[
https://issues.apache.org/jira/browse/LANG-1288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15677855#comment-15677855
]
ASF GitHub Bot commented on LANG-1288:
--------------------------------------
Github user britter commented on a diff in the pull request:
https://github.com/apache/commons-lang/pull/213#discussion_r88745033
--- Diff: src/main/java/org/apache/commons/lang3/StringEscapeUtils.java ---
@@ -429,6 +429,65 @@ public StringEscapeUtils() {
super();
}
+ /**
+ * <p>Convenience wrapper for {@link java.lang.StringBuilder}
providing escape methods.</p>
+ *
+ * <p>Example:</p>
+ * <pre>
+ * 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()
+ * </pre>
+ *
+ * @since 3.6
+ */
+ public static class Builder {
+
+ private final StringBuilder sb;
--- End diff --
How about making it possible to pass in any `java.lang.Appendable` and use
a `StringBuilder` as default value?
> Add a builder to StringEscapeUtils
> ----------------------------------
>
> Key: LANG-1288
> URL: https://issues.apache.org/jira/browse/LANG-1288
> Project: Commons Lang
> Issue Type: New Feature
> Reporter: Pascal Schumacher
> Priority: Minor
>
> supplied in patch for LANG-1066
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)