public class HeaderRegexRule extends RegexRule
Rule.ApplyURI
_handling, _terminating
Constructor | Description |
---|---|
HeaderRegexRule() |
|
HeaderRegexRule(java.lang.String regex,
java.lang.String name,
java.lang.String value) |
Modifier and Type | Method | Description |
---|---|---|
protected java.lang.String |
apply(java.lang.String target,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.util.regex.Matcher matcher) |
Apply this rule to the request/response pair.
|
java.lang.String |
getName() |
Returns the header name.
|
java.lang.String |
getValue() |
Returns the header value.
|
boolean |
isAdd() |
|
void |
setAdd(boolean add) |
Sets the Add flag.
|
void |
setName(java.lang.String name) |
Sets the header name.
|
void |
setValue(java.lang.String value) |
Sets the header value.
|
java.lang.String |
toString() |
Returns the regular expression string.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getRegex, matchAndApply, setRegex
isHandling, isTerminating, setHandling, setTerminating
public HeaderRegexRule()
public HeaderRegexRule(@Name("regex") java.lang.String regex, @Name("name") java.lang.String name, @Name("value") java.lang.String value)
public void setName(java.lang.String name)
name
- name of the header fieldpublic void setValue(java.lang.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 java.lang.String apply(java.lang.String target, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.util.regex.Matcher matcher) throws java.io.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).java.io.IOException
- exceptions dealing with operating on request or response objectspublic java.lang.String getName()
public java.lang.String getValue()
public boolean isAdd()
Copyright © 1995–2018 Webtide. All rights reserved.