This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Is there any framework that automates XML to POJO and vice versa? something like jackson to convert JSON to object. Does Axis2 have thi capability or does java already have built-in implementation for this? thanks
Hendra Kurniawan wrote:Is there any framework that automates XML to POJO and vice versa? something like jackson to convert JSON to object. Does Axis2 have thi capability or does java already have built-in implementation for this? thanks
JAXB is now part of the standard API.
You can just use JAXB.marshal and JAXB.unmarshal methods
Why not, indeed? Those are two ways of describing the same data. But I don't see where the confusion is, there's nothing wrong with having two or more ways of doing the same thing.
However that's not the end of the story. There are reasons why you would use attributes and there are reasons why you would use elements. The most obvious is that an element can't have two attributes with the same name, but it can have two child elements with the same name. And from a design point of view, using an attribute signals that there can't be duplicates. The debate goes much farther than that, though, I suggest you google for xml element versus attribute if you really want to get into that.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com