encyclopegia.org

XStream

XStream is a Java library to serialize objects to XML (or JSON) and back again. NOTE: Not to confuse with XStream stream processing platform at Meta.

XStream is a Java library to serialize objects to XML (or JSON) and back again. NOTE: Not to confuse with XStream stream processing platform at Meta. ==XStream library== XStream uses reflection to discover the structure of the object graph to serialize at run time, and doesn't require modifications to objects. It can serialize internal fields, including private and final, and supports non-public and inner classes. ===Object graph serialization=== When serializing an object it serializes the full object graph. Duplicate references encountered in the object-model will be maintained. For example, using the following class CD package com.thoughtworks.xstream; public class Cd { private String id; private Cd bonusCd; Cd(String id, Cd bonusCd) { this.id = id; this.bonusCd = bonusCd; } Cd(String id) { this.id = id; } public String getId() { return id; } public Cd getBonusCd() { return bonusCd; } } and add some of these object to a list Cd bj = new Cd("basement_jaxx_singles"); Cd mr = new Cd("maria rita"); List order = new ArrayList<>(); order.add(mr); // adds the same cd twice (two references to the same object) order.add(bj); order.add(bj); // adds itself (cycle) order.add(order); XStream xstream = new XStream(); xstream.alias("cd", Cd.class); System.out.println(xstream.toXML(order)); If the above code is executed with XStream's default relative references mode, it will generate the following XML: maria rita basement_jaxx_singles XStream is free software, distributed under a permissive, revised BSD-style licence.

References

  1. Use XStream to serialize Java objects into XML · retrieved 2009-12-13 · rev 1359727903
    Cite this reference

    MLA "Use XStream to serialize Java objects into XML." 2009-12-13. https://web.archive.org/web/20090219204439/http://www.ibm.com/developerworks/java/library/x-xstream/index.html. Accessed 24 November 2026.

    Chicago "Use XStream to serialize Java objects into XML." 2009-12-13. https://web.archive.org/web/20090219204439/http://www.ibm.com/developerworks/java/library/x-xstream/index.html.

    APA encyclopegia.org. (2009). Use XStream to serialize Java objects into XML. Retrieved November 24, 2026, from https://web.archive.org/web/20090219204439/http://www.ibm.com/developerworks/java/library/x-xstream/index.html

  2. XStream - References · retrieved 2009-12-13 · rev 1359727903
    Cite this reference

    MLA "XStream - References." 2009-12-13. https://x-stream.github.io/references.html. Accessed 24 November 2026.

    Chicago "XStream - References." 2009-12-13. https://x-stream.github.io/references.html.

    APA encyclopegia.org. (2009). XStream - References. Retrieved November 24, 2026, from https://x-stream.github.io/references.html

Cite this article

MLA

"XStream." encyclopegia.org, 2026, https://encyclopegia.org/wiki/xstream. Accessed 24 November 2026.

Chicago

"XStream." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/xstream.

APA

encyclopegia.org. (2026). XStream. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/xstream

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Xstream Pictures

enwiki · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1359727903 · 0.5 · snapshot enwiki-001359727903

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.