Contents - Cultural View
Contents - Cultural View Contents - Cultural View
XStream 306 XStream Developer(s) Codehaus Initial release January 1, 2004 Written in Java Operating system Cross-platform License BSD-style license Website http:/ / xstream. codehaus. org/ XStream is a simple Java library to serialize objects to XML (or JSON) and back again. [1] 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. [2] 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;
XStream 307 } 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. Usage • Confluence [3] • Apache Muse [3] External links • XStream Library Home Page [4] References [1] "Serializing Java Objects with XStream" (http:/ / www. xml. com/ lpt/ a/ 1462). XML.com, O'Reilly Media, Inc. 2004-08-18. . Retrieved 2009-12-14. [2] "Use XStream to serialize Java objects into XML" (http:/ / www. ibm. com/ developerworks/ java/ library/ x-xstream/ index. html). Ibm.com. . Retrieved 2009-12-14. [3] "XStream - References" (http:/ / xstream. codehaus. org/ references. html). Xstream.codehaus.org. . Retrieved 2009-12-14. [4] http:/ / xstream. codehaus. org/
- Page 259 and 260: Primitive wrapper class 255 Primiti
- Page 261 and 262: Quark Framework 257 Quark Framework
- Page 263 and 264: Quark Framework 259 has proven to p
- Page 265 and 266: Quark Framework 261 //illustrates p
- Page 267 and 268: Quark Framework 263 As well as LECC
- Page 269 and 270: Quark Framework 265 `catch` (\ex ->
- Page 271 and 272: REPLAY (software) 267 Qualities REP
- Page 273 and 274: Real time Java 269 References [1] J
- Page 275 and 276: Restlet 271 Connectors The list of
- Page 277 and 278: SLAMD 273 SLAMD The SLAMD Distribut
- Page 279 and 280: SLAMD Server 275 SLAMD Server A SLA
- Page 281 and 282: Bruno Souza 277 Bruno Souza Born Na
- Page 283 and 284: Static import 279 References [1] Ja
- Page 285 and 286: strictfp 281 Behaviors and restrict
- Page 287 and 288: Sun Web Developer Pack 283 Sun Web
- Page 289 and 290: Swing (Java) 285 The Swing Architec
- Page 291 and 292: Swing (Java) 287 Relationship to AW
- Page 293 and 294: Swing (Java) 289 } window } See als
- Page 295 and 296: SwingLabs 291 • JDNC [7] : Contai
- Page 297 and 298: Synth Look and Feel 293 Supposing t
- Page 299 and 300: TeachScheme! 295 • a function def
- Page 301 and 302: TeachScheme! 297 TeachScheme! and B
- Page 303 and 304: Unified Expression Language 299 Imp
- Page 305 and 306: Java Virtual Machine 301 Bytecode v
- Page 307 and 308: Java Virtual Machine 303 Heap The J
- Page 309: Xerlin 305 • Steinbrenner, Eugen
- Page 313 and 314: Article Sources and Contributors 30
- Page 315 and 316: Article Sources and Contributors 31
- Page 317 and 318: Image Sources, Licenses and Contrib
XStream 306<br />
XStream<br />
Developer(s) Codehaus<br />
Initial release January 1, 2004<br />
Written in Java<br />
Operating<br />
system<br />
Cross-platform<br />
License BSD-style license<br />
Website http:/ / xstream. codehaus.<br />
org/<br />
XStream is a simple Java library to serialize objects to XML (or JSON) and back again. [1]<br />
XStream library<br />
XStream stands out for its ease of use and low footprint. It uses reflection to discover the structure of the object<br />
graph to serialize at runtime. The XML it generates is very readable.<br />
The library doesn't require modifications to objects, so it's non intrusive to use the library. It can serialize internal<br />
fields, including private and final. Supports non-public and inner classes. [2]<br />
Object graph serialization<br />
When serializing an object it serializes the full object graph. Duplicate references encountered in the object-model<br />
will be maintained. For example using the following class CD<br />
package com.thoughtworks.xstream;<br />
public class Cd {<br />
private String id;<br />
private Cd bonusCd;<br />
Cd(String id, Cd bonusCd) {<br />
}<br />
this.id = id;<br />
this.bonusCd = bonusCd;<br />
Cd(String id) {<br />
}<br />
this.id = id;<br />
public String getId() {<br />
}<br />
return id;<br />
public Cd getBonusCd() {<br />
}<br />
return bonusCd;