当前位置:   article > 正文

fastjson JSONPath 的使用_fastjson getbypath

fastjson getbypath

要解析的json串:

{ "store": { "book": [ { "title": "高效Java", "price": 10 }, { "title": "研磨设计模式", "price": 12 }, { "title": "重构", "isbn": "553", "price": 8 }, { "title": "虚拟机", "isbn": "395", "price": 22 } ], "bicycle": { "color": "red", "price": 19 } } }

测试:

  1. package json.fastjson.jsonpath;
  2. import java.util.List;
  3. import com.alibaba.fastjson.JSONPath;
  4. public class TestJSONPath2 {
  5. @SuppressWarnings("unchecked")
  6. public static void main(String[] args) {
  7. String json = "{\"store\":{\"book\":[{\"title\":\"高效Java\",\"price\":10},{\"title\":\"研磨设计模式\",\"price\":12},{\"title\":\"重构\",\"isbn\":\"553\",\"price\&#
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小舞很执着/article/detail/1005545
推荐阅读
相关标签
  

闽ICP备14008679号