简体   繁体   English

在Java中解析json数组字符串

[英]Parse json array String in java

I have a json String as follows. 我有一个JSON字符串如下。

"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. 我正在尝试使用Jackson 2解析它。我知道它是一个数组,它映射到Java中的java.util.List,但是其中的元素呢? which object does it match to in java and how should i retrieve all those elements in array. 它与Java中的哪个对象匹配,我应如何检索数组中的所有那些元素。 Does each element maps to HashMap? 每个元素都映射到HashMap吗?

Correct the input, so it becomes valid JSON 更正输入,使其变为有效的JSON

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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