public class ParameterContentTypeResolver extends Object implements RequestedContentTypeResolver
MediaTypeFactory
can be used to perform a lookup.MEDIA_TYPE_ALL_LIST
Constructor and Description |
---|
ParameterContentTypeResolver(Map<String,MediaType> mediaTypes) |
Modifier and Type | Method and Description |
---|---|
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.
|
public void setParameterName(String parameterName)
By default this is set to "format".
public String getParameterName()
public List<MediaType> resolveMediaTypes(ServerWebExchange exchange) throws NotAcceptableStatusException
RequestedContentTypeResolver
resolveMediaTypes
in interface RequestedContentTypeResolver
exchange
- the current exchangeRequestedContentTypeResolver.MEDIA_TYPE_ALL_LIST
if none
were requested.NotAcceptableStatusException
- if the requested media type is invalid