类 RequestBodyAdviceAdapter

    • 方法详细资料

      • afterBodyRead

        public Object afterBodyRead​(Object body,
                                    HttpInputMessage inputMessage,
                                    MethodParameter parameter,
                                    Type targetType,
                                    Class<? extends HttpMessageConverter<?>> converterType)
        The default implementation returns the body that was passed in.
        指定者:
        afterBodyRead 在接口中 RequestBodyAdvice
        参数:
        body - set to the converter Object before the first advice is called
        inputMessage - the request
        parameter - the target method parameter
        targetType - the target type, not necessarily the same as the method parameter type, e.g. for HttpEntity<String>.
        converterType - the converter used to deserialize the body
        返回:
        the same body or a new instance
      • handleEmptyBody

        @Nullable
        public Object handleEmptyBody​(@Nullable
                                      Object body,
                                      HttpInputMessage inputMessage,
                                      MethodParameter parameter,
                                      Type targetType,
                                      Class<? extends HttpMessageConverter<?>> converterType)
        The default implementation returns the body that was passed in.
        指定者:
        handleEmptyBody 在接口中 RequestBodyAdvice
        参数:
        body - usually set to null before the first advice is called
        inputMessage - the request
        parameter - the method parameter
        targetType - the target type, not necessarily the same as the method parameter type, e.g. for HttpEntity<String>.
        converterType - the selected converter type
        返回:
        the value to use or null which may then raise an HttpMessageNotReadableException if the argument is required.