public class FastJsonUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static com.alibaba.fastjson.support.config.FastJsonConfig |
GLOBAL_FAST_JSON_CONFIG
Fast JSON的全局配置
|
| Constructor and Description |
|---|
FastJsonUtils() |
| Modifier and Type | Method and Description |
|---|---|
static com.alibaba.fastjson.JSONObject |
getJSONObject(com.alibaba.fastjson.JSONObject source,
String key)
从 JSONObject 对象中获取key,如果 key 为空字符串或者 NULL,则创建一个 JSONObject 对象
|
static com.alibaba.fastjson.JSONArray |
parseArray(String jsonString)
将 JSON 字符串转换为 JSONArray 对象,如果 JSON 字符串为空字符串或者 NULL,则创建一个 JSONArray 对象
|
static com.alibaba.fastjson.JSONObject |
parseObject(String jsonString)
将 JSON 字符串转换为 JSONObject 对象,如果 JSON 字符串为空字符串或者 NULL,则创建一个 JSONObject 对象
|
static String |
toJSONString(Object object)
输出JSON字符串,日期会格式化,其它格式化参考:
FastJsonAutoConfiguration.fastJsonConfig() |
public static final com.alibaba.fastjson.support.config.FastJsonConfig GLOBAL_FAST_JSON_CONFIG
public static com.alibaba.fastjson.JSONObject parseObject(String jsonString)
jsonString - JSON字符串(可以是空字符串或者 NULL)public static com.alibaba.fastjson.JSONArray parseArray(String jsonString)
jsonString - JSON字符串(可以是空字符串或者 NULL)public static String toJSONString(Object object)
FastJsonAutoConfiguration.fastJsonConfig()object - 待转换待对象public static com.alibaba.fastjson.JSONObject getJSONObject(com.alibaba.fastjson.JSONObject source,
String key)
source - JSONObject原始对象key - 要从原始对象中获取的keyCopyright © 2018–2021. All rights reserved.