类 FixedContentTypeResolver
- java.lang.Object
- org.springframework.web.reactive.accept.FixedContentTypeResolver
- 所有已实现的接口:
RequestedContentTypeResolver
public class FixedContentTypeResolver extends Object implements RequestedContentTypeResolver
Resolver that always resolves to a fixed list of media types. This can be used as the "last in line" strategy providing a fallback for when the client has not requested any media types.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev
字段概要
从接口继承的字段 org.springframework.web.reactive.accept.RequestedContentTypeResolver
MEDIA_TYPE_ALL_LIST
构造器概要
构造器 构造器 说明 FixedContentTypeResolver(List<MediaType> contentTypes)
Constructor with an ordered List of defaultMediaType
's to return for use in applications that support a variety of content types.FixedContentTypeResolver(MediaType mediaType)
Constructor with a single defaultMediaType
.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 List<MediaType>
getContentTypes()
Return the configured list of media types.List<MediaType>
resolveMediaTypes(ServerWebExchange exchange)
Resolve the given request to a list of requested media types.
构造器详细资料
FixedContentTypeResolver
public FixedContentTypeResolver(MediaType mediaType)
Constructor with a single defaultMediaType
.
FixedContentTypeResolver
public FixedContentTypeResolver(List<MediaType> contentTypes)
Constructor with an ordered List of defaultMediaType
's to return for use in applications that support a variety of content types.Consider appending
MediaType.ALL
at the end if destinations are present which do not support any of the other default media types.
方法详细资料
getContentTypes
public List<MediaType> getContentTypes()
Return the configured list of media types.
resolveMediaTypes
public List<MediaType> resolveMediaTypes(ServerWebExchange exchange)
从接口复制的说明: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.