Class EntityArrays


  • public class EntityArrays
    extends java.lang.Object
    Class holding various entity data for HTML and XML - generally for use with the LookupTranslator. All Maps are generated using java.util.Collections.unmodifiableMap().
    Since:
    1.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> APOS_ESCAPE
      A Map<CharSequence, CharSequence> to escape the apostrophe character to its XML character entity.
      static java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> APOS_UNESCAPE
      Reverse of APOS_ESCAPE for unescaping purposes.
      static java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> BASIC_ESCAPE
      A Map<CharSequence, CharSequence> to escape the basic XML and HTML character entities.
      static java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> BASIC_UNESCAPE
      Reverse of BASIC_ESCAPE for unescaping purposes.
      static java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> HTML40_EXTENDED_ESCAPE
      A Map<CharSequence, CharSequence> to escape additional character entity references.
      static java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> HTML40_EXTENDED_UNESCAPE
      Reverse of HTML40_EXTENDED_ESCAPE for unescaping purposes.
      static java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> ISO8859_1_ESCAPE
      A Map<CharSequence, CharSequence> to to escape ISO-8859-1 characters to their named HTML 3.x equivalents.
      static java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> ISO8859_1_UNESCAPE
      Reverse of ISO8859_1_ESCAPE for unescaping purposes.
      static java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> JAVA_CTRL_CHARS_ESCAPE
      A Map<CharSequence, CharSequence> to escape the Java control characters.
      static java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> JAVA_CTRL_CHARS_UNESCAPE
      Reverse of JAVA_CTRL_CHARS_ESCAPE for unescaping purposes.
    • Constructor Summary

      Constructors 
      Constructor Description
      EntityArrays()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> invert​(java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> map)
      Used to invert an escape Map into an unescape Map.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ISO8859_1_ESCAPE

        public static final java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> ISO8859_1_ESCAPE
        A Map<CharSequence, CharSequence> to to escape ISO-8859-1 characters to their named HTML 3.x equivalents.
      • ISO8859_1_UNESCAPE

        public static final java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> ISO8859_1_UNESCAPE
        Reverse of ISO8859_1_ESCAPE for unescaping purposes.
      • HTML40_EXTENDED_ESCAPE

        public static final java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> HTML40_EXTENDED_ESCAPE
        A Map<CharSequence, CharSequence> to escape additional character entity references. Note that this must be used with ISO8859_1_ESCAPE to get the full list of HTML 4.0 character entities.
      • HTML40_EXTENDED_UNESCAPE

        public static final java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> HTML40_EXTENDED_UNESCAPE
        Reverse of HTML40_EXTENDED_ESCAPE for unescaping purposes.
      • BASIC_ESCAPE

        public static final java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> BASIC_ESCAPE
        A Map<CharSequence, CharSequence> to escape the basic XML and HTML character entities. Namely: " & < >
      • BASIC_UNESCAPE

        public static final java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> BASIC_UNESCAPE
        Reverse of BASIC_ESCAPE for unescaping purposes.
      • APOS_ESCAPE

        public static final java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> APOS_ESCAPE
        A Map<CharSequence, CharSequence> to escape the apostrophe character to its XML character entity.
      • APOS_UNESCAPE

        public static final java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> APOS_UNESCAPE
        Reverse of APOS_ESCAPE for unescaping purposes.
      • JAVA_CTRL_CHARS_ESCAPE

        public static final java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> JAVA_CTRL_CHARS_ESCAPE
        A Map<CharSequence, CharSequence> to escape the Java control characters. Namely: \b \n \t \f \r
      • JAVA_CTRL_CHARS_UNESCAPE

        public static final java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> JAVA_CTRL_CHARS_UNESCAPE
        Reverse of JAVA_CTRL_CHARS_ESCAPE for unescaping purposes.
    • Constructor Detail

      • EntityArrays

        public EntityArrays()
    • Method Detail

      • invert

        public static java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> invert​(java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> map)
        Used to invert an escape Map into an unescape Map.
        Parameters:
        map - Map<String, String> to be inverted
        Returns:
        Map<String, String> inverted array