Class JsonUtils
java.lang.Object
org.apache.logging.log4j.core.util.JsonUtils
This class is borrowed from Jackson.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ThreadLocal<char[]>
Temporary buffer used for composing quote/escape sequencesprivate static final int[]
Read-only encoding table for first 128 Unicode code points (single-byte UTF-8 characters).private static final char[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static int
_appendNamed
(int esc, char[] qbuf) private static int
_appendNumeric
(int value, char[] qbuf) private static char[]
getQBuf()
static void
quoteAsString
(CharSequence input, StringBuilder output) Quote text contents using JSON standard quoting, and append results to a suppliedStringBuilder
.
-
Field Details
-
HC
private static final char[] HC -
ESC_CODES
private static final int[] ESC_CODESRead-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
Temporary buffer used for composing quote/escape sequences
-
-
Constructor Details
-
JsonUtils
public JsonUtils()
-
-
Method Details
-
getQBuf
private static char[] getQBuf() -
quoteAsString
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)
-