Package com.tangosol.coherence.rest.io
Class JacksonJsonMarshaller<T>
- java.lang.Object
-
- com.tangosol.coherence.rest.io.AbstractMarshaller<T>
-
- com.tangosol.coherence.rest.io.JacksonJsonMarshaller<T>
-
- All Implemented Interfaces:
Marshaller<T>
- Direct Known Subclasses:
JsonJacksonMarshaller
public class JacksonJsonMarshaller<T> extends AbstractMarshaller<T>
Jackson-based marshaller that marshals object to/from JSON.- Author:
- as 2011.07.13
-
-
Field Summary
-
Fields inherited from interface com.tangosol.coherence.rest.io.Marshaller
FORMAT_OUTPUT
-
-
Constructor Summary
Constructors Constructor Description JacksonJsonMarshaller(Class<T> clzRoot)
Construct JacksonJsonMarshaller instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
marshal(T value, OutputStream out, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders)
Write the specified object into the given stream.T
unmarshal(InputStream in, javax.ws.rs.core.MediaType mediaType)
Read an object from the specified stream.-
Methods inherited from class com.tangosol.coherence.rest.io.AbstractMarshaller
getRootClass
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.tangosol.coherence.rest.io.Marshaller
marshalAsFragment
-
-
-
-
Method Detail
-
marshal
public void marshal(T value, OutputStream out, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders) throws IOException
Description copied from interface:Marshaller
Write the specified object into the given stream.- Parameters:
value
- object to marshallout
- theOutputStream
for the HTTP entity. The implementation should not close the output stream.httpHeaders
- a mutable map of the HTTP message headers.- Throws:
IOException
- if an error occurs during marshalling
-
unmarshal
public T unmarshal(InputStream in, javax.ws.rs.core.MediaType mediaType) throws IOException
Description copied from interface:Marshaller
Read an object from the specified stream.- Parameters:
in
- stream to read frommediaType
- the media type of the object to read- Returns:
- unmarshalled object instance
- Throws:
IOException
- if an error occurs during unmarshalling
-
-