org.sonatype.gshell.util.marshal
Class MarshallerSupport<T>

java.lang.Object
  extended by org.sonatype.gshell.util.marshal.MarshallerSupport<T>
All Implemented Interfaces:
Marshaller<T>

public class MarshallerSupport<T>
extends Object
implements Marshaller<T>

Support for Marshaller implementations.

Since:
2.3
Author:
Jason Dillon

Constructor Summary
MarshallerSupport(Class rootType)
           
 
Method Summary
protected  void configure(com.thoughtworks.xstream.XStream xs)
           
protected  void configureAnnotations(com.thoughtworks.xstream.XStream xs, Class... classes)
           
protected  com.thoughtworks.xstream.XStream createXStream()
           
 String marshal(T root)
           
 void marshal(T root, File file)
           
 void marshal(T model, OutputStream output)
           
 void marshal(T model, Writer writer)
           
 T unmarshal(File file)
           
 T unmarshal(InputStream input)
           
 T unmarshal(Reader reader)
           
 T unmarshal(String xml)
           
 T unmarshal(URL url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarshallerSupport

public MarshallerSupport(Class rootType)
Method Detail

createXStream

protected com.thoughtworks.xstream.XStream createXStream()

configure

protected void configure(com.thoughtworks.xstream.XStream xs)

configureAnnotations

protected void configureAnnotations(com.thoughtworks.xstream.XStream xs,
                                    Class... classes)

marshal

public void marshal(T model,
                    OutputStream output)
Specified by:
marshal in interface Marshaller<T>

marshal

public void marshal(T model,
                    Writer writer)
Specified by:
marshal in interface Marshaller<T>

marshal

public String marshal(T root)
Specified by:
marshal in interface Marshaller<T>

unmarshal

public T unmarshal(InputStream input)
Specified by:
unmarshal in interface Marshaller<T>

unmarshal

public T unmarshal(Reader reader)
Specified by:
unmarshal in interface Marshaller<T>

unmarshal

public T unmarshal(String xml)
Specified by:
unmarshal in interface Marshaller<T>

unmarshal

public T unmarshal(URL url)
            throws IOException
Specified by:
unmarshal in interface Marshaller<T>
Throws:
IOException

marshal

public void marshal(T root,
                    File file)
             throws IOException
Specified by:
marshal in interface Marshaller<T>
Throws:
IOException

unmarshal

public T unmarshal(File file)
            throws IOException
Specified by:
unmarshal in interface Marshaller<T>
Throws:
IOException


Copyright © 2008-2011 Sonatype. All Rights Reserved.