-1
내 코드는 객체와 jsonobeject 해당 데이터는계수의 JSON 노드
String json = IOUtils.toString(is);
JSONObject jo = new JSONObject(json);
다음
'조'가 일부 데이터가된다 :
{
"cargoDetails":[{
"noOfPackages":"2",
"packType":"AUG",
"uom":"LB",
"packLength":"10",
"actualWt":"5",
"packHeight":"2",
"packWidth":"4",
"packDescription":"description",
"currId":"1",
"shipmentMode":"1"},
{"noOfPackages":"2",
"packType":"BAG",
"uom":"KG",
"packLength":"10",
"actualWt":"5",
"packHeight":"2",
"packWidth":"4",
"packDescription":"description",
"currId":"1",
"shipmentMode":"1"}],
"type":"air",
"userId":"KOTESWAR",
"customerId":"CUST00168",
"contractId":"CONTRACT0000576",
"originTerminalId":"FINBOM",
"destinationTerminalId":"FINDEL",
"ShipperId":"CUST00003",
"serviceLevelId":"STD",
"paymentTerms":"Prepaid",
"terminalId":"FINBOM",
"originDepartment":"AE",
"destinationDepartment":"AI",
"departurePort":"INBOM",
"destinationPort":"BOM",
"totalNoPcs":"4",
"totalActualWt":"5",
"totalVol":"10"
}
k는 cargodetails 객체 2 개를 보낼 수 있습니다. 나머지는 예약되었습니다. 내 질문은 얼마나 많은 객체가 jo에 있는지 찾는 방법입니다. 그 jo만으로 루프를 반복 할 수 있기 때문입니다.