JAXB Marshalling generic list with variable root element name

前端 未结 1 1828
北荒
北荒 2021-01-18 11:24

So I\'m trying to marshal a generic list of objects, but i want each list to have a specific XmlRootElement(name..). The way I\'m doing it, I know it\'s not really possible

相关标签:
1条回答
  • 2021-01-18 12:04

    You can wrap the instance of EntityList in a JAXBElement to provide a root element name at runtime.

    Example

    • http://wiki.eclipse.org/EclipseLink/Examples/MOXy/GettingStarted/TheBasics
    0 讨论(0)
提交回复
热议问题