类 CustomResponseAdvice

  • 所有已实现的接口:
    org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice<java.lang.Object>

    @ControllerAdvice
    public class CustomResponseAdvice
    extends java.lang.Object
    implements org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice<java.lang.Object>
    rest响应结果定制封装
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      java.lang.Object beforeBodyWrite​(java.lang.Object body, org.springframework.core.MethodParameter returnType, org.springframework.http.MediaType selectedContentType, java.lang.Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> selectedConverterType, org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response)  
      void initBinder​(org.springframework.web.bind.WebDataBinder binder)  
      boolean supports​(org.springframework.core.MethodParameter returnType, java.lang.Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)  
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • CustomResponseAdvice

        public CustomResponseAdvice()
    • 方法详细资料

      • initBinder

        @InitBinder
        public void initBinder​(org.springframework.web.bind.WebDataBinder binder)
      • supports

        public boolean supports​(org.springframework.core.MethodParameter returnType,
                                @Nonnull
                                java.lang.Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
        指定者:
        supports 在接口中 org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice<java.lang.Object>
      • beforeBodyWrite

        public java.lang.Object beforeBodyWrite​(java.lang.Object body,
                                                @Nonnull
                                                org.springframework.core.MethodParameter returnType,
                                                @Nonnull
                                                org.springframework.http.MediaType selectedContentType,
                                                @Nonnull
                                                java.lang.Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> selectedConverterType,
                                                @Nonnull
                                                org.springframework.http.server.ServerHttpRequest request,
                                                @Nonnull
                                                org.springframework.http.server.ServerHttpResponse response)
        指定者:
        beforeBodyWrite 在接口中 org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice<java.lang.Object>