Package editor.util

Class HTMLEscapeUtil

java.lang.Object
editor.util.HTMLEscapeUtil

public class HTMLEscapeUtil extends Object
Static utilities for writing out HTML
  • Field Details

    • NBSP

      public static final String NBSP
      Constant representing non-breaking space escape character
      See Also:
    • URL_PARAMETER_SEPARATOR

      public static final String URL_PARAMETER_SEPARATOR
      Character used to separate parameters in a URL query string
      See Also:
  • Constructor Details

    • HTMLEscapeUtil

      private HTMLEscapeUtil()
  • Method Details

    • escape

      public static String escape(String string)
      Escape a string by replacing all occurrences of special characters (such as > and <) by their corresponding escapes.
      Parameters:
      string - the string to be escaped
      Returns:
      the escaped string or, if the original string does not contain any special characters, the original string.
    • escape

      public static String escape(String string, boolean escapeNewLine)
    • escapeForTextArea

      public static String escapeForTextArea(String string)
    • escape

      private static String escape(String string, boolean escapeNewLine, boolean isTextArea)
    • escapeAttribute

      public static String escapeAttribute(String string)
      Escape a string for use as an HTML attribute by replacing all double quotes and '&'.