Interface HttpMessageConverters.Builder<T extends HttpMessageConverters.Builder<T>>
- All Known Subinterfaces:
HttpMessageConverters.ClientBuilder, HttpMessageConverters.ServerBuilder
- Enclosing interface:
HttpMessageConverters
public static interface HttpMessageConverters.Builder<T extends HttpMessageConverters.Builder<T>>
- Since:
- 7.0
- Author:
- Brian Clozel
-
Method Summary
Modifier and TypeMethodDescriptionaddCustomConverter(HttpMessageConverter<?> customConverter) Add a customHttpMessageConverterto the list of converters, ahead of the default converters.build()Build and return theHttpMessageConvertersinstance configured by this builder.configureMessageConverters(Consumer<HttpMessageConverter<?>> configurer) Add a consumer for configuring the selected message converters.Register default converters using classpath detection.withCborConverter(HttpMessageConverter<?> cborMessageConverter) Override the default Jackson 3.x CBORHttpMessageConverterwith any converter supporting the CBOR format.withJsonConverter(HttpMessageConverter<?> jsonMessageConverter) Override the default Jackson 3.x JSONHttpMessageConverterwith any converter supporting the JSON format.withSmileConverter(HttpMessageConverter<?> smileMessageConverter) Override the default Jackson 3.x SmileHttpMessageConverterwith any converter supporting the Smile format.withStringConverter(HttpMessageConverter<?> stringMessageConverter) Override the default StringHttpMessageConverterwith any converter supporting String conversion.withXmlConverter(HttpMessageConverter<?> xmlMessageConverter) Override the default Jackson 3.x XMLHttpMessageConverterwith any converter supporting the XML format.withYamlConverter(HttpMessageConverter<?> yamlMessageConverter) Override the default Jackson 3.x YamlHttpMessageConverterwith any converter supporting the Yaml format.
-
Method Details
-
registerDefaults
T registerDefaults()Register default converters using classpath detection. Manual registrations likewithJsonConverter(HttpMessageConverter)will override auto-detected ones. -
withStringConverter
Override the default StringHttpMessageConverterwith any converter supporting String conversion.- Parameters:
stringMessageConverter- the converter instance to use- See Also:
-
withJsonConverter
Override the default Jackson 3.x JSONHttpMessageConverterwith any converter supporting the JSON format.- Parameters:
jsonMessageConverter- the converter instance to use- See Also:
-
withXmlConverter
Override the default Jackson 3.x XMLHttpMessageConverterwith any converter supporting the XML format.- Parameters:
xmlMessageConverter- the converter instance to use- See Also:
-
withSmileConverter
Override the default Jackson 3.x SmileHttpMessageConverterwith any converter supporting the Smile format.- Parameters:
smileMessageConverter- the converter instance to use- See Also:
-
withCborConverter
Override the default Jackson 3.x CBORHttpMessageConverterwith any converter supporting the CBOR format.- Parameters:
cborMessageConverter- the converter instance to use- See Also:
-
withYamlConverter
Override the default Jackson 3.x YamlHttpMessageConverterwith any converter supporting the Yaml format.- Parameters:
yamlMessageConverter- the converter instance to use- See Also:
-
addCustomConverter
Add a customHttpMessageConverterto the list of converters, ahead of the default converters.- Parameters:
customConverter- the converter instance to add
-
configureMessageConverters
Add a consumer for configuring the selected message converters.- Parameters:
configurer- the configurer to use
-
build
HttpMessageConverters build()Build and return theHttpMessageConvertersinstance configured by this builder.
-