Package io.microsphere.spring.web.rule
Class WebRequestConsumesRule
java.lang.Object
io.microsphere.spring.web.rule.AbstractWebRequestRule<ConsumeMediaTypeExpression>
io.microsphere.spring.web.rule.WebRequestConsumesRule
- All Implemented Interfaces:
WebRequestRule
WebRequest
Consumes WebRequestRule
A logical disjunction (' || ') request condition to match a request's
'Content-Type' header to a list of media type expressions. Two kinds of
media type expressions are supported, which are described in
RequestMapping.consumes()
and RequestMapping.headers()
where the header name is 'Content-Type'. Regardless of which syntax is
used, the semantics are the same.
- Since:
- 1.0.066
- Author:
- Arjen Poutsma, Rossen Stoyanchev, Mercy
- See Also:
-
WebRequestRule
org.springframework.web.servlet.mvc.condition.ConsumesRequestCondition
org.springframework.web.reactive.result.condition.ConsumesRequestCondition
-
Constructor Summary
ConstructorsConstructorDescriptionWebRequestConsumesRule
(String... consumes) WebRequestConsumesRule
(String[] consumes, String... headers) -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<ConsumeMediaTypeExpression>
Return the discrete items a request condition is composed of.protected String
The notation to use when printing discrete items of content.boolean
matches
(org.springframework.web.context.request.NativeWebRequest request) Methods inherited from class io.microsphere.spring.web.rule.AbstractWebRequestRule
equals, hashCode, isEmpty, toString
-
Constructor Details
-
WebRequestConsumesRule
-
WebRequestConsumesRule
-
-
Method Details
-
getContent
Description copied from class:AbstractWebRequestRule
Return the discrete items a request condition is composed of.For example URL patterns, HTTP request methods, param expressions, etc.
- Specified by:
getContent
in classAbstractWebRequestRule<ConsumeMediaTypeExpression>
- Returns:
- a collection of objects (never
null
)
-
getToStringInfix
Description copied from class:AbstractWebRequestRule
The notation to use when printing discrete items of content.For example
" || "
for URL patterns or" && "
for param expressions.- Specified by:
getToStringInfix
in classAbstractWebRequestRule<ConsumeMediaTypeExpression>
-
matches
public boolean matches(org.springframework.web.context.request.NativeWebRequest request)
-