Problems marshalling a map in Jaxb

前端 未结 3 369
刺人心
刺人心 2021-01-15 15:33

I have a class world that contains a map of humans. If I marshal the class world I get following output:


    
        &l         


        
3条回答
  •  囚心锁ツ
    2021-01-15 16:30

    As was pointed out by ilcavero an XmlAdapter can be used to apply an alternative mapping to Map (or any type) in JAXB. Below is a link to a concrete example:

    • http://blog.bdoughan.com/2010/07/xmladapter-jaxbs-secret-weapon.html

    For More Information

    • http://blog.bdoughan.com/search/label/XmlAdapter

提交回复
热议问题