public final class JacksonConverterFactory extends Converter.Factory
Because Jackson is so flexible in the types it supports, this converter assumes that it can handle all types. If you are mixing JSON serialization with something else (such as protocol buffers), you must add this instance last to allow the other converters a chance to see their types.
| Modifier and Type | Method and Description |
|---|---|
static JacksonConverterFactory |
create()
Create an instance using a default
ObjectMapper instance for conversion. |
static JacksonConverterFactory |
create(com.fasterxml.jackson.databind.ObjectMapper mapper)
Create an instance using
mapper for conversion. |
Converter<com.squareup.okhttp.ResponseBody,?> |
fromResponseBody(Type type,
Annotation[] annotations) |
Converter<?,com.squareup.okhttp.RequestBody> |
toRequestBody(Type type,
Annotation[] annotations) |
public static JacksonConverterFactory create()
ObjectMapper instance for conversion.public static JacksonConverterFactory create(com.fasterxml.jackson.databind.ObjectMapper mapper)
mapper for conversion.public Converter<com.squareup.okhttp.ResponseBody,?> fromResponseBody(Type type, Annotation[] annotations)
fromResponseBody in class Converter.Factorypublic Converter<?,com.squareup.okhttp.RequestBody> toRequestBody(Type type, Annotation[] annotations)
toRequestBody in class Converter.FactoryCopyright © 2015 Square, Inc.. All Rights Reserved.