Class CharTypes

  • public final class CharTypes
    extends java.lang.Object
    • Constructor Detail

      • CharTypes

        public CharTypes()
    • Method Detail

      • getInputCodeLatin1

        public static int[] getInputCodeLatin1()
      • getInputCodeUtf8

        public static int[] getInputCodeUtf8()
      • getInputCodeLatin1JsNames

        public static int[] getInputCodeLatin1JsNames()
      • getInputCodeUtf8JsNames

        public static int[] getInputCodeUtf8JsNames()
      • getInputCodeComment

        public static int[] getInputCodeComment()
      • getInputCodeWS

        public static int[] getInputCodeWS()
      • get7BitOutputEscapes

        public static int[] get7BitOutputEscapes()
        Accessor for getting a read-only encoding table for first 128 Unicode code points (single-byte UTF-8 characters). Value of 0 means "no escaping"; other positive values that value is character to use after backslash; and negative values that generic (backslash - u) escaping is to be used.
        128-entry int[] that contains escape definitions
      • get7BitOutputEscapes

        public static int[] get7BitOutputEscapes​(int quoteChar)
        Alternative to get7BitOutputEscapes() when a non-standard quote character is used.
        quoteChar - Character used for quoting textual values and property names; usually double-quote but sometimes changed to single-quote (apostrophe)
        128-entry int[] that contains escape definitions
      • charToHex

        public static int charToHex​(int ch)
      • hexToChar

        public static char hexToChar​(int ch)
      • appendQuoted

        public static void appendQuoted​(java.lang.StringBuilder sb,
                                        java.lang.String content)
        Helper method for appending JSON-escaped version of contents into specific StringBuilder, using default JSON specification mandated minimum escaping rules.
        sb - Buffer to append escaped contents in
        content - Unescaped String value to append with escaping applied
      • copyHexChars

        public static char[] copyHexChars()
      • copyHexBytes

        public static byte[] copyHexBytes()