public class GSONParser extends Object implements JSONParser
Constructor and Description |
---|
GSONParser() |
Modifier and Type | Method and Description |
---|---|
Object |
parse(String text) |
JSONArray |
parseArray(String text) |
<T> List<T> |
parseArray(String text,
Class<T> clazz) |
JSONObject |
parseObject(String text) |
<T> T |
parseObject(String text,
Class<T> clazz) |
<T> T |
parseObject(String text,
TypeReference<T> type) |
<T> T |
toJavaObject(JSONObject json,
Class<T> clazz) |
JSONArray |
toJSONArray(List<Object> list) |
JSONObject |
toJSONObject(Map<String,Object> param) |
String |
toJSONString(Object object) |
public <T> T parseObject(String text, Class<T> clazz)
parseObject
in interface JSONParser
public <T> T parseObject(String text, TypeReference<T> type)
parseObject
in interface JSONParser
public JSONObject parseObject(String text)
parseObject
in interface JSONParser
public JSONArray parseArray(String text)
parseArray
in interface JSONParser
public <T> List<T> parseArray(String text, Class<T> clazz)
parseArray
in interface JSONParser
public Object parse(String text)
parse
in interface JSONParser
public JSONObject toJSONObject(Map<String,Object> param)
toJSONObject
in interface JSONParser
public JSONArray toJSONArray(List<Object> list)
toJSONArray
in interface JSONParser
public <T> T toJavaObject(JSONObject json, Class<T> clazz)
toJavaObject
in interface JSONParser
public String toJSONString(Object object)
toJSONString
in interface JSONParser
Copyright © 2020, 美味书签(北京)信息技术有限公司 All rights reserved.