Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

store java class as XML

  Asked By: Lucina    Date: Oct 08    Category: Java    Views: 990
  

Does anybody know how to store java class as xml. I need to store all
field (private, public) of structure and get xml. There are some
difficult cases when a class contain other classes or arrays. Are
there special libraries, which allow doing that?

I deal with distributed system, I have to create xml on the base of
CORBA stubs, and I do it by hand. Is it possible to write function
that create xml by CORBA stub or by any class. I have wrote very
simple method which doesn't work with arrays, variable of class type
and can get data with simple type as String or Long. But it's not
enough for me because I have very difficult structures.

Share: 

 

3 Answers Found

 
Answer #1    Answered By: Khadeeja Malik     Answered On: Oct 08

There is an api already created for you to do exactly what you need:

http://java.sun.com/xml/jaxb/

 
Answer #2    Answered By: Bohdana Nonob     Answered On: Oct 08

No offence meant to any one, but this query has
already been answered some time back...

Please have a look at the answers for Subject heading


JAVA serialized file to XML

 
Answer #3    Answered By: Sunil Kumar     Answered On: Oct 03

You should use the JAXB API and use the marshalling concept then u can easily convert your java class to xml.

 
Didn't find what you were looking for? Find more on store java class as XML Or get search suggestion and latest updates.




Tagged: