简体   繁体   中英

how to search a JSONArray inside the JSONObject in JAVA

I have a JSONObject which inturn contains two JSONObjects ( key is rows_map and columns_map)

    {
        "rows_map":{
        "3":["Test","Test","Test","Test","Test",null,null,null,null,null,"2011-10-07 15:47:56.0",null,null],
        "2":["test","","","","",null,null,null,"123456789","123456789.user","2011-10-07 12:49:49.0",null,null]
    },
        "columns_map":{
columns_map":"fld1","fld2","fld3","fld4","fld5","Latitude","Longitude","Altitude","Mobile Number","Name","Time","Message","Advertisment"]
        }
    }

In rows_map 3 and 2 are record numbers. Each record is related to columns in columns_map. I want to get records list based on mobile number column for eg: recordslist of mobilenumber equal to 123456789

How can i do this.

In the case that you're trying to read a json using java, you should be parsing it as an object rather than via syntax. Take a look at: https://stackoverflow.com/questions/338586/a-better-java-json-library

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM