What is best practice in converting XML to Java object?

后端 未结 10 917
没有蜡笔的小新
没有蜡笔的小新 2021-02-13 16:02

I need to convert XML data to Java objects. What would be best practice to convert this XML data to object?

Idea is to fetch data via a web service (it doesn\'t use WSDL

10条回答
  •  青春惊慌失措
    2021-02-13 16:41

    I have used JIBX in MQ module. It works very well. Ant config is simple. Used Xsd2Jibx converter to generate the binding files and Java beans from XML schema. Marshalling and un-marshalling allow to specify character-set parameter. It was useful in my project to handle custom character-set. But I found an issue in the binding compiler. If the Java bean has lengthier path name, it generates class file with lengthier file name which will cause issue in Windows XP(it has a maximum file length limit).

    I haven't used other APIs. So I am not trying to compare with others. If you decided to use JIBX, I hope this will be helpful.

    More details, please refer JIBX website

提交回复
热议问题