Package org.nuxeo.client.marshaller
Class NuxeoConverterFactory
- java.lang.Object
-
- retrofit2.Converter.Factory
-
- org.nuxeo.client.marshaller.NuxeoConverterFactory
-
public class NuxeoConverterFactory extends retrofit2.Converter.Factory- Since:
- 0.1
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.Map<java.lang.String,java.lang.Class<?>>entityTypeToClassprotected com.fasterxml.jackson.databind.ObjectMappermapper
-
Constructor Summary
Constructors Modifier Constructor Description protectedNuxeoConverterFactory(com.fasterxml.jackson.databind.ObjectMapper mapper)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NuxeoConverterFactorycreate()static NuxeoConverterFactorycreate(com.fasterxml.jackson.databind.ObjectMapper mapper)<T> TreadJSON(java.lang.String json, java.lang.Class<T> javaType)<T> TreadJSON(java.lang.String json, java.lang.Class javaTypeContainer, java.lang.Class javaType)static voidregisterEntity(java.lang.String entityType, java.lang.Class<?> clazz)Register an entity pojo to the operation unmarshalling mechanism.retrofit2.Converter<?,okhttp3.RequestBody>requestBodyConverter(java.lang.reflect.Type type, java.lang.annotation.Annotation[] parameterAnnotations, java.lang.annotation.Annotation[] methodAnnotations, retrofit2.Retrofit retrofit)retrofit2.Converter<okhttp3.ResponseBody,?>responseBodyConverter(java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations, retrofit2.Retrofit client)java.lang.StringwriteJSON(java.lang.Object object)
-
-
-
Method Detail
-
create
public static NuxeoConverterFactory create()
-
create
public static NuxeoConverterFactory create(com.fasterxml.jackson.databind.ObjectMapper mapper)
-
registerEntity
public static void registerEntity(java.lang.String entityType, java.lang.Class<?> clazz)Register an entity pojo to the operation unmarshalling mechanism.- Since:
- 3.0
-
responseBodyConverter
public retrofit2.Converter<okhttp3.ResponseBody,?> responseBodyConverter(java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations, retrofit2.Retrofit client)- Overrides:
responseBodyConverterin classretrofit2.Converter.Factory
-
requestBodyConverter
public retrofit2.Converter<?,okhttp3.RequestBody> requestBodyConverter(java.lang.reflect.Type type, java.lang.annotation.Annotation[] parameterAnnotations, java.lang.annotation.Annotation[] methodAnnotations, retrofit2.Retrofit retrofit)- Overrides:
requestBodyConverterin classretrofit2.Converter.Factory
-
readJSON
public <T> T readJSON(java.lang.String json, java.lang.Class<T> javaType)- Parameters:
json- the json to unmarshalljavaType- the pojo to use for unmarshalling- Returns:
- the pojo generated from the json
-
readJSON
public <T> T readJSON(java.lang.String json, java.lang.Class javaTypeContainer, java.lang.Class javaType)- Parameters:
json- the json to unmarshalljavaTypeContainer- the collectionjavaType- the pojo to use for unmarshalling- Returns:
- the collection of pojos generated from the json
- Since:
- 2.5
-
writeJSON
public java.lang.String writeJSON(java.lang.Object object)
-
-