Class AlpsJsonHttpMessageConverter

java.lang.Object
org.springframework.http.converter.AbstractHttpMessageConverter<T>
org.springframework.http.converter.AbstractGenericHttpMessageConverter<Object>
org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter
org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
org.springframework.data.rest.webmvc.alps.AlpsJsonHttpMessageConverter
All Implemented Interfaces:
org.springframework.http.converter.GenericHttpMessageConverter<Object>, org.springframework.http.converter.HttpMessageConverter<Object>, org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice<Object>

public class AlpsJsonHttpMessageConverter extends org.springframework.http.converter.json.MappingJackson2HttpMessageConverter implements org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice<Object>
HttpMessageConverter to render Alps and RootResourceInformation instances as application/alps+json.
Author:
Oliver Gierke, Greg Turnquist
  • Field Summary

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

    defaultObjectMapper

    Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new AlpsJsonHttpMessageConverter for the given Converter.
  • Method Summary

    Modifier and Type
    Method
    Description
    beforeBodyWrite(Object body, org.springframework.core.MethodParameter returnType, org.springframework.http.MediaType selectedContentType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> selectedConverterType, org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response)
     
    boolean
    canRead(Type type, Class<?> contextClass, org.springframework.http.MediaType mediaType)
     
    boolean
    canWrite(Class<?> clazz, org.springframework.http.MediaType mediaType)
     
    boolean
    canWrite(Type type, Class<?> clazz, org.springframework.http.MediaType mediaType)
     
    boolean
    supports(org.springframework.core.MethodParameter returnType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
     

    Methods inherited from class org.springframework.http.converter.json.MappingJackson2HttpMessageConverter

    getMediaTypesForProblemDetail, setJsonPrefix, setPrefixJson, writePrefix

    Methods inherited from class org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter

    canRead, customizeReader, customizeWriter, getCharset, getContentLength, getDefaultContentType, getJavaType, getJsonEncoding, getObjectMapper, getObjectMappersForType, getSupportedMediaTypes, logWarningIfNecessary, read, readInternal, registerObjectMappersForType, setObjectMapper, setPrettyPrint, setSupportedMediaTypes, writeInternal, writeSuffix

    Methods inherited from class org.springframework.http.converter.AbstractGenericHttpMessageConverter

    supports, write, writeInternal

    Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter

    addDefaultHeaders, canRead, canWrite, getDefaultCharset, getSupportedMediaTypes, read, setDefaultCharset, write

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.http.converter.HttpMessageConverter

    getSupportedMediaTypes, read, write
  • Constructor Details

  • Method Details

    • 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
    • canWrite

      public boolean canWrite(Type type, Class<?> clazz, org.springframework.http.MediaType mediaType)
      Specified by:
      canWrite in interface org.springframework.http.converter.GenericHttpMessageConverter<Object>
      Overrides:
      canWrite in class org.springframework.http.converter.AbstractGenericHttpMessageConverter<Object>
    • canRead

      public boolean canRead(Type type, Class<?> contextClass, org.springframework.http.MediaType mediaType)
      Specified by:
      canRead in interface org.springframework.http.converter.GenericHttpMessageConverter<Object>
      Overrides:
      canRead in class org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter
    • beforeBodyWrite

      public Object beforeBodyWrite(Object body, org.springframework.core.MethodParameter returnType, org.springframework.http.MediaType selectedContentType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> selectedConverterType, org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response)
      Specified by:
      beforeBodyWrite in interface org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice<Object>
    • supports

      public boolean supports(org.springframework.core.MethodParameter returnType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
      Specified by:
      supports in interface org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice<Object>