Class SpecialEntity


  • public class SpecialEntity
    extends java.lang.Object

    This class contains map with special entities used in HTML and their unicodes.

    • Field Detail

      • entities

        private static java.util.Map<java.lang.String,​SpecialEntity> entities
      • maxEntityLength

        private static int maxEntityLength
      • key

        private java.lang.String key
      • intCode

        private int intCode
    • Constructor Detail

      • SpecialEntity

        private SpecialEntity​(java.lang.String key,
                              int intCode)
    • Method Detail

      • addEntity

        public static void addEntity​(java.lang.String entityName,
                                     int intCode)
                              throws HtmlCleanerException
        Add new entity to the set.
        Parameters:
        entityName - Entity name, for example "pound"
        intCode - Unicode of the entity, for example 163
        Throws:
        HtmlCleanerException
      • getEntity

        public static SpecialEntity getEntity​(java.lang.String key)
      • getMaxEntityLength

        static int getMaxEntityLength()
      • getKey

        public java.lang.String getKey()
      • getIntCode

        public int getIntCode()
      • getCharacter

        public char getCharacter()
      • getDecimalNCR

        public java.lang.String getDecimalNCR()
        Returns:
        Numeric Character Reference in decimal format
      • getHexNCR

        public java.lang.String getHexNCR()
        Returns:
        Numeric Character Reference in hex format
      • getEscapedValue

        public java.lang.String getEscapedValue()
        Returns:
        Escaped value of the entity