Class KotlinResponseBodyAdvice

java.lang.Object
org.springframework.web.servlet.mvc.method.annotation.KotlinResponseBodyAdvice
All Implemented Interfaces:
ResponseBodyAdvice<Object>

public class KotlinResponseBodyAdvice extends Object implements ResponseBodyAdvice<Object>
A ResponseBodyAdvice implementation that adds support for resolving Kotlin KType from the return type and providing it as a hint with a "kotlin.reflect.KType" key.
Since:
7.0
Author:
Sebastien Deleuze
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    beforeBodyWrite(@Nullable 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)
    Invoked after an HttpMessageConverter is selected and just before its write method is invoked.
    determineWriteHints(@Nullable Object body, org.springframework.core.MethodParameter returnType, org.springframework.http.MediaType selectedContentType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> selectedConverterType)
    Invoked to determine write hints if the converter is a SmartHttpMessageConverter.
    boolean
    supports(org.springframework.core.MethodParameter returnType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
    Whether this component supports the given controller method return type and the selected HttpMessageConverter type.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • KotlinResponseBodyAdvice

      public KotlinResponseBodyAdvice()
  • Method Details