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
Post a Comment