类 HtmlCharacterEntityReferences

java.lang.Object
cn.taketoday.web.util.HtmlCharacterEntityReferences

class HtmlCharacterEntityReferences extends Object
Represents a set of character entity references defined by the HTML 4.0 standard.

A complete description of the HTML 4.0 character set can be found at https://www.w3.org/TR/html4/charset.html.

从以下版本开始:
4.0
作者:
Juergen Hoeller, Martin Kersten, Craig Andrews
  • 字段详细资料

    • PROPERTIES_FILE

      private static final String PROPERTIES_FILE
      另请参阅:
    • REFERENCE_START

      static final char REFERENCE_START
      另请参阅:
    • DECIMAL_REFERENCE_START

      static final String DECIMAL_REFERENCE_START
      另请参阅:
    • HEX_REFERENCE_START

      static final String HEX_REFERENCE_START
      另请参阅:
    • REFERENCE_END

      static final char REFERENCE_END
      另请参阅:
    • CHAR_NULL

      static final char CHAR_NULL
      另请参阅:
    • characterToEntityReferenceMap

      private final String[] characterToEntityReferenceMap
    • entityReferenceToCharacterMap

      private final HashMap<String,Character> entityReferenceToCharacterMap
  • 构造器详细资料

    • HtmlCharacterEntityReferences

      public HtmlCharacterEntityReferences()
      Returns a new set of character entity references reflecting the HTML 4.0 character set.
  • 方法详细资料

    • getSupportedReferenceCount

      public int getSupportedReferenceCount()
      Return the number of supported entity references.
    • isMappedToReference

      public boolean isMappedToReference(char character)
      Return true if the given character is mapped to a supported entity reference.
    • isMappedToReference

      public boolean isMappedToReference(char character, String encoding)
      Return true if the given character is mapped to a supported entity reference.
    • convertToReference

      @Nullable public String convertToReference(char character)
      Return the reference mapped to the given character, or null if none found.
    • convertToReference

      @Nullable public String convertToReference(char character, String encoding)
      Return the reference mapped to the given character, or null if none found.
    • convertToCharacter

      public char convertToCharacter(String entityReference)
      Return the char mapped to the given entityReference or -1.