Class HTML

java.lang.Object
com.github.rjeschke.txtmark.HTML

class HTML extends Object
HTML utility class.
  • Field Details

    • ENTITY_NAMES

      private static final String[] ENTITY_NAMES
      List of valid HTML/XML entity names.
    • ENTITY_CHARS

      private static final char[] ENTITY_CHARS
      Characters corresponding to ENTITY_NAMES.
    • BLOCK_ELEMENTS

      private static final HTMLElement[] BLOCK_ELEMENTS
      HTML block level elements.
    • UNSAFE_ELEMENTS

      private static final HTMLElement[] UNSAFE_ELEMENTS
      HTML unsafe elements.
    • encodeMap

      private static final HashMap<Character, String> encodeMap
      Character to entity encoding map.
    • decodeMap

      private static final HashMap<String, Character> decodeMap
      Entity to character decoding map.
    • HTML_ELEMENTS

      private static final HashSet<String> HTML_ELEMENTS
      Set of valid HTML tags.
    • HTML_UNSAFE

      private static final HashSet<String> HTML_UNSAFE
      Set of unsafe HTML tags.
    • HTML_BLOCK_ELEMENTS

      private static final HashSet<String> HTML_BLOCK_ELEMENTS
      Set of HTML block level tags.
  • Constructor Details

    • HTML

      private HTML()
      Constructor. (Singleton)
  • Method Details

    • isLinkPrefix

      public static final boolean isLinkPrefix(String value)
      Parameters:
      value - String to check.
      Returns:
      Returns true if the given String is a link prefix.
    • isEntity

      public static final boolean isEntity(String value)
      Parameters:
      value - String to check.
      Returns:
      Returns true if the given String is an entity.
    • isHtmlElement

      public static final boolean isHtmlElement(String value)
      Parameters:
      value - String to check.
      Returns:
      Returns true if the given String is a HTML tag.
    • isHtmlBlockElement

      public static final boolean isHtmlBlockElement(String value)
      Parameters:
      value - String to check.
      Returns:
      Returns true if the given String is a HTML block level tag.
    • isUnsafeHtmlElement

      public static final boolean isUnsafeHtmlElement(String value)
      Parameters:
      value - String to check.
      Returns:
      Returns true if the given String is an unsafe HTML tag.