File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes XML directly to java classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML directly to java classes" Watch "XML directly to java classes" New topic

XML directly to java classes

Petr Blahos
Ranch Hand

Joined: Apr 28, 2004
Posts: 131
Hi all,

I was wondering if there is a library that will allow me read
xml directly into a structure of Java classes. Example:
Let's have an xml:

And java classes:

This library would read the xml and build the corresponding
structure of classes. Any hints?

Thanks, Petr

Get a better web browser:<br /><a href="" target="_blank" rel="nofollow"></a>
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
Take a look at XStream.

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Daniel Mayer
Ranch Hand

Joined: Sep 09, 2004
Posts: 103
Alternatives are and
I agree. Here's the link:
subject: XML directly to java classes
It's not a secret anymore!