org.springframework.web.reactive.accept

## Class ParameterContentTypeResolver

- java.lang.Object
- - org.springframework.web.reactive.accept.ParameterContentTypeResolver

All Implemented Interfaces:
  RequestedContentTypeResolver

    public class ParameterContentTypeResolver
    extends Object
    implements RequestedContentTypeResolver

Resolver that checks a query parameter and uses it to lookup a matching MediaType. Lookup keys can be registered or as a fallback `MediaTypeFactory` can be used to perform a lookup.

Since:
  5.0
Author:
  Rossen Stoyanchev

### Field Summary

### Fields inherited from interface org.springframework.web.reactive.accept.RequestedContentTypeResolver

`MEDIA_TYPE_ALL_LIST`

### Constructor Summary

Constructors
Constructor and Description
`ParameterContentTypeResolver(Map<String,org.springframework.http.MediaType> mediaTypes)`

### Method Summary

All Methods Instance Methods Concrete Methods
`String` `getParameterName()`
`List<org.springframework.http.MediaType>` `resolveMediaTypes(org.springframework.web.server.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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ParameterContentTypeResolver

    public ParameterContentTypeResolver(Map<String,org.springframework.http.MediaType> mediaTypes)

### Method Detail

#### setParameterName

    public void setParameterName(String parameterName)

Set the name of the parameter to use to determine requested media types.

By default this is set to "format".

#### getParameterName

    public String getParameterName()

#### resolveMediaTypes

    public List<org.springframework.http.MediaType> resolveMediaTypes(org.springframework.web.server.ServerWebExchange exchange)
                                                               throws org.springframework.web.server.NotAcceptableStatusException

Description copied from interface: `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.

Specified by:
  `resolveMediaTypes` in interface `RequestedContentTypeResolver`
Parameters:
  `exchange` - the current exchange
Returns:
  the requested media types, or `RequestedContentTypeResolver.MEDIA_TYPE_ALL_LIST` if none were requested.
Throws:
  `org.springframework.web.server.NotAcceptableStatusException` - if the requested media type is invalid