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,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Matcher matcher)
Apply this rule to the request/response pair.
|
String |
getRegex() |
String |
matchAndApply(String target,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.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, setTerminatingprotected Pattern _regex
public void setRegex(String regex)
regex - the regular expression.public String getRegex()
public String matchAndApply(String target, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
RulematchAndApply in class Ruletarget - The target of the requestIOException - TODOprotected abstract String apply(String target, javax.servlet.http.HttpServletRequest request, javax.servlet.http.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 Mort Bay Consulting. All Rights Reserved.