类 ParameterContentTypeResolver
- java.lang.Object
- org.springframework.web.reactive.accept.ParameterContentTypeResolver
- 所有已实现的接口:
RequestedContentTypeResolver
public class ParameterContentTypeResolver extends Object implements RequestedContentTypeResolver
Resolver that checks a query parameter and uses it to lookup a matching MediaType. Lookup keys can be registered or as a fallbackMediaTypeFactory
can be used to perform a lookup.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev
字段概要
从接口继承的字段 org.springframework.web.reactive.accept.RequestedContentTypeResolver
MEDIA_TYPE_ALL_LIST
构造器概要
构造器 构造器 说明 ParameterContentTypeResolver(Map<String,MediaType> mediaTypes)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 String
getParameterName()
List<MediaType>
resolveMediaTypes(ServerWebExchange exchange)
Resolve the given request to a list of requested media types.void
setParameterName(String parameterName)
Set the name of the parameter to use to determine requested media types.
构造器详细资料
ParameterContentTypeResolver
public ParameterContentTypeResolver(Map<String,MediaType> mediaTypes)
方法详细资料
setParameterName
public void setParameterName(String parameterName)
Set the name of the parameter to use to determine requested media types.By default this is set to "format".
getParameterName
public String getParameterName()
resolveMediaTypes
public List<MediaType> resolveMediaTypes(ServerWebExchange exchange) throws NotAcceptableStatusException
从接口复制的说明:RequestedContentTypeResolver
Resolve the given request to a list of requested media types. The returned list is ordered by specificity first and by quality parameter second.- 指定者:
resolveMediaTypes
在接口中RequestedContentTypeResolver
- 参数:
exchange
- the current exchange- 返回:
- the requested media types, or
RequestedContentTypeResolver.MEDIA_TYPE_ALL_LIST
if none were requested. - 抛出:
NotAcceptableStatusException
- if the requested media type is invalid