Class JsonUtils
- java.lang.Object
-
- org.apache.logging.log4j.core.util.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 sequencesprivate 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 suppliedStringBuilder
.
-
-
-
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
-
-
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 suppliedStringBuilder
.
-
_appendNumeric
private static int _appendNumeric(int value, char[] qbuf)
-
_appendNamed
private static int _appendNamed(int esc, char[] qbuf)
-
-