Class ResponseBodyMessageConverter

  • All Implemented Interfaces:
    org.springframework.http.converter.GenericHttpMessageConverter<Object>, org.springframework.http.converter.HttpMessageConverter<Object>

    public class ResponseBodyMessageConverter
    extends org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
    处理响应数据(JSON), Result
    Author:
    CofCool
    • Field Summary

      • Fields inherited from class org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter

        DEFAULT_CHARSET, objectMapper
      • Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter

        logger
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canWrite​(Class<?> clazz, org.springframework.http.MediaType mediaType)  
      protected ConfigurationSupport getConfiguration()  
      void setConfiguration​(ConfigurationSupport configuration)  
      protected void writeInternal​(Object object, Type type, org.springframework.http.HttpOutputMessage outputMessage)  
      • Methods inherited from class org.springframework.http.converter.json.MappingJackson2HttpMessageConverter

        setJsonPrefix, setPrefixJson, writePrefix
      • Methods inherited from class org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter

        canRead, canRead, getCharset, getContentLength, getDefaultContentType, getJavaType, getJsonEncoding, getObjectMapper, logWarningIfNecessary, read, readInternal, setObjectMapper, setPrettyPrint, writeSuffix
      • Methods inherited from class org.springframework.http.converter.AbstractGenericHttpMessageConverter

        canWrite, supports, write, writeInternal
      • Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter

        addDefaultHeaders, canRead, canWrite, getDefaultCharset, getSupportedMediaTypes, read, setDefaultCharset, setSupportedMediaTypes, write
      • Methods inherited from interface org.springframework.http.converter.HttpMessageConverter

        getSupportedMediaTypes, read, write
    • Constructor Detail

      • ResponseBodyMessageConverter

        public ResponseBodyMessageConverter()
    • Method Detail

      • writeInternal

        protected void writeInternal​(Object object,
                                     Type type,
                                     org.springframework.http.HttpOutputMessage outputMessage)
                              throws IOException,
                                     org.springframework.http.converter.HttpMessageNotWritableException
        Overrides:
        writeInternal in class org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter
        Throws:
        IOException
        org.springframework.http.converter.HttpMessageNotWritableException
      • canWrite

        public boolean canWrite​(Class<?> clazz,
                                org.springframework.http.MediaType mediaType)
        Specified by:
        canWrite in interface org.springframework.http.converter.HttpMessageConverter<Object>
        Overrides:
        canWrite in class org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter