ContentNegotiationStrategy instances.
Also provides methods to look up file extensions for a media type.
This is done by delegating to the list of configured
MediaTypeFileExtensionResolver instances.
| Modifier and Type | Field and Description |
|---|---|
| private final Set | |
| private final List |
| Access | Constructor and Description |
|---|---|
| public | ContentNegotiationManager(ContentNegotiationStrategy...
the strategies to use strategies)Create an instance with the given list of
|
| public | ContentNegotiationManager(Collection<ContentNegotiationStrategy>
the strategies to use strategies)A collection-based alternative to
|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addFileExtensionResolvers(MediaTypeFileExtensionResolver...
the resolvers to add resolvers)Register more |
| private List | |
| public List | getAllFileExtensions()
Implements org. |
| public Map | getMediaTypeMappings()
Return all registered lookup key to media type mappings by iterating
|
| public List | |
| public <T extends ContentNegotiationStrategy> T | Returns: the first matching strategy, ornull if nonethe strategy type strategyType)Find a |
| public List | resolveFileExtensions(MediaType
the media type to resolve mediaType)Implements org. |
| public List | resolveMediaTypes(NativeWebRequest
the current request request)Implements org. |
| resolvers | back to summary |
|---|---|
| private final Set<MediaTypeFileExtensionResolver> resolvers | |
| strategies | back to summary |
|---|---|
| private final List<ContentNegotiationStrategy> strategies | |
| ContentNegotiationManager | back to summary |
|---|---|
| public ContentNegotiationManager(ContentNegotiationStrategy... strategies) Create an instance with the given list of
| |
| ContentNegotiationManager | back to summary |
|---|---|
| public ContentNegotiationManager(Collection<ContentNegotiationStrategy> strategies) A collection-based alternative to
| |
| ContentNegotiationManager | back to summary |
|---|---|
| public ContentNegotiationManager() Create a default instance with a | |
| addFileExtensionResolvers | back to summary |
|---|---|
| public void addFileExtensionResolvers(MediaTypeFileExtensionResolver... resolvers) Register more
| |
| doResolveExtensions | back to summary |
|---|---|
| private List | |
| getAllFileExtensions | back to summary |
|---|---|
| public List Implements org. Doc from org. Get all registered file extensions. At startup this method returns extensions explicitly registered with
either | |
| getMediaTypeMappings | back to summary |
|---|---|
| public Map Return all registered lookup key to media type mappings by iterating
| |
| getStrategies | back to summary |
|---|---|
| public List Return the configured content negotiation strategies.
| |
| getStrategy | back to summary |
|---|---|
| public <T extends ContentNegotiationStrategy> T getStrategy(Class<T> strategyType) Find a
| |
| resolveFileExtensions | back to summary |
|---|---|
| public List Implements org. Doc from org. Resolve the given media type to a list of file extensions. | |
| resolveMediaTypes | back to summary |
|---|---|
| public List Implements org. Doc from org. Resolve the given request to a list of media types. The returned list is ordered by specificity first and by quality parameter second.
| |