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); 

}

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 JoshS 的頭像
    JoshS

    JoshS的部落格

    JoshS 發表在 痞客邦 留言(0) 人氣()