import org.codehaus.jackson.map.ObjectMapper;
string json ={ name:王曉明,age:30,birthday:1999/01/01 }
JsonNode jsonNode = objectMapper.readTree(json);
String name = jsonNode.path("name ").asText()
以上通常會被做成function
Ex:
public JsonNode toJsonNode(String json) throws IOException {
return objectMapper.readTree(json);
}
全站熱搜