This can be done with the following code:
ObjectMapper mapper = new ObjectMapper();
JsonFactory factory = mapper.getJsonFactory();
JsonParser jp = factory.createJsonParser(jsonString);
JsonNode node = mapper.readTree(jp);
JsonNode node1 = node.get(“key1”);
JsonNode node2 = node2.get("key2");
String node2Content = node2.asText();
|
References:
No comments:
Post a Comment