public class ObjectMapper extends Object
Reader
转 JSONObject,使用JSONTokener解析InputStream
转 JSONObject,使用JSONTokener解析Constructor and Description |
---|
ObjectMapper(Object source)
构造
|
Modifier and Type | Method and Description |
---|---|
void |
map(JSONArray jsonArray,
Filter<Mutable<Object>> filter)
初始化
|
void |
map(JSONObject jsonObject,
Filter<MutablePair<String,Object>> filter)
将给定对象转换为
JSONObject |
static ObjectMapper |
of(Object source)
创建ObjectMapper
|
public ObjectMapper(Object source)
source
- 来源对象public static ObjectMapper of(Object source)
source
- 来源对象public void map(JSONObject jsonObject, Filter<MutablePair<String,Object>> filter)
JSONObject
jsonObject
- 目标JSONObject
filter
- 键值对过滤编辑器,可以通过实现此接口,完成解析前对键值对的过滤和修改操作public void map(JSONArray jsonArray, Filter<Mutable<Object>> filter) throws JSONException
jsonArray
- 目标JSONArray
filter
- 键值对过滤编辑器,可以通过实现此接口,完成解析前对值的过滤和修改操作,null
表示不过滤JSONException
- 非数组或集合Copyright © 2024. All rights reserved.