3

I see there are lots of questions here about that, but none of them covers this situation completely i think.

Let's assume that we have a map like

 Map<String, Object> myMap;

It can have various type of objects in it, i mean objects can be anything, any bean you can write, any collection you can write, also any map you can write (yes map in map also) etc.

Serializing this map is very easy, there is nothing to do with it, but when we are deserializing this map, how can we retrieve the type of each object also ?

I know we can save type information for each Object, but what if for nested beans ? nested maps or collections ? is there a generic deserializer or something like that for it ? or how should i implement a solution for this ?

oko
  • 1,295
  • 1
  • 14
  • 30

1 Answers1

0

If you serialize the type information, then jackson should be able to deserialize it back to the right type, no matter if there are nested objects etc.

eugen
  • 5,856
  • 2
  • 29
  • 26