public class DSMapper extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static com.fasterxml.jackson.databind.ObjectMapper |
mapper |
| Modifier and Type | Method and Description |
|---|---|
static com.fasterxml.jackson.databind.JsonNode |
asJsonNode(String jsonString) |
static com.fasterxml.jackson.databind.ObjectMapper |
getObjectMapper() |
static <R extends Record> |
marshal(List<R> list)
Return the String serialization of a given resource
|
static <R extends Record> |
marshal(R object)
Return the String serialization of a given resource
|
static <T extends OutputStream,R extends Record> |
marshal(R object,
T stream)
Write the serialization of a given resource to a given
OutputStream . |
static <T extends Writer,R extends Record> |
marshal(R object,
T writer)
Write the serialization of a given resource to a given
Writer . |
static <R extends Record> |
registerSubtypes(Class<R>... classes) |
static <R extends Record> |
unmarshal(Class<R> clz,
InputStream stream)
Creates a resource of given class from its serialization in a given
InputStream. |
static <R extends Record> |
unmarshal(Class<R> clz,
Reader reader)
Creates a resource of given class from its serialization in a given
Reader. |
static <R extends Record> |
unmarshal(Class<R> clz,
String string)
Creates a resource of given class from its serialization in a given String
|
static <R extends Record> |
unmarshalList(Class<R> clz,
String string) |
static <R extends Record> |
unmarshalList(String string) |
public static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
public static <T extends OutputStream,R extends Record> T marshal(R object, 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,R extends Record> T marshal(R object, 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 <R extends Record> String marshal(R object) throws com.fasterxml.jackson.core.JsonProcessingException
object - the resourcecom.fasterxml.jackson.core.JsonProcessingExceptionpublic static <R extends Record> String marshal(List<R> list) throws IOException
list - the list of RecordsIOExceptionpublic static <R extends Record> R unmarshal(Class<R> clz, Reader reader) throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, IOException
Reader.clz - the class of the resourcereader - the readercom.fasterxml.jackson.core.JsonParseExceptioncom.fasterxml.jackson.databind.JsonMappingExceptionIOExceptionpublic static <R extends Record> R unmarshal(Class<R> clz, InputStream stream) throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, IOException
InputStream.clz - the class of the resourcestream - the streamIOExceptioncom.fasterxml.jackson.databind.JsonMappingExceptioncom.fasterxml.jackson.core.JsonParseExceptionpublic static <R extends Record> R unmarshal(Class<R> clz, String string) throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, IOException
clz - the class of the resourcestring - com.fasterxml.jackson.core.JsonParseExceptioncom.fasterxml.jackson.databind.JsonMappingExceptionIOExceptionpublic static <R extends Record> List<R> unmarshalList(Class<R> clz, String string) throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, IOException
com.fasterxml.jackson.core.JsonParseExceptioncom.fasterxml.jackson.databind.JsonMappingExceptionIOExceptionpublic static <R extends Record> List<R> unmarshalList(String string) throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, IOException
com.fasterxml.jackson.core.JsonParseExceptioncom.fasterxml.jackson.databind.JsonMappingExceptionIOExceptionpublic static com.fasterxml.jackson.databind.JsonNode asJsonNode(String jsonString) throws com.fasterxml.jackson.core.JsonProcessingException, IOException
com.fasterxml.jackson.core.JsonProcessingExceptionIOExceptionCopyright © 2017. All Rights Reserved.