public class HeaderRegexRule extends RegexRule
Rule.ApplyURI
_handling, _terminating
Constructor and Description |
---|
HeaderRegexRule() |
Modifier and Type | Method and Description |
---|---|
protected String |
apply(String target,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Matcher matcher)
Apply this rule to the request/response pair.
|
String |
getName()
Returns the header name.
|
String |
getValue()
Returns the header value.
|
boolean |
isAdd() |
void |
setAdd(boolean add)
Sets the Add flag.
|
void |
setName(String name)
Sets the header name.
|
void |
setValue(String value)
Sets the header value.
|
String |
toString()
Returns the regular expression string.
|
getRegex, matchAndApply, setRegex
isHandling, isTerminating, setHandling, setTerminating
public void setName(String name)
name
- name of the header fieldpublic void setValue(String value)
String
or int
value.value
- of the header fieldpublic void setAdd(boolean add)
add
- If true, the header is added to the response, otherwise the header it is set on the response.protected String apply(String target, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Matcher matcher) throws IOException
RegexRule
RegexRule.matchAndApply(String, HttpServletRequest, HttpServletResponse)
if the regex matches.apply
in class RegexRule
target
- field to attempt matchrequest
- request objectresponse
- response objectmatcher
- The Regex matcher that matched the request (with capture groups available for replacement).IOException
- exceptions dealing with operating on request or response objectspublic String getName()
public String getValue()
public boolean isAdd()
Copyright © 1995-2015 Webtide. All Rights Reserved.