com.alibaba.fastjson.support.spring

Class FastJsonViewResponseBodyAdvice

  • java.lang.Object
    • com.alibaba.fastjson.support.spring.FastJsonViewResponseBodyAdvice
  • All Implemented Interfaces:
    org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice< Object>

    @Order
     @ControllerAdvice
    public class FastJsonViewResponseBodyAdvice
    extends Object
    implements org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice<Object>
    A convenient base class for ResponseBodyAdvice implementations that customize the response before JSON serialization with FastJsonHttpMessageConverter4's concrete subclasses.

    Author:
    yanquanyu, liuming
    • Constructor Detail

      • FastJsonViewResponseBodyAdvice

        public FastJsonViewResponseBodyAdvice()
    • Method Detail

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

        public FastJsonContainer 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>

Copyright © 2012–2021 Alibaba Group. All rights reserved.