将 JsonNode 转换为 list<Object[]>

raa*_*aag 5 java json jackson

我有一个像下面这样的 JSON。

{
  "id": 123,
  "screenId": "abc456",
  "name": "Screen1",
  "description": "screen description",
  "format": [
    {
      "sectionName": "fontType",
      "font": {
        "family": {
          "id": "TIMESNEWROMAN",
          "description": "TIMESNEWROMAN"
        }
      }
    },
    {
      "sectionName": "backgroundColorPanel",
      "color": "#000000"
    },
    {
      "sectionName": "buttonBorderShape",
      "shape": {
        "color": "#000000",
        "type": {
          "id": "SOLID",
          "description": "Solid"
        },
        "size": "12"
      }
    }
  ]
}
Run Code Online (Sandbox Code Playgroud)

我尝试了以下代码将其转换为List<Object[]>但出现异常

代码:

JsonNode node =  mapper.readTree(jsonString);
TypeReference<List<Object[]>> typeRef = new TypeReference<List<Object[]>>(){};
List<Object> list = mapper.readValue(node.traverse(), typeRef);
Run Code Online (Sandbox Code Playgroud)

例外:

Can not deserialize instance of java.util.ArrayList out of START_OBJECT token
Run Code Online (Sandbox Code Playgroud)

我也尝试了以下

mapper.readValue(mapper.treeAsTokens(jsonString), TypeFactory.defaultInstance().constructCollectionType(ArrayList.class, Object[].class))
Run Code Online (Sandbox Code Playgroud)

但我得到了同样的例外。有人能帮我吗?