接口 HttpMessageEncoder<T>

类型参数:
T - the type of elements in the input stream
所有超级接口:
cn.taketoday.core.codec.Encoder<T>
所有已知实现类:
AbstractJackson2Encoder, Jackson2CborEncoder, Jackson2JsonEncoder, Jackson2SmileEncoder, ProtobufEncoder

public interface HttpMessageEncoder<T> extends cn.taketoday.core.codec.Encoder<T>
Extension of Encoder exposing extra methods relevant in the context of HTTP request or response body encoding.
从以下版本开始:
4.0
作者:
Rossen Stoyanchev
  • 方法概要

    修饰符和类型
    方法
    说明
    default Map<String,Object>
    getEncodeHints(cn.taketoday.core.ResolvableType actualType, cn.taketoday.core.ResolvableType elementType, MediaType mediaType, ServerHttpRequest request, ServerHttpResponse response)
    Get decoding hints based on the server request or annotations on the target controller method parameter.
    Return "streaming" media types for which flushing should be performed automatically vs at the end of the input stream.

    从接口继承的方法 cn.taketoday.core.codec.Encoder

    canEncode, encode, encodeValue, getEncodableMimeTypes, 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(cn.taketoday.core.ResolvableType actualType, cn.taketoday.core.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 from Parameter, i.e. providing access to method annotations.
      elementType - the element type within Flux/Mono that we're trying to encode.
      request - the current request
      response - the current response
      返回:
      a Map with hints, possibly empty