T
- the type of elements in the input streampublic interface HttpMessageEncoder<T> extends Encoder<T>
Encoder
exposing extra methods relevant in the context
of HTTP request or response body encoding.Modifier and Type | Method and Description |
---|---|
default java.util.Map<java.lang.String,java.lang.Object> |
getEncodeHints(ResolvableType actualType,
ResolvableType elementType,
MediaType mediaType,
ServerHttpRequest request,
ServerHttpResponse response)
Get decoding hints based on the server request or annotations on the
target controller method parameter.
|
java.util.List<MediaType> |
getStreamingMediaTypes()
Return "streaming" media types for which flushing should be performed
automatically vs at the end of the input stream.
|
canEncode, encode, getEncodableMimeTypes
java.util.List<MediaType> getStreamingMediaTypes()
default java.util.Map<java.lang.String,java.lang.Object> getEncodeHints(ResolvableType actualType, ResolvableType elementType, @Nullable MediaType mediaType, ServerHttpRequest request, ServerHttpResponse response)
actualType
- the actual source type to encode, possibly a reactive
wrapper and sourced from MethodParameter
,
i.e. providing access to method annotations.elementType
- the element type within Flux/Mono
that we're
trying to encode.request
- the current requestresponse
- the current response