Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java JAXB Pros/Cons and Documentation [closed]

It's been a while since I used Java in anger so please forgive me if this is silly.

I have just got started on a Java project where we are using JAXB to de-serializing an incoming XML string (from Jetty Server). The project is only using JAXB for this situation.

What are the alternatives to JAXB?
What are pros/cons of JAXB to these alternatives

I have done some googling and found lots of reference material, but is there a definitive source that is the goto place for JAXB questions or do people just see what people are doing and interpret from there.

Thanks.

like image 745
Martin York Avatar asked Dec 16 '08 15:12

Martin York


People also ask

What is the advantage of JAXB?

JAXB simplifies access to an XML document from a Java program by presenting the XML document to the program in a Java format. The first step in this process is to bind the schema for the XML document into a set of Java classes that represents the schema.

Is JAXB memory efficient?

Generally JAXB is quite efficient and you shouldn't care about memory issues unless your application handles XMLs of very large size.

When should JAXB be used?

JAXB stands for Java Architecture for XML Binding. It provides mechanism to marshal (write) java objects into XML and unmarshal (read) XML into object. Simply, you can say it is used to convert java object into xml and vice-versa.

Is JAXB part of Java?

1.1. What is JAXB? Java Architecture for XML Binding (JAXB) is a standard that defines an API for reading and writing Java objects to and from XML documents.


1 Answers

I've found JAX-B pretty useful and actually like it better than many of the alternatives, especially if I'm starting from scratch and generating a schema from Java objects rather than Java objects from a schema.

In my experience, for whatever reason, I've found good documentation hard to come by from just Google searches. The best electronic documentation is provided in the JAX-B download where you'll also find numerous examples. "SOA Using Java Web Services" also has a good overview.

As for alternatives, there is:

  • XStream
  • Castor

and probably several more.

like image 53
Dave Ray Avatar answered Sep 30 '22 18:09

Dave Ray