类 ParameterContentNegotiationStrategy
java.lang.Object
cn.taketoday.web.accept.MappingMediaTypeFileExtensionResolver
cn.taketoday.web.accept.AbstractMappingContentNegotiationStrategy
cn.taketoday.web.accept.ParameterContentNegotiationStrategy
Strategy that resolves the requested content type from a query parameter.
The default query parameter name is "format".
You can register static mappings between keys (i.e. the expected value of
the query parameter) and MediaType's via MappingMediaTypeFileExtensionResolver.addMapping(String, MediaType).
this strategy also supports dynamic lookups of keys via
MediaType.fromFileName(String).
- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
-
字段概要
字段从接口继承的字段 cn.taketoday.web.accept.ContentNegotiationStrategy
MEDIA_TYPE_ALL_LIST -
构造器概要
构造器构造器说明ParameterContentNegotiationStrategy(Map<String, MediaType> mediaTypes) Create an instance with the given map of file extensions and media types. -
方法概要
修饰符和类型方法说明protected StringgetMediaTypeKey(RequestContext request) Extract a key from the request to use to look up media types.voidsetParameterName(String parameterName) Set the name of the parameter to use to determine requested media types.从类继承的方法 cn.taketoday.web.accept.AbstractMappingContentNegotiationStrategy
handleMatch, handleNoMatch, isIgnoreUnknownExtensions, isUseRegisteredExtensionsOnly, resolveMediaTypeKey, resolveMediaTypes, setIgnoreUnknownExtensions, setUseRegisteredExtensionsOnly从类继承的方法 cn.taketoday.web.accept.MappingMediaTypeFileExtensionResolver
addMapping, getAllFileExtensions, getAllMediaTypes, getMediaTypes, lookupMediaType, resolveFileExtensions
-
字段详细资料
-
parameterName
-
-
构造器详细资料
-
ParameterContentNegotiationStrategy
Create an instance with the given map of file extensions and media types.
-
-
方法详细资料
-
setParameterName
Set the name of the parameter to use to determine requested media types.By default this is set to
"format". -
getParameterName
-
getMediaTypeKey
Extract a key from the request to use to look up media types.- 指定者:
getMediaTypeKey在类中AbstractMappingContentNegotiationStrategy- 返回:
- the lookup key, or
nullif none
-