public class SEMapper extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
CLASS_PROPERTY |
protected static SEMapper |
instance |
protected org.gcube.com.fasterxml.jackson.databind.ObjectMapper |
mapper |
| Modifier and Type | Method and Description |
|---|---|
static SEMapper |
getInstance() |
<O> String |
marshal(Class<O> clz,
List<O> list)
Return the String serialization of a given list
|
<O> String |
marshal(O object)
Return the String serialization of a given object
|
<O> String |
marshal(O[] array)
Return the String serialization of a given array
|
<T extends OutputStream,O> |
marshal(O object,
T stream)
Write the serialization of a given resource to a given
OutputStream . |
<T extends Writer,O> |
marshal(O object,
T writer)
Write the serialization of a given resource to a given
Writer . |
void |
registerSubtypes(Class<?> classes) |
<O> O |
unmarshal(Class<O> clz,
InputStream stream)
Creates a resource of given class from its serialization in a given
InputStream. |
<O> O |
unmarshal(Class<O> clz,
Reader reader)
Creates a resource of given class from its serialization in a given
Reader. |
<O> O |
unmarshal(Class<O> clz,
String string)
Creates a resource of given class from its serialization in a given String
|
<O> List<O> |
unmarshalList(Class<O> clz,
String string) |
<O> List<O> |
unmarshalList(String string) |
protected final org.gcube.com.fasterxml.jackson.databind.ObjectMapper mapper
public static final String CLASS_PROPERTY
protected static SEMapper instance
public static SEMapper getInstance()
public void registerSubtypes(Class<?> classes)
public <T extends OutputStream,O> T marshal(O object, T stream) throws org.gcube.com.fasterxml.jackson.core.JsonGenerationException, org.gcube.com.fasterxml.jackson.databind.JsonMappingException, IOException
OutputStream .object - the resourcestream - the stream in inputIOExceptionorg.gcube.com.fasterxml.jackson.databind.JsonMappingExceptionorg.gcube.com.fasterxml.jackson.core.JsonGenerationExceptionpublic <T extends Writer,O> T marshal(O object, T writer) throws org.gcube.com.fasterxml.jackson.core.JsonGenerationException, org.gcube.com.fasterxml.jackson.databind.JsonMappingException, IOException
Writer .object - the resourcewriter - the writer in inputIOExceptionorg.gcube.com.fasterxml.jackson.databind.JsonMappingExceptionorg.gcube.com.fasterxml.jackson.core.JsonGenerationExceptionpublic <O> String marshal(O object) throws org.gcube.com.fasterxml.jackson.core.JsonProcessingException
object - the object to marshalorg.gcube.com.fasterxml.jackson.core.JsonProcessingExceptionpublic <O> String marshal(Class<O> clz, List<O> list) throws org.gcube.com.fasterxml.jackson.core.JsonProcessingException
list - the list to marshalorg.gcube.com.fasterxml.jackson.core.JsonProcessingExceptionpublic <O> String marshal(O[] array) throws org.gcube.com.fasterxml.jackson.core.JsonProcessingException
array - the array to marshalorg.gcube.com.fasterxml.jackson.core.JsonProcessingExceptionpublic <O> O unmarshal(Class<O> 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 <O> O unmarshal(Class<O> 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 <O> O unmarshal(Class<O> clz, String string) throws org.gcube.com.fasterxml.jackson.core.JsonParseException, org.gcube.com.fasterxml.jackson.databind.JsonMappingException, IOException
clz - the class of the resourcestring - org.gcube.com.fasterxml.jackson.core.JsonParseExceptionorg.gcube.com.fasterxml.jackson.databind.JsonMappingExceptionIOExceptionpublic <O> List<O> unmarshalList(Class<O> 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 <O> List<O> 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.JsonMappingExceptionIOExceptionCopyright © 2021. All Rights Reserved.