public class JsonUtil extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
JsonUtil.Context
分析过程环境
|
static interface |
JsonUtil.Listener
监听分析事件
|
static interface |
JsonUtil.NodeBuilder
节点构建器
|
| 限定符和类型 | 字段和说明 |
|---|---|
protected static StringBuilderPool |
_NameBuilderPool
名称缓冲池
|
static StringPool |
_NamePool
名称池
|
| 构造器和说明 |
|---|
JsonUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
equalsIgnoreCase(CharSequence str1,
CharSequence str2)
忽略大小写比较
|
static void |
escape(CharSequence string,
Appendable appender)
编码JOSN字串
any-Unicode-character-except-"-or-\-or- control-character
\" \\ \/ \b \f \n \r \t \ u four-hex-digits
char = unescaped /
escape (
%x22 / ; " quotation mark U+0022
%x5C / ; \ reverse solidus U+005C
%x2F / ; / solidus U+002F
%x62 / ; b backspace U+0008
%x66 / ; f form feed U+000C
%x6E / ; n line feed U+000A
%x72 / ; r carriage return U+000D
%x74 / ; t tab U+0009
%x75 4HEXDIG ) ; uXXXX U+XXXX
escape = %x5C ; \
quotation-mark = %x22 ; "
unescaped = %x20-21 / %x23-5B / %x5D-10FFFF
|
static void |
format(JsonNode json,
JsonOutput out) |
static boolean |
isBlank(char ch)
是否空白字符(空格、TAB、换行符等)
|
static JsonNode |
parse(JsonInput in,
JsonUtil.Listener listener)
由JSON格式流解析为JsonNode
|
static JsonNode |
parse(JsonInput in,
JsonUtil.Listener listener,
JsonUtil.NodeBuilder builder)
由JSON格式流解析为JsonNode
|
static void |
rtrim(StringBuilder builder)
去除后部空格
|
static char |
skipBlank(JsonInput in,
int limit)
跳过空格、换行符等
|
static Appendable |
unescape(JsonInput in,
Appendable builder) |
public static StringPool _NamePool
protected static StringBuilderPool _NameBuilderPool
public static JsonNode parse(JsonInput in, JsonUtil.Listener listener) throws IOException
in - 格式流listener - 可选的监听器(可以为null)IOException - IO异常时抛出public static JsonNode parse(JsonInput in, JsonUtil.Listener listener, JsonUtil.NodeBuilder builder) throws IOException
in - 格式流listener - 可选的监听器(可以为null)builder - 节点构建器IOException - IO异常时抛出public static void format(JsonNode json, JsonOutput out) throws IOException
IOExceptionpublic static boolean equalsIgnoreCase(CharSequence str1, CharSequence str2)
str1 - 比较字串str2 - 被比较字串public static void rtrim(StringBuilder builder)
builder - 要去除后空格的字串public static char skipBlank(JsonInput in, int limit) throws IOException
in - JSON格式流limit - 限制跳过的字符数IOException - IO异常时抛出public static final boolean isBlank(char ch)
ch - 要检查的字符public static void escape(CharSequence string, Appendable appender) throws IOException
\" \\ \/ \b \f \n \r \t \ u four-hex-digits
char = unescaped /
escape (
%x22 / ; " quotation mark U+0022
%x5C / ; \ reverse solidus U+005C
%x2F / ; / solidus U+002F
%x62 / ; b backspace U+0008
%x66 / ; f form feed U+000C
%x6E / ; n line feed U+000A
%x72 / ; r carriage return U+000D
%x74 / ; t tab U+0009
%x75 4HEXDIG ) ; uXXXX U+XXXX
escape = %x5C ; \
quotation-mark = %x22 ; "
unescaped = %x20-21 / %x23-5B / %x5D-10FFFF
string - 要转义的字串appender - 转义后输出的序列器IOException - IO异常时抛出public static Appendable unescape(JsonInput in, Appendable builder) throws IOException
IOExceptionCopyright © 2022. All rights reserved.