Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How does XStream compare to JAXB (Java API for XML Binding)?

0
Posted

How does XStream compare to JAXB (Java API for XML Binding)?

0

JAXB

  • JAXB is a standard (JSR-222) with multiple implementations:  Metro (the reference implementation), EclipseLink MOXy, JaxMe, etc.
  • Can start with Java objects, these objects can be annotated to control the XML representation.
  • Can start with XML schema and generate annotated Java objects.

XStream

  • Can start with Java objects, these objects can be annotated to control the XML representation.
  • Can not start from an XML schema, the XStream FAQ suggests XMLBeans for this purpose.

The following example compares JAXB and XStream:

0

JAXB is a Java binding tool. It generates Java code from a schema and you are able to transform from those classes into XML matching the processed schema and back. Note, that you cannot use your own objects, you have to use what is generated.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123