views:

339

answers:

1

Hi,

I have a structure like this:

 Hashtable<String, ArrayList<Hashtable<Integer, Integer>>> complexTable

And I want to marshall this using JAXB. I suppose I should write an Adapter for this, but I have no idea how this adapter should look like. Can anybody help me with this?

A: 

I'm not clear what you're trying to do. Do you have a schema for the above object ? Have you looked at the JAXB unofficial guide, particularly the marshalling section ?

If you don't have a schema, and you simply need to persist the above as XML, do you want/need to use JAXB ? Instead you may be interested in XStream. It will serialise/deserialise POJOs (plain old Java objects) to/from XML without the need for a schema. It will handle the above case trivially.

Brian Agnew