aspose file tools
The moose likes Java in General and the fly likes How to implement and serialize nested Maps? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "How to implement and serialize nested Maps?" Watch "How to implement and serialize nested Maps?" New topic
Author

How to implement and serialize nested Maps?

Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 359
The code below serializes a hashmap in class Bean. There is a second map in there just to demonstrate sun's bug where maps by default won't serialize.

Let's say I want hash map that looks like this:

Map<String,Map><String,Map><String,String>>> map;

How would I modify my class bean to contain such a map of maps of maps?

I would want to use templates so I'm not contrained to using strings for keys or values. How would this work?

Thanks,
Siegfried

Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 359
I figured it out. Now please see my new post on converting it to generics.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to implement and serialize nested Maps?
 
Similar Threads
Wanted: Help serializing Generic Maps!
Problem regarding HashMap.
Hashtable
How to Serialize Maps?
JAXB - HashMap