My json file contains multiple objects :
[
{
"name":"Move",
"$$hashKey":"object:79",
"time":11.32818,
"endTime":18.615535
},
{
"name":"First Red Flash",
"$$hashKey":"object:77",
"time":15.749153
},
{
"name":"Pills",
"subEventTypes":[
"pull down bottle",
"unscrew lid",
"dump pills out",
"screw lid on",
"put bottle away"
],
"$$hashKey":"object:82",
"time":25.130175,
"subEventSplits":[
26.092057,
27.425881,
31.841594,
34.268093
],
"endTime":36.234827
}
}
Is there a way to parse this Json file using Jackson? Or are there any other libraries available that allow me to parse a Json file in this format? Here is my code so far :
File file = new File("data.json");
JsonFactory jsonFactory = new JsonFactory();
JsonParser parser = jsonFactory.createJsonParser(file);
while(parser.nextToken()!=JsonToken.END_OBJECT)
{
//how to read each token
}
].