public class NuxeoConverterFactory
extends retrofit2.Converter.Factory
| Modifier and Type | Field and Description |
|---|---|
protected static Map<String,Class<?>> |
entityTypeToClass |
protected com.fasterxml.jackson.databind.ObjectMapper |
mapper |
| Modifier | Constructor and Description |
|---|---|
protected |
NuxeoConverterFactory(com.fasterxml.jackson.databind.ObjectMapper mapper) |
| Modifier and Type | Method and Description |
|---|---|
static NuxeoConverterFactory |
create() |
static NuxeoConverterFactory |
create(com.fasterxml.jackson.databind.ObjectMapper mapper) |
<T> T |
readJSON(String json,
Class<T> javaType) |
<T> T |
readJSON(String json,
Class javaTypeContainer,
Class javaType) |
static void |
registerEntity(String entityType,
Class<?> clazz)
Register an entity pojo to the operation unmarshalling mechanism.
|
retrofit2.Converter<?,okhttp3.RequestBody> |
requestBodyConverter(Type type,
Annotation[] parameterAnnotations,
Annotation[] methodAnnotations,
retrofit2.Retrofit retrofit) |
retrofit2.Converter<okhttp3.ResponseBody,?> |
responseBodyConverter(Type type,
Annotation[] annotations,
retrofit2.Retrofit client) |
String |
writeJSON(Object object) |
protected NuxeoConverterFactory(com.fasterxml.jackson.databind.ObjectMapper mapper)
public static NuxeoConverterFactory create()
public static NuxeoConverterFactory create(com.fasterxml.jackson.databind.ObjectMapper mapper)
public static void registerEntity(String entityType, Class<?> clazz)
public retrofit2.Converter<okhttp3.ResponseBody,?> responseBodyConverter(Type type, Annotation[] annotations, retrofit2.Retrofit client)
responseBodyConverter in class retrofit2.Converter.Factorypublic retrofit2.Converter<?,okhttp3.RequestBody> requestBodyConverter(Type type, Annotation[] parameterAnnotations, Annotation[] methodAnnotations, retrofit2.Retrofit retrofit)
requestBodyConverter in class retrofit2.Converter.Factorypublic <T> T readJSON(String json, Class<T> javaType)
json - the json to unmarshalljavaType - the pojo to use for unmarshallingpublic <T> T readJSON(String json, Class javaTypeContainer, Class javaType)
json - the json to unmarshalljavaTypeContainer - the collectionjavaType - the pojo to use for unmarshallingCopyright © 2018 Nuxeo. All rights reserved.