Search code examples
javaxmlxstream

Modern alternative to Java XStream library?


I used XStream many years ago, but I see that the libraries is not updated since 2008 (latest news). Is there now a more modern and up to dates Java XML serialization library?


Solution

  • In order of preference, relevancy and activity:

    JAXB

    Visit the JAXB project's site to check out the tutorial and guide. Have also a look at the original JAXB architecture whitepaper.

    The JAXB projet listed above is the reference implementation of the API, and is packaged in by the GlassFish Application Server.

    EclipseLink's MOXy

    Visit the EclipseLink project's site and read this introductory article to EclipseLink on InfoQ, and see Blaise Doughan's answer about MOXy.

    EclipseLink originated from Oracle's TopLink and is now open source, managed by the Eclipse Foundation, and used in a number of Eclipse-based products.

    XStream

    Yes, XStream, because it's actually been updated in 2011 with a major update and 2 service releases since you asked, so it seems well-maintained and a pretty good contender used by mature projects. Don't forget to check what's new in version 1.4.x.

    Visit the XStream project's site and its tutorial to compare.

    XmlBeans

    Visit the XmlBeans project's site.

    XmlBeans is a well-tested project that has been around for a while.

    JiBX

    Visit the JiBX project's site, follow the tutorial and guide.

    JiBX might be a simpler alternative if you don't like the complexity of XmlBeans or even JAXB.