Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Replace JSONArray with new elements in a JSONObject in Jackson without iterating

I'm using Jackson to serialize data. I need to replace all elements of a JSONArray within a JSONObject without iterating through the array. How can I do this?

I'm using this at the moment

JsonNode parentNode = formNode.findParent("form");
((ObjectNode) parentNode).replace("form" , jsonNode);

But it does not remove the older elements just adds the new ones.

Comments