public class ParameterContentNegotiationStrategy extends AbstractMappingContentNegotiationStrategy
format.
Its value is used to look up the media type in the map given to the constructor.| Constructor and Description |
|---|
ParameterContentNegotiationStrategy(Map<String,MediaType> mediaTypes)
Create an instance with the given extension-to-MediaType lookup.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
getMediaTypeKey(NativeWebRequest webRequest)
Sub-classes must extract the key to use to look up a media type.
|
protected void |
handleMatch(String mediaTypeKey,
MediaType mediaType)
Invoked when a matching media type is found in the lookup map.
|
void |
setParameterName(String parameterName)
Set the parameter name that can be used to determine the requested media type.
|
handleNoMatch, resolveMediaTypesaddMapping, getAllFileExtensions, lookupMediaType, resolveFileExtensionsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAllFileExtensions, resolveFileExtensionspublic ParameterContentNegotiationStrategy(Map<String,MediaType> mediaTypes)
IllegalArgumentException - if a media type string cannot be parsedpublic void setParameterName(String parameterName)
The default parameter name is format.
protected String getMediaTypeKey(NativeWebRequest webRequest)
AbstractMappingContentNegotiationStrategygetMediaTypeKey in class AbstractMappingContentNegotiationStrategynull if the key cannot be derivedprotected void handleMatch(String mediaTypeKey, MediaType mediaType)
AbstractMappingContentNegotiationStrategyhandleMatch in class AbstractMappingContentNegotiationStrategy