JAXB - 同一元素的多个值

时间:2016-05-29 14:48:32

标签: java binding jaxb

我的用例是这样的,我得到一个具有多个属性的对象,我需要使用Jaxb将其映射到XML中的2个元素。

例如:  Employee Object具有emp id,emp name,salary

这需要映射到

<customProperties> 
<customPropName> EmpId </customPropName>
<customPropId> 123456 </customPropId>
<customPropName> EmpName </customPropName>
<customPropId> John Doe </customPropId>
<customPropName> Salary </customPropName>
<customPropId> 1029 </customPropId>
<customProperties> 

我如何实现这一目标?

1 个答案:

答案 0 :(得分:0)

也许可以在这里试试a googled example