fi.helsinki.dacopan.scenario
Class XStreamObjectSerializer

java.lang.Object
  extended by fi.helsinki.dacopan.scenario.XStreamObjectSerializer
All Implemented Interfaces:
ObjectSerializer

public class XStreamObjectSerializer
extends java.lang.Object
implements ObjectSerializer

An ObjectSerializer implementation based on XStream, a library which serializes object graphs as XML.

Contains special support for Identifiable objects in the model package, they're not serialized as is, instead only their ids are output.

Version:
$Id: XStreamObjectSerializer.java,v 1.5 2004/05/10 09:55:43 aarniala-dacopan Exp $

Constructor Summary
XStreamObjectSerializer()
           
 
Method Summary
 java.lang.Object loadObject(java.io.Reader r)
          Loads an object from the given reader.
 void saveObject(java.lang.Object o, java.io.Writer w)
          Serializes the given object to the writer.
 void setDataView(DataView view)
          Sets the DataView instance the serializer can use to resolve model objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XStreamObjectSerializer

public XStreamObjectSerializer()
Method Detail

saveObject

public void saveObject(java.lang.Object o,
                       java.io.Writer w)
Description copied from interface: ObjectSerializer
Serializes the given object to the writer.

Specified by:
saveObject in interface ObjectSerializer
Parameters:
o - the object to be written out
w - target writer

loadObject

public java.lang.Object loadObject(java.io.Reader r)
Description copied from interface: ObjectSerializer
Loads an object from the given reader.

Specified by:
loadObject in interface ObjectSerializer
Parameters:
r - source reader
Returns:
the loaded object

setDataView

public void setDataView(DataView view)
Description copied from interface: ObjectSerializer
Sets the DataView instance the serializer can use to resolve model objects.

Specified by:
setDataView in interface ObjectSerializer
Parameters:
view - to be used for fetching model objects


© Dacopan2 team, 2005-