public final class InternalJSONUtil extends Object
Constructor and Description |
---|
InternalJSONUtil() |
Modifier and Type | Method and Description |
---|---|
static Map<String,JSON> |
createRawMap(int capacity,
JSONFactory factory)
根据配置创建对应的原始Map
|
static String |
escape(String str)
转义显示不可见字符
|
static Object |
parseNumberOrString(String string)
尝试转换字符串为number or null,无法转换返回String
此方法用于解析JSON字符串时,将字符串中的值转换为JSON值对象 |
static Object |
parseValueFromString(String string)
尝试转换字符串为number, boolean, or null,无法转换返回String
此方法用于解析JSON字符串时,将字符串中的值转换为JSON值对象 |
static void |
quote(CharSequence str,
Appendable appendable)
对所有双引号做转义处理(使用双反斜杠做转义)
为了能在HTML中较好的显示,会将</转义为<\/ JSON字符串中不能包含控制字符和未经转义的引号和反斜杠 |
static Appendable |
quote(CharSequence str,
Appendable appendable,
boolean isWrap)
对所有双引号做转义处理(使用双反斜杠做转义)
为了能在HTML中较好的显示,会将</转义为<\/ JSON字符串中不能包含控制字符和未经转义的引号和反斜杠 |
static CopyOptions |
toCopyOptions(JSONConfig config)
将
JSONConfig 参数转换为Bean拷贝所用的CopyOptions |
public static Object parseValueFromString(String string)
string
- A String.public static Object parseNumberOrString(String string)
string
- A String.public static CopyOptions toCopyOptions(JSONConfig config)
JSONConfig
参数转换为Bean拷贝所用的CopyOptions
config
- JSONConfig
CopyOptions
public static void quote(CharSequence str, Appendable appendable) throws IORuntimeException
str
- 字符串appendable
- Appendable
IORuntimeException
- IO异常public static Appendable quote(CharSequence str, Appendable appendable, boolean isWrap) throws IORuntimeException
str
- 字符串appendable
- Appendable
isWrap
- 是否使用双引号包装字符串IORuntimeException
- IO异常public static Map<String,JSON> createRawMap(int capacity, JSONFactory factory)
capacity
- 初始大小factory
- JSON工厂,null
则使用默认配置Copyright © 2025. All rights reserved.