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(java.util.Map<java.lang.String,MediaType> mediaTypes)
Create an instance with the given extension-to-MediaType lookup.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getMediaTypeKey(NativeWebRequest webRequest)
Sub-classes must extract the key to use to look up a media type.
|
protected void |
handleMatch(java.lang.String mediaTypeKey,
MediaType mediaType)
Invoked when a matching media type is found in the lookup map.
|
void |
setParameterName(java.lang.String parameterName)
Set the parameter name that can be used to determine the requested media type.
|
handleNoMatch, resolveMediaTypes
addMapping, getAllFileExtensions, lookupMediaType, resolveFileExtensions
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAllFileExtensions, resolveFileExtensions
public ParameterContentNegotiationStrategy(java.util.Map<java.lang.String,MediaType> mediaTypes)
java.lang.IllegalArgumentException
- if a media type string cannot be parsedpublic void setParameterName(java.lang.String parameterName)
The default parameter name is format
.
protected java.lang.String getMediaTypeKey(NativeWebRequest webRequest)
AbstractMappingContentNegotiationStrategy
getMediaTypeKey
in class AbstractMappingContentNegotiationStrategy
null
if the key cannot be derivedprotected void handleMatch(java.lang.String mediaTypeKey, MediaType mediaType)
AbstractMappingContentNegotiationStrategy
handleMatch
in class AbstractMappingContentNegotiationStrategy