org.sonatype.sisu.goodies.marshal.internal
Class MarshallerSupport

java.lang.Object
  extended by org.sonatype.sisu.goodies.common.ComponentSupport
      extended by org.sonatype.sisu.goodies.marshal.internal.MarshallerSupport
All Implemented Interfaces:
Marshaller
Direct Known Subclasses:
JacksonMarshaller, JaxbMarshaller, XstreamMarshaller

public abstract class MarshallerSupport
extends ComponentSupport
implements Marshaller

Support for Marshaller implementations.

Since:
1.0

Field Summary
 
Fields inherited from class org.sonatype.sisu.goodies.common.ComponentSupport
log
 
Constructor Summary
MarshallerSupport()
           
 
Method Summary
protected abstract  String doMarshal(Object body)
           
protected abstract
<T> T
doUnmarshal(String marshaled, Class<T> type)
           
 String marshal(Object body)
           
<T> T
unmarshal(String marshaled, Class<T> type)
           
<T> T
unmarshal(String marshaled, com.google.inject.TypeLiteral<T> type)
           
 
Methods inherited from class org.sonatype.sisu.goodies.common.ComponentSupport
createLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarshallerSupport

public MarshallerSupport()
Method Detail

marshal

public String marshal(Object body)
               throws Exception
Specified by:
marshal in interface Marshaller
Throws:
Exception

doMarshal

protected abstract String doMarshal(Object body)
                             throws Exception
Throws:
Exception

unmarshal

public <T> T unmarshal(String marshaled,
                       Class<T> type)
            throws Exception
Specified by:
unmarshal in interface Marshaller
Throws:
Exception

unmarshal

public <T> T unmarshal(String marshaled,
                       com.google.inject.TypeLiteral<T> type)
            throws Exception
Specified by:
unmarshal in interface Marshaller
Throws:
Exception

doUnmarshal

protected abstract <T> T doUnmarshal(String marshaled,
                                     Class<T> type)
                          throws Exception
Throws:
Exception


Copyright © 2008-2012 Sonatype, Inc.. All Rights Reserved.