Class DefaultServerCodecConfigurer
- java.lang.Object
- org.springframework.http.codec.support.DefaultServerCodecConfigurer
- All Implemented Interfaces:
CodecConfigurer,ServerCodecConfigurer
public class DefaultServerCodecConfigurer extends Object implements ServerCodecConfigurer
Default implementation ofServerCodecConfigurer.- Since:
- 5.0
- Author:
- Rossen Stoyanchev
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.http.codec.CodecConfigurer
CodecConfigurer.CustomCodecs, CodecConfigurer.DefaultCodecConfig, CodecConfigurer.DefaultCodecs
Nested classes/interfaces inherited from interface org.springframework.http.codec.ServerCodecConfigurer
ServerCodecConfigurer.ServerDefaultCodecs
Field Summary
Fields Modifier and Type Field Description protected org.springframework.http.codec.support.BaseCodecConfigurer.DefaultCustomCodecscustomCodecsprotected org.springframework.http.codec.support.BaseDefaultCodecsdefaultCodecs
Constructor Summary
Constructors Constructor Description DefaultServerCodecConfigurer()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultServerCodecConfigurerclone()Create a copy of thisCodecConfigurer.protected org.springframework.http.codec.support.BaseDefaultCodecscloneDefaultCodecs()Sub-classes should override this to create a deep copy ofBaseDefaultCodecswhich can be client or server specific.CodecConfigurer.CustomCodecscustomCodecs()Register custom HTTP message readers or writers in addition to the ones registered by default.ServerCodecConfigurer.ServerDefaultCodecsdefaultCodecs()Provides a way to customize or replace HTTP message readers and writers registered by default.List<HttpMessageReader<?>>getReaders()Obtain the configured HTTP message readers.List<HttpMessageWriter<?>>getWriters()Obtain the configured HTTP message writers.voidregisterDefaults(boolean shouldRegister)Provides a way to completely turn off registration of default HTTP message readers and writers, and instead rely only on the ones provided viaCodecConfigurer.customCodecs().Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.http.codec.CodecConfigurer
customCodecs, getReaders, getWriters, registerDefaults
Constructor Detail
DefaultServerCodecConfigurer
public DefaultServerCodecConfigurer()
Method Detail
defaultCodecs
public ServerCodecConfigurer.ServerDefaultCodecs defaultCodecs()
Description copied from interface:CodecConfigurerProvides a way to customize or replace HTTP message readers and writers registered by default.- Specified by:
defaultCodecsin interfaceCodecConfigurer- Specified by:
defaultCodecsin interfaceServerCodecConfigurer- See Also:
CodecConfigurer.registerDefaults(boolean)
clone
public DefaultServerCodecConfigurer clone()
Description copied from interface:CodecConfigurerCreate a copy of thisCodecConfigurer. The returned clone has its own lists of default and custom codecs and generally can be configured independently. Keep in mind however that codec instances (if any are configured) are themselves not cloned.- Specified by:
clonein interfaceCodecConfigurer- Specified by:
clonein interfaceServerCodecConfigurer
cloneDefaultCodecs
protected org.springframework.http.codec.support.BaseDefaultCodecs cloneDefaultCodecs()
Sub-classes should override this to create a deep copy ofBaseDefaultCodecswhich can be client or server specific.
registerDefaults
public void registerDefaults(boolean shouldRegister)
Description copied from interface:CodecConfigurerProvides a way to completely turn off registration of default HTTP message readers and writers, and instead rely only on the ones provided viaCodecConfigurer.customCodecs().By default this is set to
"true"in which case default registrations are made; setting this tofalsedisables default registrations.- Specified by:
registerDefaultsin interfaceCodecConfigurer
customCodecs
public CodecConfigurer.CustomCodecs customCodecs()
Description copied from interface:CodecConfigurerRegister custom HTTP message readers or writers in addition to the ones registered by default.- Specified by:
customCodecsin interfaceCodecConfigurer
getReaders
public List<HttpMessageReader<?>> getReaders()
Description copied from interface:CodecConfigurerObtain the configured HTTP message readers.- Specified by:
getReadersin interfaceCodecConfigurer
getWriters
public List<HttpMessageWriter<?>> getWriters()
Description copied from interface:CodecConfigurerObtain the configured HTTP message writers.- Specified by:
getWritersin interfaceCodecConfigurer