| 程序包 | 说明 |
|---|---|
| com.xiaoleilu.hutool.io | |
| com.xiaoleilu.hutool.io.file | |
| com.xiaoleilu.hutool.json |
| 限定符和类型 | 方法和说明 |
|---|---|
static JSONObject |
FileUtil.readJSONObject(File file,
Charset charset)
读取JSONObject
|
static JSONObject |
FileUtil.readJSONObject(File file,
String charsetName)
读取JSONObject
|
| 限定符和类型 | 方法和说明 |
|---|---|
JSONObject |
FileReader.readJSONObject()
读取JSONObject
|
| 限定符和类型 | 方法和说明 |
|---|---|
JSONObject |
JSONObject.accumulate(String key,
Object value)
积累值。
|
JSONObject |
JSONObject.append(String key,
Object value)
追加值,如果key无对应值,就添加一个JSONArray,其元素只有value,如果值已经是一个JSONArray,则添加到值JSONArray中。
|
static JSONObject |
JSONUtil.createObj()
创建JSONObject
|
JSONObject |
JSONGetter.getJSONObject(K key)
获得JSONObject对象
|
JSONObject |
JSONObject.increment(String key)
对值加一,如果值不存在,赋值1,如果为数字类型,做加一操作
|
static JSONObject |
JSONUtil.parseFromProperties(Properties properties)
Properties文件转化为JSONObject
|
static JSONObject |
JSONUtil.parseFromResourceBundle(ResourceBundle bundle)
ResourceBundle转化为JSONObject
|
static JSONObject |
JSONUtil.parseFromSetting(Setting setting)
Setting文件转化为JSONObject
|
static JSONObject |
JSONUtil.parseFromXml(String xmlStr)
XML字符串转为JSONObject
|
static JSONObject |
JSONUtil.parseObj(Object obj)
JSON字符串转JSONObject对象
|
static JSONObject |
JSONUtil.parseObj(String jsonStr)
JSON字符串转JSONObject对象
|
JSONObject |
JSONObject.put(String key,
Object value)
PUT 键值对到JSONObject中,如果值为
null,将此键移除 |
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到JSONObject中
|
JSONObject |
JSONSupport.toJSON() |
JSONObject |
JSONArray.toJSONObject(JSONArray names)
Produce a JSONObject by combining a JSONArray of names with the values of this JSONArray.
|
static JSONObject |
XML.toJSONObject(String string)
Convert a well-formed (but not necessarily valid) XML string into a JSONObject.
|
static JSONObject |
XML.toJSONObject(String string,
boolean keepStrings)
Convert a well-formed (but not necessarily valid) XML string into a JSONObject.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> T |
JSONUtil.toBean(JSONObject json,
Class<T> beanClass)
转为实体类对象
|
| 构造器和说明 |
|---|
JSONObject(JSONObject jsonObject,
String... names)
使用其他
JSONObject构造新的JSONObject,并只加入指定name对应的键值对。 |
Copyright © 2017. All rights reserved.