On Tue, Dec 4, 2018 at 1:01 PM wrote:
>
> You can also deserialize as JsonNode:
>
> JsonNode json = new ObjectMapper.readValue(jsonString, JsonNode.class);
>
> That will take care of the Json array, you can iterate property by property
> and ask if isJsonArray() or something like that.
> You can
See the following Java Docs:
- *JsonNode:*
https://fasterxml.github.io/jackson-databind/javadoc/2.9/com/fasterxml/jackson/databind/JsonNode.html
- *TreeNode which is the superclass of JsonNode:*
http://fasterxml.github.io/jackson-core/javadoc/2.9/com/fasterxml/jackson/core/TreeNode.html
On
You can also deserialize as JsonNode:
JsonNode json = new ObjectMapper.readValue(jsonString, JsonNode.class);
That will take care of the Json array, you can iterate property by property
and ask if *isJsonArray()* or something like that.
You can also read each value *asText()* which will give
On Tue, Dec 4, 2018 at 12:27 PM Pankaj Dighe
wrote:
> Thanks for the response. Using TypeReference>() { }
> works fine when I have following json
>
> String jsonString = "{\"personId\": 231, \"percentage\": 2.1212, \"name\":
> \"Name\", " +
> "\"activeDate\":\"26-09-2017 11:00:00\"}";
>
Thanks for the response. Using TypeReference>() { }
works fine when I have following json
String jsonString = "{\"personId\": 231, \"percentage\": 2.1212, \"name\":
\"Name\", " +
"\"activeDate\":\"26-09-2017 11:00:00\"}";
but does not work when I have nested json objects. E.g. :
On Tue, Dec 4, 2018 at 10:45 AM Pankaj Dighe
wrote:
> I am trying to deserialize following JSON to map of
>
> String jsonString = "{\"personId\": 231, \"percentage\": 2.1212, \"name\":
> \"Name\", " +
> "\"activeDate\":\"26-09-2017 11:00:00\"}";
>
>
> I am trying to deserialize using
I am trying to deserialize following JSON to map of
String jsonString = "{\"personId\": 231, \"percentage\": 2.1212, \"name\":
\"Name\", " +
"\"activeDate\":\"26-09-2017 11:00:00\"}";
I am trying to deserialize using following code:
new