Class JsonUtils

java.lang.Object
org.apache.logging.log4j.core.util.JsonUtils

public final class JsonUtils extends Object
This class is borrowed from Jackson.
  • Field Details

    • 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 ThreadLocal<char[]> _qbufLocal
      Temporary buffer used for composing quote/escape sequences
  • Constructor Details

    • JsonUtils

      public JsonUtils()
  • Method Details

    • getQBuf

      private static char[] getQBuf()
    • quoteAsString

      public static void quoteAsString(CharSequence input, 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)