Generate XML from class using JAVA

I've asked this question before:

Generate XML from class

I want to do this with Java.

Can I do the same with Java via attributes?

or there is a framework that I can use for this purpose.

+3
java xml


source to share


3 answers


XStream will allow you to represent any class as XML. You can check here for an example.



+8


source to share


JAXB might be what you want. This is pretty common. You just add some annotations to your properties and any instance of this class can be serialized / deserialized to XML.



+5


source to share


I prefer XStream, but there is also Castor XML

0


source to share







All Articles
Loading...
X
Show
Funny
Dev
Pics