接口 CodecConfigurer.CustomCodecs
- 封闭接口:
- CodecConfigurer
public static interface CodecConfigurer.CustomCodecs
Registry for custom HTTP message readers and writers.
-
方法概要
修饰符和类型方法说明voidRegister a custom codec.voidregisterWithDefaultConfig(Object codec) Variant ofregister(Object)that also applies the below properties, if configured, viaCodecConfigurer.defaultCodecs():maxInMemorySizeenableLoggingRequestDetailsvoidregisterWithDefaultConfig(Object codec, Consumer<CodecConfigurer.DefaultCodecConfig> configConsumer) Variant ofregister(Object)that also allows the caller to apply the properties fromCodecConfigurer.DefaultCodecConfigto the given codec.voidwithDefaultCodecConfig(Consumer<CodecConfigurer.DefaultCodecConfig> codecsConfigConsumer) Register a callback for theconfigurationapplied to default codecs.
-
方法详细资料
-
register
Register a custom codec. This is expected to be one of the following:HttpMessageReaderHttpMessageWriterEncoder(wrapped internally withEncoderHttpMessageWriter)Decoder(wrapped internally withDecoderHttpMessageReader)
- 参数:
codec- the codec to register- 从以下版本开始:
- 4.0
-
registerWithDefaultConfig
Variant ofregister(Object)that also applies the below properties, if configured, viaCodecConfigurer.defaultCodecs():The properties are applied every time
CodecConfigurer.getReaders()orCodecConfigurer.getWriters()are used to obtain the list of configured readers or writers.- 参数:
codec- the codec to register and apply default config to
-
registerWithDefaultConfig
void registerWithDefaultConfig(Object codec, Consumer<CodecConfigurer.DefaultCodecConfig> configConsumer) Variant ofregister(Object)that also allows the caller to apply the properties fromCodecConfigurer.DefaultCodecConfigto the given codec. If you want to apply all the properties, prefer usingregisterWithDefaultConfig(Object).The consumer is called every time
CodecConfigurer.getReaders()orCodecConfigurer.getWriters()are used to obtain the list of configured readers or writers.- 参数:
codec- the codec to registerconfigConsumer- consumer of the default config
-
withDefaultCodecConfig
Register a callback for theconfigurationapplied to default codecs. This allows custom codecs to follow general guidelines applied to default ones, such as logging details and limiting the amount of buffered data.- 参数:
codecsConfigConsumer- the default codecs configuration callback
-