fastJson 工具包

1、fastJson转javabean
Student student = JSON.parseObject(JSON_OBJ_STR, new TypeReference<Student>() {});
2、fastJson转list
gameListStr = "[{"gameId":"1","gameName":"哈哈"},{"gameId":"2","gameName":"呵呵"}]";
//方法1 List
<Game> gameList = JSONObject.parseArray(gameListStr, Game.class);
//方法2
List<Game> game= JSON.parseObject(gameListStr,new TypeReference<List<Ganme>>(){}); // Json 转List

 3、jsonpath解析

<dependency>
    <groupId>com.jayway.jsonpath</groupId>
    <artifactId>json-path</artifactId>
    <version>2.2.0</version>
</dependency>
  1. <dependency>
  2.  
        <groupId>com.jayway.jsonpath</groupId>
  3.  
        <artifactId>json-path</artifactId>
  4.  
        <version>2.2.0</version>
  5.  
    </dependency>
原文地址:https://www.cnblogs.com/yuhuiqing/p/11724732.html