public abstract class RegexRule extends Rule
Rule.ApplyURI
Modifier and Type | Field and Description |
---|---|
protected Pattern |
_regex |
_handling, _terminating
Constructor and Description |
---|
RegexRule() |
Modifier and Type | Method and Description |
---|---|
protected abstract String |
apply(String target,
HttpServletRequest request,
HttpServletResponse response,
Matcher matcher)
Apply this rule to the request/response pair.
|
String |
getRegex() |
String |
matchAndApply(String target,
HttpServletRequest request,
HttpServletResponse response)
This method calls tests the rule against the request/response pair and if the Rule
applies, then the rule's action is triggered.
|
void |
setRegex(String regex)
Sets the regular expression string used to match with string URI.
|
String |
toString()
Returns the regular expression string.
|
isHandling, isTerminating, setHandling, setTerminating
protected Pattern _regex
public void setRegex(String regex)
regex
- the regular expression.public String getRegex()
public String matchAndApply(String target, HttpServletRequest request, HttpServletResponse response) throws IOException
Rule
matchAndApply
in class Rule
target
- The target of the requestIOException
protected abstract String apply(String target, HttpServletRequest request, HttpServletResponse response, Matcher matcher) throws IOException
matchAndApply(String, HttpServletRequest, HttpServletResponse)
if the regex matches.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 objectsCopyright © 1995-2015 Webtide. All Rights Reserved.