XStream

XStream

Infobox Software
name = XStream Library



caption =
developer = Codehaus
released = initial release|2004|01|01
operating_system = Cross-platform
programming_language = Java
license = BSD-style license
website = [http://xstream.codehaus.org/ xstream.codehaus.org]

XStream can be one of the following:

* a simple Java library to serialize objects to XML and back again.
* a Danish IT-company offering streaming media business solutions (spelled Xstream)
* a simple functional transformation language for XML documents derived from Caml, for which a compiler is provided under CeCILL free software licence.

XStream library

XStream stands out for its ease of use and low footprint. It uses reflection to discover the structure of the object graph to serialize at runtime. The XML it generates is very readable.

The library doesn't require modifications to objects, so it's non intrusive to use the library. It can serialize internal fields, including private and final. 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 CDpackage 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 listCd 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.

External links

* [http://xstream.codehaus.org/ XStream Library Home Page]
* [http://gallium.inria.fr/~frisch/xstream/ XStream, the functional transformation language for XML]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • XStream — est une bibliothèque Java qui a pour but de faciliter la conversion du langage Java vers le langage XML et le contraire. L utilisation de la réflexivité Java est mise à contribution pour découvrir la structure du graphe des objets à sérialiser… …   Wikipédia en Français

  • Xstream Pictures — is a Chinese production company based out of Beijing and Hong Kong that was founded by filmmakers Jia Zhangke, Chow Keung, and Yu Lik wai.cite web|url= http://www.newyorkerfilms.com/nyf/t elements/stilllife/stilllife pk.pdf| title= Still Life… …   Wikipedia

  • XStream Systems — Infobox Company company name = XStream Systems, Incorporated company company type = Private country = USA slogan = Precise Detection for an Uncertain World foundation = 2004 location = USA key people = Thomas Cook CEO Brian Mayo, President Alan… …   Wikipedia

  • Vue — (aus dem frz. vue, „Blickwinkel“, „Ansicht“ oder „Sehsinn“, im Deutschen ein veraltendes Bildungs Fremdwort für „(schöne) Aussicht“ (vgl. „Bellevue“), „(schöner) Anblick“) ist der Name einer Software Produktlinie des US amerikanischen… …   Deutsch Wikipedia

  • Vue 6 — « Vue 6 » est une gamme de logiciels, édités par E On Software, dédiés entre autres à la création et au rendu de paysages (réalistes ou non), ainsi qu à l animation d objets. Les logiciels de la gamme disposent des outils nécessaires à… …   Wikipédia en Français

  • XML transformation language — An XML transformation language is a computer language designed specifically to transform an input XML document into an output XML document which satisfies some specific goal.There are two special cases of transformation: * XML to XML : the output …   Wikipedia

  • Diving regulator — and Octopus Other names Demand valve Uses Reduces pressurized breathing gas to ambient pressure and delivers it to the diver Inventor Manuel Théodore Guillaumet (1838), Benoît Rouquayrol (1860) …   Wikipedia

  • Triton (content delivery) — Triton was a digital delivery and digital rights management service created by Digital Interactive Streams, which abruptly went out of business in early October 2006.Triton was a new competitor in the rapidly growing market for electronic… …   Wikipedia

  • Still Life (2006 film) — Infobox Film name = Still Life imdb id = 0859765 amg id = 1:360794 writer = Jia Zhangke Sun Jianming Guan Na starring = Zhao Tao Han Sanming director = Jia Zhangke producer = Xu Pengle Wang Tianyun Zhu Jiong distributor = International: Xstream… …   Wikipedia

  • Dong (film) — Dong Directed by Jia Zhangke Produced by Yu Lik wai Zhu Jiong Chow Keung Dan Bo …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”