I have a simple JSON like this:
{
"enums" : [{"someName" : " someValue ", etc.. }]
}
Sometimes, someValue has whitespace in it. (ie. " someValue ")
I can't seem to get how to SET each value back to the node. I have this:
JsonNode values = root.get("enumValues");
Iterator<Entry<String, JsonNode>> nodes = values.getFields();
while (nodes.hasNext()) {
Map.Entry<String, JsonNode> entry = (Map.Entry<String, JsonNode>) nodes.next();
// what do I do here?
}
I know that JsonNodes are imutable, but how do I get the JsonObjects? <String, JsonObject> wont work.
I want to be able to parse this as an object (I eventually want to make in recursive for more complex JSON, but one thing at a time) so that when I print the JSON out it would look like this:
{
"enums" : [{"someName" : "someValue", etc.. }]
}