public class DSMapper extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.gcube.com.fasterxml.jackson.databind.ObjectMapper |
mapper |
| Modifier and Type | Method and Description |
|---|---|
static org.gcube.com.fasterxml.jackson.databind.JsonNode |
asJsonNode(String jsonString) |
static org.gcube.com.fasterxml.jackson.databind.ObjectMapper |
getObjectMapper() |
static <R extends Record> |
marshal(List<R> list)
Return the String serialization of a given list
|
static <R extends Record> |
marshal(R record)
Return the String serialization of a given Record
|
static <R extends Record> |
marshal(R[] array)
Return the String serialization of a given array
|
static <T extends OutputStream,R extends Record> |
marshal(R record,
T stream)
Write the serialization of a given Record to a given
OutputStream . |
static <T extends Writer,R extends Record> |
marshal(R record,
T writer)
Write the serialization of a given Record 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 record 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) |
protected static final org.gcube.com.fasterxml.jackson.databind.ObjectMapper mapper
public static org.gcube.com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
public static <T extends OutputStream,R extends Record> T marshal(R record, T stream) throws org.gcube.com.fasterxml.jackson.core.JsonGenerationException, org.gcube.com.fasterxml.jackson.databind.JsonMappingException, IOException
OutputStream .record - the Recordstream - the stream in inputIOExceptionorg.gcube.com.fasterxml.jackson.databind.JsonMappingExceptionorg.gcube.com.fasterxml.jackson.core.JsonGenerationExceptionpublic static <T extends Writer,R extends Record> T marshal(R record, T writer) throws org.gcube.com.fasterxml.jackson.core.JsonGenerationException, org.gcube.com.fasterxml.jackson.databind.JsonMappingException, IOException
Writer .record - the Recordwriter - the writer in inputIOExceptionorg.gcube.com.fasterxml.jackson.databind.JsonMappingExceptionorg.gcube.com.fasterxml.jackson.core.JsonGenerationExceptionpublic static <R extends Record> String marshal(R record) throws org.gcube.com.fasterxml.jackson.core.JsonProcessingException
record - the resourceorg.gcube.com.fasterxml.jackson.core.JsonProcessingExceptionpublic static <R extends Record> String marshal(List<R> list) throws org.gcube.com.fasterxml.jackson.core.JsonProcessingException
list - the list to marshalorg.gcube.com.fasterxml.jackson.core.JsonProcessingExceptionpublic static <R extends Record> String marshal(R[] array) throws org.gcube.com.fasterxml.jackson.core.JsonProcessingException
array - the array to marshalorg.gcube.com.fasterxml.jackson.core.JsonProcessingExceptionpublic static <R extends Record> R unmarshal(Class<R> clz, Reader reader) throws org.gcube.com.fasterxml.jackson.core.JsonParseException, org.gcube.com.fasterxml.jackson.databind.JsonMappingException, IOException
Reader.clz - the class of the resourcereader - the readerorg.gcube.com.fasterxml.jackson.core.JsonParseExceptionorg.gcube.com.fasterxml.jackson.databind.JsonMappingExceptionIOExceptionpublic static <R extends Record> R unmarshal(Class<R> clz, InputStream stream) throws org.gcube.com.fasterxml.jackson.core.JsonParseException, org.gcube.com.fasterxml.jackson.databind.JsonMappingException, IOException
InputStream.clz - the class of the resourcestream - the streamIOExceptionorg.gcube.com.fasterxml.jackson.databind.JsonMappingExceptionorg.gcube.com.fasterxml.jackson.core.JsonParseExceptionpublic static <R extends Record> R unmarshal(Class<R> clz, String string) throws org.gcube.com.fasterxml.jackson.core.JsonParseException, org.gcube.com.fasterxml.jackson.databind.JsonMappingException, IOException
clz - the class of the recordstring - org.gcube.com.fasterxml.jackson.core.JsonParseExceptionorg.gcube.com.fasterxml.jackson.databind.JsonMappingExceptionIOExceptionpublic static <R extends Record> List<R> unmarshalList(Class<R> clz, String string) throws org.gcube.com.fasterxml.jackson.core.JsonParseException, org.gcube.com.fasterxml.jackson.databind.JsonMappingException, IOException
org.gcube.com.fasterxml.jackson.core.JsonParseExceptionorg.gcube.com.fasterxml.jackson.databind.JsonMappingExceptionIOExceptionpublic static <R extends Record> List<R> unmarshalList(String string) throws org.gcube.com.fasterxml.jackson.core.JsonParseException, org.gcube.com.fasterxml.jackson.databind.JsonMappingException, IOException
org.gcube.com.fasterxml.jackson.core.JsonParseExceptionorg.gcube.com.fasterxml.jackson.databind.JsonMappingExceptionIOExceptionpublic static org.gcube.com.fasterxml.jackson.databind.JsonNode asJsonNode(String jsonString) throws org.gcube.com.fasterxml.jackson.core.JsonProcessingException, IOException
org.gcube.com.fasterxml.jackson.core.JsonProcessingExceptionIOExceptionCopyright © 2020. All Rights Reserved.