Java: fasterxml ObjectMapping

Quite often I tend to run into a problem of mapping data to Containers.

Example:

Map results = mapper.readValue(jsonSource,
   new TypeReference<Map>() { } );
// why extra work? Java Type Erasure will prevent type detection otherwise

 

More info on mapping JSON to conrete types can be found here

Advertisements