Marshalling List that consists of LinkedHashMap objects

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Marshalling List that consists of LinkedHashMap objects

forums
Hi. I have a problem in following scenario: 1. Unmarshalling xml file 2.
Marshalling POJO to json 3. Unmarshalling json back to POJO 4. Marshalling
POJO back to xml Forth step fails because jackson is using LinkedHashMap in
order to preserve order of elements. In general I have got two solutions: 1.
First fails because it cannot handle mixed content elements inside xmls 2.
Second one would work if only JAXB could handle LinkedHashMaps. I read about
XmlAdapters unfortunatelly mentioned LinkedHashMaps are not generated in
pojos nor are mine contribution. They are put into Listtyped fields by
jackson during deserialization process and I cannot apply examples that can
be found on the Internet in my project. I attached sample maven project with
two tests. Could someone please take a look at it and suggest me what can I
change in order to make it work? Thanks!

--

[Message sent by forum member 'piotr.tempes']

View Post: http://forums.java.net/node/895572




try.zip (2M) Download Attachment