I want to get key from json object. I have used the below code to get it,
JSONParser parser = new JSONParser();
try {
Object obj = null;
try {
obj = parser.parse(new FileReader(new File("json/customer_list.json")));
} catch (org.json.simple.parser.ParseException e1) {
e1.printStackTrace();
}
JSONObject jsonObject = (JSONObject) obj;
JSONArray listOfBranches = (JSONArray) jsonObject.get("customers");
for (int i = 0; i < listOfBranches.size(); i++) {
System.out.println("Customer :" + listOfBranches.get(i));
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
In this part,
System.out.println("Customer :" + listOfBranches.get(i));
I'm getting the below object,
{"Photo":{"input_required":false,"output_type":"","input_fields":[{"input_type":"INTEGER","length":"","reg_exp":"","label":"","field_type":"TEXT"},{"values":"","length":"","reg_exp":"","label":"Mode","field_type":"drop_down"},{"length":"","input_type":"INTEGER","reg_exp":"","label":"Quantity","field_type":"TEXT"}]},"video":{"input_required":true,"output_type":"","input_pattern":""},"drawing":{"input_required":true,"output_type":"PDF","input_pattern":""}}
from this json i want to get photo, video and drawing key. Can you please suggest me any idea to do this? Thanks in advance.