0
如何用JAXB注释(XMLJavaTYpeAdapter)描述Java类?其实我想将以下XML格式解组成Java对象。JAXB解组XmlJavaTypeAdapter
<map>
<entry key="extraProperties">
<map>
<entry key="message" value=""/>
<entry key="entity">
<map>
<entry key="starttime" value="1330086091375"/>
<entry key="state" value="1"/>
<entry key="uptime" value="2837656746"/>
</map>
</entry>
<entry key="childResources">
<map>
<entry key="transaction-service" value="https://47.168.96.31:4848/monitoring/domain1/instanceMaster/transaction-service"/>
<entry key="http-service" value="https://47.168.96.31:4848/monitoring/domain1/instanceMaster/http-service"/>
<entry key="applications" value="https://47.168.96.31:4848/monitoring/domain1/instanceMaster/applications"/>
<entry key="deployment" value="https://47.168.96.31:4848/monitoring/domain1/instanceMaster/deployment"/>
<entry key="jvm" value="https://47.168.96.31:4848/monitoring/domain1/instanceMaster/jvm"/>
<entry key="web" value="https://47.168.96.31:4848/monitoring/domain1/instanceMaster/web"/>
<entry key="security" value="https://47.168.96.31:4848/monitoring/domain1/instanceMaster/security"/>
<entry key="network" value="https://47.168.96.31:4848/monitoring/domain1/instanceMaster/network"/>
</map>
</entry>
</map>
</entry>
<entry key="message" value=""/>
<entry key="exit_code" value="SUCCESS"/>
<entry key="command" value="Monitoring Data"/>
</map>
向Map类中添加额外的一个XmlElement解决了我的问题。 – 2012-03-29 12:30:53