接口 CodecConfigurer.DefaultCodecs

所有已知子接口:
ClientCodecConfigurer.ClientDefaultCodecs, ServerCodecConfigurer.ServerDefaultCodecs
所有已知实现类:
BaseDefaultCodecs, ClientDefaultCodecsImpl, ServerDefaultCodecsImpl
封闭接口:
CodecConfigurer

public static interface CodecConfigurer.DefaultCodecs
Customize or replace the HTTP message readers and writers registered by default. The options are further extended by ClientDefaultCodecs and ServerDefaultCodecs.
  • 方法详细资料

    • jackson2JsonDecoder

      void jackson2JsonDecoder(cn.taketoday.core.codec.Decoder<?> decoder)
      Override the default Jackson JSON Decoder.

      Note that maxInMemorySize(int), if configured, will be applied to the given decoder.

      参数:
      decoder - the decoder instance to use
      另请参阅:
    • jackson2JsonEncoder

      void jackson2JsonEncoder(cn.taketoday.core.codec.Encoder<?> encoder)
      Override the default Jackson JSON Encoder.
      参数:
      encoder - the encoder instance to use
      另请参阅:
    • jackson2SmileDecoder

      void jackson2SmileDecoder(cn.taketoday.core.codec.Decoder<?> decoder)
      Override the default Jackson Smile Decoder.

      Note that maxInMemorySize(int), if configured, will be applied to the given decoder.

      参数:
      decoder - the decoder instance to use
      另请参阅:
    • jackson2SmileEncoder

      void jackson2SmileEncoder(cn.taketoday.core.codec.Encoder<?> encoder)
      Override the default Jackson Smile Encoder.
      参数:
      encoder - the encoder instance to use
      另请参阅:
    • protobufDecoder

      void protobufDecoder(cn.taketoday.core.codec.Decoder<?> decoder)
      Override the default Protobuf Decoder.

      Note that maxInMemorySize(int), if configured, will be applied to the given decoder.

      参数:
      decoder - the decoder instance to use
      另请参阅:
    • protobufEncoder

      void protobufEncoder(cn.taketoday.core.codec.Encoder<?> encoder)
      Override the default Protobuf Encoder.
      参数:
      encoder - the encoder instance to use
      另请参阅:
    • configureDefaultCodec

      void configureDefaultCodec(Consumer<Object> codecConsumer)
      Register a consumer to apply to default config instances. This can be used to configure rather than replace a specific codec or multiple codecs. The consumer is applied to every default Encoder, Decoder, HttpMessageReader and HttpMessageWriter instance.
      参数:
      codecConsumer - the consumer to apply
    • maxInMemorySize

      void maxInMemorySize(int byteCount)
      Configure a limit on the number of bytes that can be buffered whenever the input stream needs to be aggregated. This can be a result of decoding to a single DataBuffer, ByteBuffer, byte[], Resource, String, etc. It can also occur when splitting the input stream, e.g. delimited text, in which case the limit applies to data buffered between delimiters.

      By default this is not set, in which case individual codec defaults apply. All codecs are limited to 256K by default.

      参数:
      byteCount - the max number of bytes to buffer, or -1 for unlimited
    • enableLoggingRequestDetails

      void enableLoggingRequestDetails(boolean enable)
      Whether to log form data at DEBUG level, and headers at TRACE level. Both may contain sensitive information.

      By default set to false so that request details are not shown.

      参数:
      enable - whether to enable or not
    • multipartCodecs

      Configure encoders or writers for use with MultipartHttpMessageWriter.
    • multipartReader

      void multipartReader(HttpMessageReader<?> reader)
      Configure the HttpMessageReader to use for multipart requests.

      Note that maxInMemorySize(int) and/or enableLoggingRequestDetails(boolean), if configured, will be applied to the given reader, if applicable.

      参数:
      reader - the message reader to use for multipart requests.