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