JSON in Java the Right Way -- Action, Jackson!
Where are
ObjectMapper.readValue(JsonNode, Class)
and
ObjectMapper.readValue(JsonNode, TypeReference)
?
Thx!
Tags:
Permalink Reply by Tatu Saloranta on April 3, 2012 at 10:53am If those were deprecated in 1.9, they have been removed. Replacement would be:
mapper.treeToValue(node, class);
although looks like there is no alternatives that take JavaType or TypeReference (you can always construct JavaType from Class or TypeReference tho).
So for second one you would use:
mapper.convertValue(JsonNode, TypeReference)
Hope this helps!
Permalink Reply by Bruno Hansen on April 4, 2012 at 6:51pm I'll try it.
Unfortunately I can't migrate to 2.0 because Spring MVC doesn't support it yet. :0(
© 2013 Created by Tatu Saloranta.
Powered by