I usually post about Jackson and JSON stuff on Twitter - you can follow me there:

This tutorial illustrates the most common Jackson 2 tasks, problems and solutions while marshalling and unmarshalling JSON.

Basic Jackson Marshalling

Learn quickly how to serialize a Java Entity to a JSON String – and control the mapping process perfectly, to reach the exact JSON format you’re aiming for.

 

Basic Jackson Unmarshalling

Learn how to deserialize a JSON String into a Java Entity – no matter how weird the JSON input is, we need to map it to a well defined Java Entity class.

 

Advanced Jackson Marshalling

Learn advanced serialization configuration and tuning to deal with conditions, various data types and custom Jackson exceptions.

 

Advanced Jackson Unmarshalling

Learn more advanced tips and tricks for unmarshalling JSON input into Java Entity classes.

 

Advanced Jackson Usage

The implementation of all these examples and code snippets can be found in my GitHub project – this is an Eclipse based project, so it should be easy to import and run as it is.

I usually post about Jackson and JSON stuff on Twitter - you should follow me there:


  • Tariq Anees

    How about Streaming with Jackson API. Can you show an example of extracting an array from JSON format:

    {

    “type”: “FeatureCollection”,

    “crs”: { “type”: “name”, “properties”: { “name”: “urn:ogc:def:crs:OGC:1.3:CRS84” } },

    “features”: [

    { “type”: “Feature”, “geometry”: { “type”: “MultiPolygon”, “coordinates”: [ [ [ [ -69.996937628999916, 12.577582098000036 ], [ -69.936390753999945, 12.531724351000051 ], [ -69.924672003999945, 12.519232489000046 ], [ -69.915760870999918, 12.497015692000076 ], [ -69.880197719999842, 12.453558661000045 ], [ -69.876820441999939, 12.427394924000097 ], [ -69.888091600999928, 12.417669989000046 ], [ -69.908802863999938, 12.417792059000107 ], [ -69.930531378999888, 12.425970770000035 ], [ -69.945139126999919, 12.44037506700009 ], [ -69.924672003999945, 12.44037506700009 ], [ -69.924672003999945, 12.447211005000014 ], [ -69.958566860999923, 12.463202216000099 ], [ -70.027658657999922, 12.522935289000088 ], [ -70.048085089999887, 12.531154690000079 ], [ -70.058094855999883, 12.537176825000088 ], [ -70.062408006999874, 12.546820380000057 ], [ -70.060373501999948, 12.556952216000113 ], [ -70.051096157999893, 12.574042059000064 ], [ -70.048736131999931, 12.583726304000024 ], [ -70.052642381999931, 12.600002346000053 ], [ -70.059641079999921, 12.614243882000054 ], [ -70.061105923999975, 12.625392971000068 ], [ -70.048736131999931, 12.632147528000104 ], [ -70.00715084499987, 12.5855166690001 ], [ -69.996937628999916, 12.577582098000036 ] ] ] ] } }]}

    • Hey Tariq,
      That might be an interesting topic for an article. My suggestion – if you need to have a quicker answer – have a proper test that can be used to reproduce what you’re trying to achieve – and email me the details. I’d be happy to have a look. Cheers,
      Eugen.