Class StringEscapeUtils.Builder

java.lang.Object
com.espertech.esper.common.internal.util.apachecommonstext.StringEscapeUtils.Builder
Enclosing class:
StringEscapeUtils

public static final 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()
 
  • Method Details

    • append

      public StringEscapeUtils.Builder append(String input)
      Literal append, no escaping being done.
      Parameters:
      input - the String to append
      Returns:
      this, to enable chaining
    • toString

      public String toString()

      Return the escaped string.

      Overrides:
      toString in class Object
      Returns:
      the escaped string