org.codehaus.waffle.io
Class XStreamSerializer

java.lang.Object
  extended by org.codehaus.waffle.io.XStreamSerializer
All Implemented Interfaces:
Serializer

public class XStreamSerializer
extends java.lang.Object
implements Serializer

XStream-based serializer. Delegates to XStream the marshalling.

Author:
Mauro Talevi

Constructor Summary
XStreamSerializer()
          Creates a XStreamSerializer with default XStream instance with minimal dependencies
XStreamSerializer(com.thoughtworks.xstream.XStream xstream)
          Creates a XStreamSerializer with a given XStream instance
 
Method Summary
 void marshall(java.lang.Object object, java.io.Writer writer)
          Marshalls object to a writer
 java.lang.Object unmarshall(java.io.Reader reader)
          Unmarshalls object from reader input
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XStreamSerializer

public XStreamSerializer()
Creates a XStreamSerializer with default XStream instance with minimal dependencies


XStreamSerializer

public XStreamSerializer(com.thoughtworks.xstream.XStream xstream)
Creates a XStreamSerializer with a given XStream instance

Parameters:
xstream - the XStream instance
Method Detail

marshall

public void marshall(java.lang.Object object,
                     java.io.Writer writer)
Description copied from interface: Serializer
Marshalls object to a writer

Specified by:
marshall in interface Serializer
Parameters:
object - the Object to marshall
writer - the writer to which the object is marshalled

unmarshall

public java.lang.Object unmarshall(java.io.Reader reader)
Description copied from interface: Serializer
Unmarshalls object from reader input

Specified by:
unmarshall in interface Serializer
Parameters:
reader - the input resource
Returns:
An unmarshalled Object


Copyright © 2008. All Rights Reserved.