How to read unnamed JSon Values [closed]

When parsing the given JSon format with Jackson ObjectMapper, I get the following error: Unexpected end-of-input: expected close marker for Array. How can I parse this kind for format?

[
  [
    1499040000000,      // Open time
    "0.01634790",       // Open
    "0.80000000",       // High
    "0.01575800",       // Low
    "0.01577100",       // Close
    "148976.11427815",  // Volume
    1499644799999,      // Close time
    "2434.19055334",    // Quote asset volume
    308,                // Number of trades
    "1756.87402397",    // Taker buy base asset volume
    "28.46694368",      // Taker buy quote asset volume
    "17928899.62484339" // Ignore.
  ]
]

I’m getting this result from an external REST API. The format is not under my control.

Test case to verify the correct parsing:

class JSonHelperTest {

  private static final String KLINES = "[n" +
          "[n" +
          "  [n" +
          "    1499040000000,n" +
          "    "0.01634790",n" +
          "    "0.80000000",n" +
          "    "0.01575800",n" +
          "    "0.01577100",n" +
          "    "148976.11427815",n" +
          "    1499644799999,n" +
          "    "2434.19055334",n" +
          "    308,n" +
          "    "1756.87402397",n" +
          "    "28.46694368",n" +
          "    "17928899.62484339"n" +
          "  ]n" +
          "]n";
  
  @Test
  public void readKlines() throws JsonProcessingException {
    ObjectMapper objectMapper = JSonHelper.createObjectMapper();
    JsonNode jsonNode = objectMapper.readTree(KLINES);


  }
}

Answer

It is an Object Array, not a valid JSON. Is the order/index of the values are always same? I mean High and Low will be always at index 2 and 3? If yes then read them by looping and populating a POJO.

DozerMapping can be useful. Similar solution here.