public class JacksonAdapter extends Object implements SerializerAdapter<com.fasterxml.jackson.databind.ObjectMapper>
JacksonConverterFactory
and ObjectMapper
.Constructor and Description |
---|
JacksonAdapter()
Creates a new JacksonAdapter instance with default mapper settings.
|
Modifier and Type | Method and Description |
---|---|
com.microsoft.rest.serializer.JacksonConverterFactory |
converterFactory() |
<T> T |
deserialize(String value,
Type type)
Deserializes a string into a
U object using the current T . |
String |
serialize(Object object)
Serializes an object into a JSON string.
|
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.
|
com.fasterxml.jackson.databind.ObjectMapper |
serializer() |
String |
serializeRaw(Object object)
Serializes an object into a raw string.
|
protected com.fasterxml.jackson.databind.ObjectMapper |
simpleMapper()
Gets a static instance of
ObjectMapper that doesn't handle flattening. |
public JacksonAdapter()
protected com.fasterxml.jackson.databind.ObjectMapper simpleMapper()
ObjectMapper
that doesn't handle flattening.ObjectMapper
.public com.fasterxml.jackson.databind.ObjectMapper serializer()
serializer
in interface SerializerAdapter<com.fasterxml.jackson.databind.ObjectMapper>
public com.microsoft.rest.serializer.JacksonConverterFactory converterFactory()
converterFactory
in interface SerializerAdapter<com.fasterxml.jackson.databind.ObjectMapper>
public String serialize(Object object) throws IOException
SerializerAdapter
serialize
in interface SerializerAdapter<com.fasterxml.jackson.databind.ObjectMapper>
object
- the object to serialize.IOException
- exception from serialization.public String serializeRaw(Object object)
SerializerAdapter
serializeRaw
in interface SerializerAdapter<com.fasterxml.jackson.databind.ObjectMapper>
object
- the object to serialize.public String serializeList(List<?> list, CollectionFormat format)
SerializerAdapter
serializeList
in interface SerializerAdapter<com.fasterxml.jackson.databind.ObjectMapper>
list
- the list to serialize.format
- the Swagger collection format.public <T> T deserialize(String value, Type type) throws IOException
SerializerAdapter
U
object using the current T
.deserialize
in interface SerializerAdapter<com.fasterxml.jackson.databind.ObjectMapper>
T
- the type of the deserialized object.value
- the string value to deserialize.type
- the type to deserialize.IOException
- exception in deserializationCopyright © 2019. All rights reserved.