Class Header
java.lang.Object
org.ocpsoft.rewrite.config.DefaultConditionBuilder
org.ocpsoft.rewrite.servlet.config.HttpCondition
org.ocpsoft.rewrite.servlet.config.Header
- All Implemented Interfaces:
Condition,ConditionBuilder,Parameterized
A
Condition responsible for asserting on specified values of HttpServletRequest.getHeader(String).- Author:
- Lincoln Baxter, III
-
Method Summary
Modifier and TypeMethodDescriptionbooleanevaluateHttp(HttpServletRewrite event, EvaluationContext context) static HeaderCreate aHeadercondition that matches only against the existence of a header with a name matching the given pattern.static HeaderCreate aHeadercondition that matches against both header name and values.voidsetParameterStore(ParameterStore store) static HeadervalueExists(String value) Create aHeadercondition that matches only against the existence of a header with value matching the given pattern.Methods inherited from class org.ocpsoft.rewrite.servlet.config.HttpCondition
evaluateMethods inherited from class org.ocpsoft.rewrite.config.DefaultConditionBuilder
and, andNot, or, orNot
-
Method Details
-
matches
Create aHeadercondition that matches against both header name and values.The given name and value patterns may be parameterized:
Header.matches("Accept-Encoding", "{encoding}")
Header.matches("Accept-{type}", "{value}")
...- Parameters:
name-ParameterizedPatternmatching the header name.value-ParameterizedPatternmatching the header value.
-
exists
Create aHeadercondition that matches only against the existence of a header with a name matching the given pattern. The header value is ignored.The given name pattern may be parameterized:
Header.exists("Accept-Encoding")
Header.exists("Accept-{acceptType}")
Header.exists("{anything}")
...- Parameters:
name-ParameterizedPatternmatching the header name.
-
valueExists
Create aHeadercondition that matches only against the existence of a header with value matching the given pattern. The header name is ignored.The given value pattern may be parameterized:
Header.valueExists("application/xml")
Header.valueExists("application/{type}")
Header.valueExists("{anything}")
...- Parameters:
value-ParameterizedPatternmatching the header value.
-
evaluateHttp
- Specified by:
evaluateHttpin classHttpCondition
-
getRequiredParameterNames
- Specified by:
getRequiredParameterNamesin interfaceParameterized
-
setParameterStore
- Specified by:
setParameterStorein interfaceParameterized
-