JsonNode转Map
时间: 2023-11-13 07:04:47 浏览: 128
json 转换为map
可以使用Jackson库将JsonNode转换为Map,示例代码如下:
```
ObjectMapper objectMapper = new ObjectMapper();
JsonNode jsonNode = objectMapper.readTree(jsonString); // jsonString为Json字符串
Map<String, Object> map = objectMapper.convertValue(jsonNode, new TypeReference<>() {});
```
阅读全文