| 程序包 | 说明 |
|---|---|
| com.xiaoleilu.hutool.json | |
| com.xiaoleilu.hutool.util |
| 限定符和类型 | 类和说明 |
|---|---|
class |
JSONArray
A JSONArray is an ordered sequence of values.
|
class |
JSONObject
JSONObject是一个无序键值对.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static JSON |
JSONUtil.parse(Object obj)
转换对象为JSON
支持的对象: String: 转换为相应的对象 Array Collection:转换为JSONArray Bean对象:转为JSONObject |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
JSONUtil.toJsonPrettyStr(JSON json)
转为JSON字符串
|
static String |
JSONUtil.toJsonStr(JSON json)
转为JSON字符串
|
static String |
JSONUtil.toJsonStr(JSON json,
int indentFactor)
转为JSON字符串
|
| 限定符和类型 | 方法和说明 |
|---|---|
static JSON |
FileUtil.readJSON(File file,
Charset charset)
读取JSON
|
static JSON |
FileUtil.readJSON(File file,
String charsetName)
读取JSON
|
Copyright © 2016. All rights reserved.