Class 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<?>> entityTypeToClass  
      protected com.fasterxml.jackson.databind.ObjectMapper mapper  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected NuxeoConverterFactory​(com.fasterxml.jackson.databind.ObjectMapper mapper)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static NuxeoConverterFactory create()  
      static NuxeoConverterFactory create​(com.fasterxml.jackson.databind.ObjectMapper mapper)  
      <T> T readJSON​(java.lang.String json, java.lang.Class<T> javaType)  
      <T> T readJSON​(java.lang.String json, java.lang.Class javaTypeContainer, java.lang.Class javaType)  
      static void registerEntity​(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.String writeJSON​(java.lang.Object object)  
      • Methods inherited from class retrofit2.Converter.Factory

        getParameterUpperBound, getRawType, stringConverter
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • entityTypeToClass

        protected static final java.util.Map<java.lang.String,​java.lang.Class<?>> entityTypeToClass
      • mapper

        protected final com.fasterxml.jackson.databind.ObjectMapper mapper
    • Constructor Detail

      • NuxeoConverterFactory

        protected NuxeoConverterFactory​(com.fasterxml.jackson.databind.ObjectMapper mapper)
    • Method Detail

      • 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:
        responseBodyConverter in class retrofit2.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:
        requestBodyConverter in class retrofit2.Converter.Factory
      • readJSON

        public <T> T readJSON​(java.lang.String json,
                              java.lang.Class<T> javaType)
        Parameters:
        json - the json to unmarshall
        javaType - 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 unmarshall
        javaTypeContainer - the collection
        javaType - 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)