1 json string 转 JSONObject
try { JSONObject jsonObject = new JSONObject("{\"phonetype\":\"N95\",\"cat\":\"WP\"}"); }catch (JSONException err){ Log.d("Error", err.toString()); }
2 json string 转 JsonNode
ObjectMapper mapper = new ObjectMapper(); JsonNode node = mapper.readTree(jsonString);
3 json string 装map
Map<String, String> map = mapper.readValue(jsonstring, Map.class);
原文地址:https://www.cnblogs.com/wolbo/p/12112627.html
时间: 2024-10-10 15:20:14