SHARE
TWEET

Untitled

a guest Aug 20th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.*;
  2.  
  3. import com.jayway.jsonpath.DocumentContext;
  4. import com.jayway.jsonpath.JsonPath;
  5.  
  6. public class JSONMapper {
  7.  
  8.     public static void main(String[] args) throws Exception {
  9.  
  10.        DocumentContext jsonContext =
  11. JsonPath.parse("D:\Docs\search.json");
  12.        List<String> accom=
  13. JsonPath.read("C:\Users\shashank.sinha\Desktop\search.json",
  14.                "*.singleAccomViewData");
  15.        System.out.println("accom value: " + accom);
  16. }
  17.  
  18. Below is my JSON File:-
  19.  
  20. {
  21.   "searchResult": {
  22.     "singleAccomViewData": null,
  23.     "singleAccomSearch": false,
  24.     "durationSelection": {
  25.       "defaultDisplay": [
  26.         6,
  27.         7,
  28.         8,
  29.         9,
  30.         10
  31.       ]
  32.     }
  33.    }
  34. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top