public class Entities extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static com.fasterxml.jackson.databind.ObjectMapper |
mapper |
| Constructor and Description |
|---|
Entities() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends OutputStream> |
marshal(Object resource,
T stream)
Write the serialization of a given resource to a given
OutputStream . |
static <T extends Writer> |
marshal(Object resource,
T writer)
Write the serialization of a given resource to a given
Writer . |
static <T> T |
unmarshal(Class<T> resourceClass,
InputStream stream)
Creates a resource of given class from its serialization in a given
InputStream. |
static <T> T |
unmarshal(Class<T> resourceClass,
Reader reader)
Creates a resource of given class from its serialization in a given
Reader. |
public static <T extends OutputStream> T marshal(Object resource, T stream) throws com.fasterxml.jackson.core.JsonGenerationException, com.fasterxml.jackson.databind.JsonMappingException, IOException
OutputStream .resource - the resourcestream - the stream in inputIOExceptioncom.fasterxml.jackson.databind.JsonMappingExceptioncom.fasterxml.jackson.core.JsonGenerationExceptionpublic static <T extends Writer> T marshal(Object resource, T writer) throws com.fasterxml.jackson.core.JsonGenerationException, com.fasterxml.jackson.databind.JsonMappingException, IOException
Writer .resource - the resourcewriter - the writer in inputIOExceptioncom.fasterxml.jackson.databind.JsonMappingExceptioncom.fasterxml.jackson.core.JsonGenerationExceptionpublic static <T> T unmarshal(Class<T> resourceClass, Reader reader) throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, IOException
Reader.resourceClass - the class of the resourcereader - the readercom.fasterxml.jackson.core.JsonParseExceptioncom.fasterxml.jackson.databind.JsonMappingExceptionIOExceptionpublic static <T> T unmarshal(Class<T> resourceClass, InputStream stream) throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, IOException
InputStream.resourceClass - the class of the resourcestream - the streamIOExceptioncom.fasterxml.jackson.databind.JsonMappingExceptioncom.fasterxml.jackson.core.JsonParseExceptionCopyright © 2016. All Rights Reserved.