简体   繁体   中英

Parse json array String in java

I have a json String as follows.

"requestParams": [
        "SupplierId": 15357,
              "displayGsId": 5,
        "supplierName": "SUPPLIER1",
        "displayRequestId": 1
  ]

I am trying to parse it using Jackson 2. I know that it is an array and it maps to java.util.List in Java but, what about the elements in it. which object does it match to in java and how should i retrieve all those elements in array. Does each element maps to HashMap?

Correct the input, so it becomes valid JSON

{
    "requestParams": [
        {
            "zycusSupplierId": 15357,
            "displayGsId": 5,
            "supplierName": "MONASH_SUPPLIER1",
            "displayRequestId": 1
        }
    ]
}

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