接口 HttpMessageEncoder<T>
- 类型参数:
T
- the type of elements in the input stream
- 所有超级接口:
Encoder<T>
- 所有已知实现类:
AbstractJackson2Encoder
,Jackson2CborEncoder
,Jackson2JsonEncoder
,Jackson2SmileEncoder
,ProtobufEncoder
public interface HttpMessageEncoder<T> extends Encoder<T>
Extension ofEncoder
exposing extra methods relevant in the context of HTTP request or response body encoding.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev
方法概要
所有方法 实例方法 抽象方法 默认方法 修饰符和类型 方法 说明 default Map<String,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.List<MediaType>
getStreamingMediaTypes()
Return "streaming" media types for which flushing should be performed automatically vs at the end of the input stream.从接口继承的方法 org.springframework.core.codec.Encoder
canEncode, encode, encodeValue, getEncodableMimeTypes
方法详细资料
getStreamingMediaTypes
List<MediaType> getStreamingMediaTypes()
Return "streaming" media types for which flushing should be performed automatically vs at the end of the input stream.
getEncodeHints
default Map<String,Object> getEncodeHints(ResolvableType actualType, ResolvableType elementType, @Nullable MediaType mediaType, ServerHttpRequest request, ServerHttpResponse response)
Get decoding hints based on the server request or annotations on the target controller method parameter.- 参数:
actualType
- the actual source type to encode, possibly a reactive wrapper and sourced fromMethodParameter
, i.e. providing access to method annotations.elementType
- the element type withinFlux/Mono
that we're trying to encode.request
- the current requestresponse
- the current response- 返回:
- a Map with hints, possibly empty