Class HTMLUtils

java.lang.Object
com.webmethods.caf.faces.render.util.HTMLUtils

public class HTMLUtils extends Object
HTML-rendering utility functions.
  • Field Details

    • RE_HTML_NAME

      public static final Pattern RE_HTML_NAME
      (html 4.01 6.2) ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
    • RE_CLIENT_ID_ESCAPES

      protected static final Pattern RE_CLIENT_ID_ESCAPES
  • Constructor Details

    • HTMLUtils

      public HTMLUtils()
  • Method Details

    • quote

      public static String quote(String s)
      Escapes HTML.
      Returns:
      Escaped string. Never null.
    • quote

      public static String quote(String s, boolean elementContent)
      Escapes HTML.
      Parameters:
      elementContent - True if escaping element content (in which case ' [single-quote] and " [double-quote] don't need to be escaped).
      Returns:
      Escaped string. Never null.
    • isValidName

      public static boolean isValidName(String name)
      Returns true if the specified element/attribute name is a legal html element/attribute name.
    • encodeClientId

      public static String encodeClientId(String id)
      Encodes id to be legal SGML id string.
    • decodeClientId

      public static String decodeClientId(String id)
      Decodes id encoded with encodeClientId(java.lang.String).
    • createHTMLResponseWriter

      public static ResponseWriter createHTMLResponseWriter(FacesContext context, Writer out)