次の形式のJSONデータがあります
{"createdAt": "2013-06-02T00:00:00-08:00", "sessionId": "4982b321-1a24-4295-9fce-c106362218ca", "user": 86157463, "type": "Play", "payload": {"itemId": "15869e7", "marker": 604}, "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1", "refId": "b7b4d324", "auth": "38746efc:a1681031"}
{"createdAt": "2013-06-02T00:00:00-08:00", "type": "Login", "user": 32850778, "sessionId": "a0e125a3-4e52-42a7-b35f-c9382a8a0e9b", "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:7.0.1) Gecko/20100101 Firefox/7.0.1", "refId": "dd4d56c5", "auth": "69646ac4:a7a75b53"}
{"createdAt": "2013-06-02T00:00:24-08:00", "sessionId": "db7d0113-b688-4737-b3b9-5da92e3de23a", "user": 95035757, "type": "Recommendations", "payload": {"recommendedItems": ["10611", "9722e23", "31396", "28828", "20662", "17342", "21070", "28415", "18273", "27930", "35266", "28895", "11108", "12121", "16045", "12203", "11423", "13363e27", "21304", "18724e1", "38111e66", "9232", "36851e45", "31672", "14502"]}, "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.142 Safari/535.19", "refId": "e94bc09f", "auth": "699d7b63:cec0d4e1"}
ご覧のとおり、各レコードにはさまざまな順序でさまざまなフィールドがあります。GSON を使用して上記のコードを解析すると、最初のレコードについてのみ結果が得られます。次のコードを使用しています
BufferedReader br = new BufferedReader( new FileReader("C:/Users/inhmadala/Desktop/SampleCCP.json"));
Gson gson = new GsonBuilder().create();
JsonReader reader = new JsonReader(new StringReader(br.readLine()));
reader.setLenient(true);
//convert the json string back to object
//JsonReader.setLenient(true);
DataObject obj = gson.fromJson(reader, DataObject.class);
ここで何が悪いのか、誰かが私にアドバイスできますか。