RequestMapping#produces() and
RequestMapping#headers() where the header name is 'Accept'.
Regardless of which syntax is used, the semantics are the same.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class | ProducesRequestCondition.
Parses and matches a single media type expression to a request's 'Accept' header. |
| Modifier and Type | Field and Description |
|---|---|
| private final RequestedContentTypeResolver | |
| private static final RequestedContentTypeResolver | |
| private static final ProducesRequestCondition | |
| private final List | |
| private static final String | |
| private final List |
| Access | Constructor and Description |
|---|---|
| public | ProducesRequestCondition(String...
expressions with syntax defined by produces)RequestMapping#produces()Creates a new instance from "produces" expressions. |
| public | ProducesRequestCondition(String[]
expressions with syntax defined by produces, String[] RequestMapping#produces()expressions with syntax defined by headers)RequestMapping#headers()Creates a new instance with "produces" and "header" expressions. |
| public | ProducesRequestCondition(String[]
expressions with syntax defined by produces, String[] RequestMapping#produces()expressions with syntax defined by headers, RequestedContentTypeResolver RequestMapping#headers()used to determine requested content type resolver)Same as |
| private | ProducesRequestCondition(List<ProducesRequestCondition.
Private constructor for internal use to create matching conditions. |
| Modifier and Type | Method and Description |
|---|---|
| public static void | clearMediaTypesAttribute(ServerWebExchange
the current exchange exchange)Use this to clear |
| public ProducesRequestCondition | combine(ProducesRequestCondition
the condition to combine with. other)Implements org. Returns the "other" instance if it has any expressions; returns "this" instance otherwise. |
| private int | compareMatchingMediaTypes(ProducesRequestCondition condition1, int index1, ProducesRequestCondition condition2, int index2)
|
| public int | compareTo(ProducesRequestCondition other, ServerWebExchange exchange)
Implements org. Compares this and another "produces" condition as follows:
|
| private List | |
| protected List | getContent()
Implements abstract org. Return the discrete items a request condition is composed of. |
| public Set | |
| private List | getExpressionsToCompare()
Return the contained "produces" expressions or if that's empty, a list with a */* expression. |
| public ProducesRequestCondition | Returns: the same instance if there are no expressions; or a new condition with matching expressions; ornull if no expressions match.the current exchange exchange)Implements org. Checks if any of the contained media type expressions match the given request 'Content-Type' header and returns an instance that is guaranteed to contain matching expressions only. |
| private List | |
| public Set | |
| protected String | getToStringInfix()
Implements abstract org. The notation to use when printing discrete items of content. |
| private int | |
| private int | |
| public boolean | isEmpty()
Overrides org. Whether the condition has any media type expressions. |
| private List |
| contentTypeResolver | back to summary |
|---|---|
| private final RequestedContentTypeResolver contentTypeResolver | |
| DEFAULT_CONTENT_TYPE_RESOLVER | back to summary |
|---|---|
| private static final RequestedContentTypeResolver DEFAULT_CONTENT_TYPE_RESOLVER | |
| EMPTY_CONDITION | back to summary |
|---|---|
| private static final ProducesRequestCondition EMPTY_CONDITION | |
| expressions | back to summary |
|---|---|
| private final List<ProducesRequestCondition. | |
| MEDIA_TYPES_ATTRIBUTE | back to summary |
|---|---|
| private static final String MEDIA_TYPES_ATTRIBUTE | |
| mediaTypeAllList | back to summary |
|---|---|
| private final List<ProducesRequestCondition. | |
| ProducesRequestCondition | back to summary |
|---|---|
| public ProducesRequestCondition(String... produces) Creates a new instance from "produces" expressions. If 0 expressions are provided in total, this condition will match to any request.
| |
| ProducesRequestCondition | back to summary |
|---|---|
| public ProducesRequestCondition(String[] produces, String[] headers) Creates a new instance with "produces" and "header" expressions. "Header" expressions where the header name is not 'Accept' or have no header value defined are ignored. If 0 expressions are provided in total, this condition will match to any request.
| |
| ProducesRequestCondition | back to summary |
|---|---|
| public ProducesRequestCondition(String[] produces, String[] headers, RequestedContentTypeResolver resolver) Same as
| |
| ProducesRequestCondition | back to summary |
|---|---|
| private ProducesRequestCondition(List<ProducesRequestCondition. Private constructor for internal use to create matching conditions. Note the expressions List is neither sorted, nor deep copied. | |
| clearMediaTypesAttribute | back to summary |
|---|---|
| public static void clearMediaTypesAttribute(ServerWebExchange exchange) Use this to clear
| |
| combine | back to summary |
|---|---|
| public ProducesRequestCondition combine(ProducesRequestCondition other) Implements org. Returns the "other" instance if it has any expressions; returns "this" instance otherwise. Practically that means a method-level "produces" overrides a type-level "produces" condition.
| |
| compareMatchingMediaTypes | back to summary |
|---|---|
| private int compareMatchingMediaTypes(ProducesRequestCondition condition1, int index1, ProducesRequestCondition condition2, int index2) | |
| compareTo | back to summary |
|---|---|
| public int compareTo(ProducesRequestCondition other, ServerWebExchange exchange) Implements org. Compares this and another "produces" condition as follows:
It is assumed that both instances have been obtained via
| |
| getAcceptedMediaTypes | back to summary |
|---|---|
| private List | |
| getContent | back to summary |
|---|---|
| protected List Implements abstract org. Doc from org. Return the discrete items a request condition is composed of. For example URL patterns, HTTP request methods, param expressions, etc.
| |
| getExpressions | back to summary |
|---|---|
| public Set Return the contained "produces" expressions. | |
| getExpressionsToCompare | back to summary |
|---|---|
| private List Return the contained "produces" expressions or if that's empty, a list with a */* expression. | |
| getMatchingCondition | back to summary |
|---|---|
| public ProducesRequestCondition getMatchingCondition(ServerWebExchange exchange) Implements org. Checks if any of the contained media type expressions match the given
request 'Content-Type' header and returns an instance that is guaranteed
to contain matching expressions only. The match is performed via
| |
| getMatchingExpressions | back to summary |
|---|---|
private List
| |
| getProducibleMediaTypes | back to summary |
|---|---|
| public Set Return the contained producible media types excluding negated expressions. | |
| getToStringInfix | back to summary |
|---|---|
| protected String getToStringInfix() Implements abstract org. Doc from org. The notation to use when printing discrete items of content. For example
| |
| indexOfEqualMediaType | back to summary |
|---|---|
| private int indexOfEqualMediaType(MediaType mediaType) | |
| indexOfIncludedMediaType | back to summary |
|---|---|
| private int indexOfIncludedMediaType(MediaType mediaType) | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Overrides org. Whether the condition has any media type expressions.
| |
| parseExpressions | back to summary |
|---|---|
| private List | |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | matchMediaType(ServerWebExchange exchange)
Implements abstract org.
|
| ProduceMediaTypeExpression | back to summary |
|---|---|
| pack-priv ProduceMediaTypeExpression(MediaType mediaType, boolean negated) | |
| ProduceMediaTypeExpression | back to summary |
|---|---|
| pack-priv ProduceMediaTypeExpression(String expression) | |
| matchMediaType | back to summary |
|---|---|
| protected boolean matchMediaType(ServerWebExchange exchange) throws NotAcceptableStatusException Implements abstract org.
| |