Class JsonUtils


  • public final class JsonUtils
    extends java.lang.Object
    This class is borrowed from Jackson.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.ThreadLocal<char[]> _qbufLocal
      Temporary buffer used for composing quote/escape sequences
      private static int[] ESC_CODES
      Read-only encoding table for first 128 Unicode code points (single-byte UTF-8 characters).
      private static char[] HC  
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static int _appendNamed​(int esc, char[] qbuf)  
      private static int _appendNumeric​(int value, char[] qbuf)  
      private static char[] getQBuf()  
      static void quoteAsString​(java.lang.CharSequence input, java.lang.StringBuilder output)
      Quote text contents using JSON standard quoting, and append results to a supplied StringBuilder.
      • Methods inherited from class java.lang.Object

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

      • HC

        private static final char[] HC
      • ESC_CODES

        private static final int[] ESC_CODES
        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.
      • _qbufLocal

        private static final java.lang.ThreadLocal<char[]> _qbufLocal
        Temporary buffer used for composing quote/escape sequences
    • Constructor Detail

      • JsonUtils

        public JsonUtils()
    • Method Detail

      • getQBuf

        private static char[] getQBuf()
      • quoteAsString

        public static void quoteAsString​(java.lang.CharSequence input,
                                         java.lang.StringBuilder output)
        Quote text contents using JSON standard quoting, and append results to a supplied StringBuilder.
      • _appendNumeric

        private static int _appendNumeric​(int value,
                                          char[] qbuf)
      • _appendNamed

        private static int _appendNamed​(int esc,
                                        char[] qbuf)