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>

相关文章:

  • 2022-12-23
  • 2021-09-11
  • 2021-11-24
  • 2021-11-30
  • 2021-07-29
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-13
  • 2021-11-30
  • 2022-02-13
  • 2021-11-06
  • 2022-12-23
相关资源
相似解决方案