类 HttpMessageConverters
- java.lang.Object
- org.springframework.boot.autoconfigure.http.HttpMessageConverters
- 所有已实现的接口:
Iterable<org.springframework.http.converter.HttpMessageConverter<?>>
public class HttpMessageConverters extends Object implements Iterable<org.springframework.http.converter.HttpMessageConverter<?>>
Bean used to manage theHttpMessageConverter
s used in a Spring Boot application. Provides a convenient way to add and merge additionalHttpMessageConverter
s to a web application.An instance of this bean can be registered with specific
additional converters
if needed, otherwise default converters will be used.NOTE: The default converters used are the same as standard Spring MVC (see
WebMvcConfigurationSupport.getMessageConverters()
with some slight re-ordering to put XML converters at the back of the list.
构造器概要
构造器 构造器 说明 HttpMessageConverters(boolean addDefaultConverters, Collection<org.springframework.http.converter.HttpMessageConverter<?>> converters)
Create a newHttpMessageConverters
instance with the specified converters.HttpMessageConverters(Collection<org.springframework.http.converter.HttpMessageConverter<?>> additionalConverters)
Create a newHttpMessageConverters
instance with the specified additional converters.HttpMessageConverters(org.springframework.http.converter.HttpMessageConverter<?>... additionalConverters)
Create a newHttpMessageConverters
instance with the specified additional converters.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 List<org.springframework.http.converter.HttpMessageConverter<?>>
getConverters()
Return an immutable list of the converters in the order that they will be registered.Iterator<org.springframework.http.converter.HttpMessageConverter<?>>
iterator()
protected List<org.springframework.http.converter.HttpMessageConverter<?>>
postProcessConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> converters)
Method that can be used to post-process theHttpMessageConverter
list before it is used.protected List<org.springframework.http.converter.HttpMessageConverter<?>>
postProcessPartConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> converters)
Method that can be used to post-process theHttpMessageConverter
list before it is used to configure the part converters ofAllEncompassingFormHttpMessageConverter
.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 java.lang.Iterable
forEach, spliterator
构造器详细资料
HttpMessageConverters
public HttpMessageConverters(org.springframework.http.converter.HttpMessageConverter<?>... additionalConverters)
Create a newHttpMessageConverters
instance with the specified additional converters.- 参数:
additionalConverters
- additional converters to be added. Items are added just before any default converter of the same type (or at the front of the list if no default converter is found) ThepostProcessConverters(List)
method can be used for further converter manipulation.
HttpMessageConverters
public HttpMessageConverters(Collection<org.springframework.http.converter.HttpMessageConverter<?>> additionalConverters)
Create a newHttpMessageConverters
instance with the specified additional converters.- 参数:
additionalConverters
- additional converters to be added. Items are added just before any default converter of the same type (or at the front of the list if no default converter is found) ThepostProcessConverters(List)
method can be used for further converter manipulation.
HttpMessageConverters
public HttpMessageConverters(boolean addDefaultConverters, Collection<org.springframework.http.converter.HttpMessageConverter<?>> converters)
Create a newHttpMessageConverters
instance with the specified converters.- 参数:
addDefaultConverters
- if default converters should be addedconverters
- converters to be added. Items are added just before any default converter of the same type (or at the front of the list if no default converter is found) ThepostProcessConverters(List)
method can be used for further converter manipulation.
方法详细资料
postProcessConverters
protected List<org.springframework.http.converter.HttpMessageConverter<?>> postProcessConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> converters)
Method that can be used to post-process theHttpMessageConverter
list before it is used.- 参数:
converters
- a mutable list of the converters that will be used.- 返回:
- the final converts list to use
postProcessPartConverters
protected List<org.springframework.http.converter.HttpMessageConverter<?>> postProcessPartConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> converters)
Method that can be used to post-process theHttpMessageConverter
list before it is used to configure the part converters ofAllEncompassingFormHttpMessageConverter
.- 参数:
converters
- a mutable list of the converters that will be used.- 返回:
- the final converts list to use
- 从以下版本开始:
- 1.3.0
getConverters
public List<org.springframework.http.converter.HttpMessageConverter<?>> getConverters()
Return an immutable list of the converters in the order that they will be registered.- 返回:
- the converters