RequestMapping#consumes() and RequestMapping#headers()
where the header name is 'Content-Type'. Regardless of which syntax is
used, the semantics are the same.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | ConsumesRequestCondition.
Parses and matches a single media type expression to a request's 'Content-Type' header. |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private static final ConsumesRequestCondition | |
| private final List |
| Access | Constructor and Description |
|---|---|
| public | ConsumesRequestCondition(String...
expressions with the syntax described in
consumes)RequestMapping#consumes(); if 0 expressions are provided,
the condition will match to every requestCreates a new instance from 0 or more "consumes" expressions. |
| public | ConsumesRequestCondition(String[]
as described in consumes, String[] RequestMapping#consumes()as described in headers)RequestMapping#headers()Creates a new instance with "consumes" and "header" expressions. |
| private | ConsumesRequestCondition(List<ConsumesRequestCondition.
Private constructor for internal when creating matching conditions. |
| Modifier and Type | Method and Description |
|---|---|
| public ConsumesRequestCondition | combine(ConsumesRequestCondition
the condition to combine with. other)Implements org. Returns the "other" instance if it has any expressions; returns "this" instance otherwise. |
| public int | compareTo(ConsumesRequestCondition other, ServerWebExchange exchange)
Implements org. Returns:
|
| public Set | |
| protected Collection | getContent()
Implements abstract org. Return the discrete items a request condition is composed of. |
| public Set | |
| public ConsumesRequestCondition | Returns: the same instance if the condition contains no expressions; or a new condition with matching expressions only; 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 | |
| protected String | getToStringInfix()
Implements abstract org. The notation to use when printing discrete items of content. |
| private boolean | |
| public boolean | |
| public boolean | isEmpty()
Overrides org. Whether the condition has any media type expressions. |
| private static List | |
| public void | setBodyRequired(boolean
whether requests are expected to have a body bodyRequired)Whether this condition should expect requests to have a body. |
| bodyRequired | back to summary |
|---|---|
| private boolean bodyRequired | |
| EMPTY_CONDITION | back to summary |
|---|---|
| private static final ConsumesRequestCondition EMPTY_CONDITION | |
| expressions | back to summary |
|---|---|
| private final List<ConsumesRequestCondition. | |
| ConsumesRequestCondition | back to summary |
|---|---|
| public ConsumesRequestCondition(String... consumes) Creates a new instance from 0 or more "consumes" expressions.
| |
| ConsumesRequestCondition | back to summary |
|---|---|
| public ConsumesRequestCondition(String[] consumes, String[] headers) Creates a new instance with "consumes" and "header" expressions. "Header" expressions where the header name is not 'Content-Type' or have no header value defined are ignored. If 0 expressions are provided in total, the condition will match to every request
| |
| ConsumesRequestCondition | back to summary |
|---|---|
| private ConsumesRequestCondition(List<ConsumesRequestCondition. Private constructor for internal when creating matching conditions. | |
| combine | back to summary |
|---|---|
| public ConsumesRequestCondition combine(ConsumesRequestCondition other) Implements org. Returns the "other" instance if it has any expressions; returns "this" instance otherwise. Practically that means a method-level "consumes" overrides a type-level "consumes" condition.
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(ConsumesRequestCondition other, ServerWebExchange exchange) Implements org. Returns:
It is assumed that both instances have been obtained via
| |
| getConsumableMediaTypes | back to summary |
|---|---|
| public Set Returns the media types for this condition excluding negated expressions. | |
| getContent | back to summary |
|---|---|
| protected Collection 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 MediaType expressions. | |
| getMatchingCondition | back to summary |
|---|---|
| public ConsumesRequestCondition 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
| |
| 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
| |
| hasBody | back to summary |
|---|---|
| private boolean hasBody(ServerHttpRequest request) | |
| isBodyRequired | back to summary |
|---|---|
| public boolean isBodyRequired() Return the setting for
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Overrides org. Whether the condition has any media type expressions.
| |
| parseExpressions | back to summary |
|---|---|
| private static List | |
| setBodyRequired | back to summary |
|---|---|
| public void setBodyRequired(boolean bodyRequired) Whether this condition should expect requests to have a body. By default this is set to If set to
| |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | matchMediaType(ServerWebExchange exchange)
Implements abstract org.
|
| ConsumeMediaTypeExpression | back to summary |
|---|---|
| pack-priv ConsumeMediaTypeExpression(String expression) | |
| ConsumeMediaTypeExpression | back to summary |
|---|---|
| pack-priv ConsumeMediaTypeExpression(MediaType mediaType, boolean negated) | |
| matchMediaType | back to summary |
|---|---|
| protected boolean matchMediaType(ServerWebExchange exchange) throws UnsupportedMediaTypeStatusException Implements abstract org.
| |