TapikResponseBodyAdvice

interface TapikResponseBodyAdvice : ResponseBodyAdvice<TapikResponse> (source)

Shared Spring MVC advice that writes generated Tapik responses through Tapik codecs instead of delegating serialization to Spring's default message converters.

Functions

Link copied to clipboard
open override fun beforeBodyWrite(body: TapikResponse?, returnType: MethodParameter, selectedContentType: MediaType, selectedConverterType: Class<out HttpMessageConverter<*>>, request: ServerHttpRequest, response: ServerHttpResponse): TapikResponse?

Writes the Tapik-managed response with Tapik-controlled encoding and suppresses Spring's normal body serialization.

Link copied to clipboard
open override fun supports(returnType: MethodParameter, converterType: Class<out HttpMessageConverter<*>>): Boolean

Returns whether Spring should invoke this advice for the current controller return type.

Link copied to clipboard
abstract fun supportsTapikResponseType(responseType: Class<*>): Boolean

Returns whether this advice instance should handle the provided Tapik response type.

Link copied to clipboard
abstract fun toResponseEntity(body: TapikResponse): ResponseEntity<Any>

Converts the provided Tapik response into a Spring ResponseEntity.