public interface JsonUtil
| 限定符和类型 | 方法和说明 |
|---|---|
<T> T |
fromJson(String json,
Class<T> valueType)
Converts a JSON string to an object of the specified type.
|
<T> List<T> |
json2list(String jsonArrayStr,
Class<T> clazz)
JSON array string converts to list with Java Bean
|
Map<String,Object> |
json2map(String jsonStr)
json string converts to map
This method is used to convert a JSON string into a Map object with String as the key type and Object as the value type.
|
List<Map<String,Object>> |
json2mapList(String jsonArrayStr) |
static final JsonUtil INSTANCE
<T> T fromJson(String json, Class<T> valueType)
T - The generic type parameter indicating the type of the returned object.json - The JSON string representing the data to be converted.valueType - The class type of the target object.RuntimeException - If the JSON string cannot be converted to the target type.Map<String,Object> json2map(String jsonStr)
jsonStr - The JSON string to be converted.<T> List<T> json2list(String jsonArrayStr, Class<T> clazz)
T - Generic type parameter, indicating the type of elements in the listjsonArrayStr - The JSON array string, representing a list of objectsclazz - The class type of the list elements, used to specify the type of Java BeanCopyright © 2016–2025 AJAXJS. All rights reserved.