Home > Mobile >  Who can help me get him the result of parsed into object, want to a night did not understand
Who can help me get him the result of parsed into object, want to a night did not understand

Time:10-13

{" success ": true," errorMsg ":" ", "result" : {" rShipmentLists ": [{" gasdescatthattime" : "mineral water", "gasidatthattime" : 15, "count" : 1}], "rSendDetails" : [{" affectCompName ":" Jiang Yue company ", "gasidatthattime" : 15, "gasdescatthattime" : "mineral water", "bottleSendCount" : 1, "bottleBackCount" : 1, "bottleSendCountAndDetail" : {" count ": 1," rNumberDetails ": [{" number" : "910000157"})}, "bottleBackCountAndDetail" : {" count ": 1," rNumberDetails ": [{" number" : "910000115"}]}}], "rBackShipmentLists" : [{" gasdescatthattime ":" mineral water ", "gasidatthattime" : 15, "count" : 1}]}}


This object?
Private List RShipmentLists;
Private List RSendDetails;
Private List RBackShipmentLists;

The trouble with the analytical method, tools

CodePudding user response:

Reference under the
String STR="{" URL" : [" url1 ", "url2", "url3"], "Title" : [" title1 ", "title2", "title3]"} ";
Try {
JSONObject object=new JSONObject (STR);
JSONArray urlArray=object. GetJSONArray (" URL ");
JSONArray titleArray=object. GetJSONArray (" Title ");
for (int i=0; I & lt; UrlArray. Length (); I++) {
System. The out. Println (titleArray. Get string (I));
}
} the catch (JSONException e) {
e.printStackTrace();
}

CodePudding user response:

 public class ResponseBean {


/* *
* success: true
* errorMsg:
* result: {" rShipmentLists ": [{" gasdescatthattime" : "mineral water", "gasidatthattime" : 15, "count" : 1}], "rSendDetails" : [{" affectCompName ":" Jiang Yue company ", "gasidatthattime" : 15, "gasdescatthattime" : "mineral water", "bottleSendCount" : 1, "bottleBackCount" : 1, "bottleSendCountAndDetail" : {" count ": 1," rNumberDetails ": [{" number" : "910000157"})}, "bottleBackCountAndDetail" : {" count ": 1," rNumberDetails ": [{" number" : "910000115"}]}}], "rBackShipmentLists" : [{" gasdescatthattime ":" mineral water ", "gasidatthattime" : 15, "count" : 1}]}
*/

Private Boolean success;
private String errorMsg;
Private ResultBean result;

Public Boolean isSuccess () {
The return success.
}

Public void setSuccess (Boolean success) {
This. Success=success;
}

Public String getErrorMsg () {
Return errorMsg;
}

Public void setErrorMsg (String errorMsg) {
Enclosing errorMsg=errorMsg;
}

Public ResultBean getResult () {
return result;
}

Public void setResult (ResultBean result) {
this.result=result;
}

Public static class ResultBean {
Private List RShipmentLists;
Private List RSendDetails;
Private List RBackShipmentLists;

Public List GetRShipmentLists () {
Return rShipmentLists;
}

Public void setRShipmentLists (List RShipmentLists) {
Enclosing rShipmentLists=rShipmentLists;
}

Public List GetRSendDetails () {
Return rSendDetails;
}

Public void setRSendDetails (List RSendDetails) {
Enclosing rSendDetails=rSendDetails;
}

Public List GetRBackShipmentLists () {
Return rBackShipmentLists;
}

Public void setRBackShipmentLists (List RBackShipmentLists) {
Enclosing rBackShipmentLists=rBackShipmentLists;
}

Public static class RShipmentListsBean {
/* *
* gasdescatthattime: mineral water
15 * gasidatthattime:
* count: 1
*/

Private String gasdescatthattime;
Private int gasidatthattime;
Private int count;

Public String getGasdescatthattime () {
Return gasdescatthattime;
}

Public void setGasdescatthattime (String gasdescatthattime) {
Enclosing gasdescatthattime=gasdescatthattime;
}

Public int getGasidatthattime () {
Return gasidatthattime;
}

Public void setGasidatthattime (int gasidatthattime) {
Enclosing gasidatthattime=gasidatthattime;
}

Public int getCount () {
return count;
}

Public void setCount (int count) {
This. Count=count;
}
}

Public static class RSendDetailsBean {
/* *

* affectCompName: Jiang Yue company15 * gasIdAtThattime:
* gasDescAtThattime: mineral water
* bottleSendCount: 1
* bottleBackCount: 1
* bottleSendCountAndDetail: {" count ": 1," rNumberDetails ": [{" number" : "910000157"}]}
* bottleBackCountAndDetail: {" count ": 1," rNumberDetails ": [{" number" : "910000115"}]}
*/

Private String affectCompName;
Private int gasIdAtThattime;
Private String gasDescAtThattime;
Private int bottleSendCount;
Private int bottleBackCount;
Private BottleSendCountAndDetailBean bottleSendCountAndDetail;
Private BottleBackCountAndDetailBean bottleBackCountAndDetail;

Public String getAffectCompName () {
Return affectCompName;
}

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related