本文介绍了以有效的方式将XML解析为JAVA POJO的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何以高效的方式解析和创建xml以下的java pojo?请建议任何有效的解析器。
How to parse and create java pojo for below xml in an efficient way? Kindly suggest any efficient parser.
XML格式是
<?xml version="1.0" encoding="utf-8"?>
<CCMainRootTag ID="12">
<Header TableName="TableName" TableVersion="12" TableID="12" CreatedDate="2013-02-09T15:35:33" CreatedByUserName="ABC" CreatedBySystem="ABC" />
<ClassPrimary ID="12" Code="Y" DescriptionDK="DK language " DescriptionUK="" DefDK="" DefUK="" IFDGUID="">
<ObjectClass ID="12" Code="YA" DescriptionDK="DK Language" DescriptionUK="" DefDK="" DefUK="" IFDGUID="">
<Synonym>
<Concept Description="Description" Language="DK" />
<Concept Description="" Language="UK" />
<Concept Description="Description" Language="DK" />
<Concept Description="" Language="UK" />
<Concept Description="Description" Language="DK" />
<Concept Description="" Language="UK" />
<Concept Description="Description" Language="DK" />
<Concept Description="" Language="UK" />
</Synonym>
</ObjectClass>
<ObjectClass ID="12" Code="YB" DescriptionDK="DK Language" DescriptionUK="" DefDK="" DefUK="" IFDGUID=""> </ObjectClass>
<ObjectClass ID="12" Code="YC" DescriptionDK="DK Language" DescriptionUK="" DefDK="" DefUK="" IFDGUID=""> </ObjectClass>
<ObjectClass ID="12" Code="YD" DescriptionDK="DK language" DescriptionUK="" DefDK="" DefUK="" IFDGUID=""> </ObjectClass>
</ClassPrimary>
</CCMainRootTag>
我已使用此但它的性能很慢而且问题没有效果pojo。
I already use thisLink but it have slow performance and having problem did't valid pojo.
我想解析哪个提供我以高效的方式指导java pojo。
I want to parser which provide me direct java pojo in a efficient way.
推荐答案
你可以使用将XML转换为Java POJO。但在最终确定解决方案之前,请以进行性能比较。
You can use JAXB to convert XML into Java POJOs. But before you finalize the solution check this site for performance comparison.
这篇关于以有效的方式将XML解析为JAVA POJO的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!