Java Object to XML and vice versa

B

Betty

Sam Hwang said:
Hello,
I need to convert Java objects and XML files interchangely. I examined
some existed frameworks, thay are XStream[http://xstream.codehaus.com],
Quick[http://qare.sourceforge.net/web/2001-12/products/quick/index.html],
Castor[http://www.castor.org/], JiBX[http://jibx.sourceforge.net/].
Which one is more competitive and ease of use? Thanks!

Regards,
Sam Hwang

com·pet·i·tive
com·pet·i·tive (kem-pèt¹î-tîv) adjective
1. Of, involving, or determined by competition: competitive games.
2. Liking competition or inclined to compete: a highly competitive sales
representative.
3. Biochemistry. Relating to the inhibition of enzyme activity that results
from the reversible combination of an enzyme with an alternate compound and
prevents normal substrate binding.
- com·pet¹i·tive·ly adverb
- com·pet¹i·tive·ness noun
 
R

Ross Bamford

Hello,
I need to convert Java objects and XML files interchangely. I examined
some existed frameworks, thay are XStream[http://xstream.codehaus.com],
Quick[http://qare.sourceforge.net/web/2001-12/products/quick/index.html],
Castor[http://www.castor.org/], JiBX[http://jibx.sourceforge.net/].
Which one is more competitive and ease of use? Thanks!

Regards,
Sam Hwang
Hi,

Depends on your usage. Do you want a SAX-style event stream of DOM-style
tree of objects?

If the latter I highly recommend Apache Commons Digester at
http://jakarta.apache.org/commons/digester

Cheers,
Ross
 
A

Abrasive Sponge

Betty said:
Hello,
I need to convert Java objects and XML files interchangely. I examined
some existed frameworks, thay are XStream[http://xstream.codehaus.com],
Quick[http://qare.sourceforge.net/web/2001-12/products/quick/index.html],
Castor[http://www.castor.org/], JiBX[http://jibx.sourceforge.net/].
Which one is more competitive and ease of use? Thanks!

Regards,
Sam Hwang


com·pet·i·tive
com·pet·i·tive (kem-pèt¹î-tîv) adjective
1. Of, involving, or determined by competition: competitive games.
2. Liking competition or inclined to compete: a highly competitive sales
representative.
3. Biochemistry. Relating to the inhibition of enzyme activity that results
from the reversible combination of an enzyme with an alternate compound and
prevents normal substrate binding.
- com·pet¹i·tive·ly adverb
- com·pet¹i·tive·ness noun
2. Liking competition or inclined to compete: a highly competitive sale
representative.


Yep, that's what the original poster was getting at. If you don't think
there is competition in the open-source market or the software market in
general you might need to get out from under a rock.
 
E

Edmond wong

Sam said:
Hello,
I need to convert Java objects and XML files interchangely. I examined
some existed frameworks, thay are XStream[http://xstream.codehaus.com],
Quick[http://qare.sourceforge.net/web/2001-12/products/quick/index.html],
Castor[http://www.castor.org/], JiBX[http://jibx.sourceforge.net/].
Which one is more competitive and ease of use? Thanks!

Regards,
Sam Hwang

Hi Sam,

You probably need to get the requirements of your project first. If you
are to interface with a 3rd party XML interface, there are specific
requirements you will need. Requirements, for example, are if the 3rd
party XML document format have element-attribute(s), and if the null
value will be handled by </empty> or the whole element will be removed
from the document. So, if it is the case, xStream would not be a good
candidate unless you go extra efforts to build your own code on top of
xStream.
If you are not restricted by the 3rd party XML interface, you can have a
wider selection of tool to use.
Also, please look into Sun's JDK1.2 XML decoder/encoder for
serialization/deserialization first if it fits your need.

Thanks,

Edmond
 
I

iksrazal

Sam Hwang said:
Hello,
I need to convert Java objects and XML files interchangely. I examined
some existed frameworks, thay are XStream[http://xstream.codehaus.com],
Quick[http://qare.sourceforge.net/web/2001-12/products/quick/index.html],
Castor[http://www.castor.org/], JiBX[http://jibx.sourceforge.net/].
Which one is more competitive and ease of use? Thanks!

Regards,
Sam Hwang

There is also JAXB from Sun of several JSR implementations. There are
a couple articles about it on onjava.com . It converts an XML schema
to java source, and objects to XML.

iksrazal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top