| 程序包 | 说明 |
|---|---|
| com.xiaoleilu.hutool.json | |
| com.xiaoleilu.hutool.util |
| 限定符和类型 | 方法和说明 |
|---|---|
JSONObject |
JSONObject.accumulate(String key,
Object value)
Accumulate values under a key.
|
JSONObject |
JSONObject.append(String key,
Object value)
Append values to the array under a key.
|
static JSONObject |
JSONUtil.createObj()
创建JSONObject
|
JSONObject |
JSONArray.getJSONObject(int index)
Get the optional JSONObject associated with an index.
|
JSONObject |
JSONObject.getJSONObject(String key)
获得JSONObject对象
|
JSONObject |
JSONObject.increment(String key)
Increment a property of a JSONObject.
|
static JSONObject |
JSONUtil.parseObj(String jsonStr)
JSON字符串转JSONObject对象
|
JSONObject |
JSONObject.put(String key,
boolean value)
Put a key/boolean pair in the JSONObject.
|
JSONObject |
JSONObject.put(String key,
Collection<?> value)
Put a key/value pair in the JSONObject, where the value will be a JSONArray which is produced from a Collection.
|
JSONObject |
JSONObject.put(String key,
double value)
Put a key/double pair in the JSONObject.
|
JSONObject |
JSONObject.put(String key,
int value)
Put a key/int pair in the JSONObject.
|
JSONObject |
JSONObject.put(String key,
long value)
Put a key/long pair in the JSONObject.
|
JSONObject |
JSONObject.put(String key,
Map<?,?> value)
Put a key/value pair in the JSONObject, where the value will be a JSONObject which is produced from a Map.
|
JSONObject |
JSONObject.put(String key,
Object value)
Put a key/value pair in the JSONObject.
|
JSONObject |
JSONObject.putOnce(String key,
Object value)
Put a key/value pair in the JSONObject, but only if the key and the value are both non-null, and only if there is not already a member with that name.
|
JSONObject |
JSONObject.putOpt(String key,
Object value)
Put a key/value pair in the JSONObject, but only if the key and the value are both non-null.
|
JSONObject |
JSONSupport.toJSON() |
JSONObject |
JSONArray.toJSONObject(JSONArray names)
Produce a JSONObject by combining a JSONArray of names with the values of this JSONArray.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> T |
JSONUtil.toBean(JSONObject json,
Class<T> beanClass)
转为实体类对象
|
| 构造器和说明 |
|---|
JSONObject(JSONObject jsonObject,
String... names)
使用其他
JSONObject构造新的JSONObject,并只加入指定name对应的键值对。 |
| 限定符和类型 | 方法和说明 |
|---|---|
static JSONObject |
FileUtil.readJSONObject(File file,
Charset charset)
读取JSONObject
|
static JSONObject |
FileUtil.readJSONObject(File file,
String charsetName)
读取JSONObject
|
Copyright © 2016. All rights reserved.