public class JacksonMapperAdapter extends Object
JacksonConverterFactory and ObjectMapper.| Constructor and Description |
|---|
JacksonMapperAdapter() |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
deserialize(String value,
Type type)
Deserializes a string into a
T object using the current ObjectMapper. |
JacksonConverterFactory |
getConverterFactory()
Gets a static instance of JacksonConverter factory.
|
com.fasterxml.jackson.databind.ObjectMapper |
getObjectMapper()
Gets a static instance of
ObjectMapper. |
protected com.fasterxml.jackson.databind.ObjectMapper |
getSimpleMapper()
Gets a static instance of
ObjectMapper that doesn't handle flattening. |
protected void |
initializeObjectMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)
Initializes an instance of JacksonMapperAdapter with default configurations
applied to the object mapper.
|
String |
serialize(Object object)
Serializes an object into a JSON string using the current
ObjectMapper. |
String |
serializeList(List<?> list,
CollectionFormat format)
Serializes a list into a string with the delimiter specified with the
Swagger collection format joining each individual serialized items in
the list.
|
String |
serializeRaw(Object object)
Serializes an object into a raw string using the current
ObjectMapper. |
protected void initializeObjectMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)
mapper - the object mapper to use.protected com.fasterxml.jackson.databind.ObjectMapper getSimpleMapper()
ObjectMapper that doesn't handle flattening.ObjectMapper.public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
ObjectMapper.ObjectMapper.public JacksonConverterFactory getConverterFactory()
public String serialize(Object object) throws IOException
ObjectMapper.object - the object to serialize.IOException - exception from serialization.public String serializeRaw(Object object)
ObjectMapper.
The leading and trailing quotes will be trimmed.object - the object to serialize.public String serializeList(List<?> list, CollectionFormat format)
list - the list to serialize.format - the Swagger collection format.public <T> T deserialize(String value, Type type) throws IOException
T object using the current ObjectMapper.T - the type of the deserialized object.value - the string value to deserialize.type - the type to deserialize.IOException - exception in deserialization/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/