标签:color except erro error ror exception adt ons node
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);
java ObjectMapper json 与对象的相互转换
标签:color except erro error ror exception adt ons node
原文地址:https://www.cnblogs.com/wolbo/p/12112627.html