Jackson JSON User Group

JSON in Java the Right Way -- Action, Jackson!

Where are

ObjectMapper.readValue(JsonNode, Class)

and

ObjectMapper.readValue(JsonNode, TypeReference)

?

Thx!

Views: 91

Reply to This

Replies to This Discussion

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!

I'll try it.

Unfortunately I can't migrate to 2.0 because Spring MVC doesn't support it yet. :0(

RSS

© 2013   Created by Tatu Saloranta.   Powered by

Badges  |  Report an Issue  |  Terms of Service