public abstract class RegexRule extends Rule
Rule.ApplyURI| Modifier and Type | Field and Description |
|---|---|
protected java.util.regex.Pattern |
_regex |
_handling, _terminating| Constructor and Description |
|---|
RegexRule() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract 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 |
getRegex() |
java.lang.String |
matchAndApply(java.lang.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(java.lang.String regex)
Sets the regular expression string used to match with string URI.
|
java.lang.String |
toString()
Returns the regular expression string.
|
isHandling, isTerminating, setHandling, setTerminatingpublic void setRegex(java.lang.String regex)
regex - the regular expression.public java.lang.String getRegex()
public java.lang.String matchAndApply(java.lang.String target,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException
RulematchAndApply in class Ruletarget - The target of the requestjava.io.IOException - TODOprotected abstract 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
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).java.io.IOException - exceptions dealing with operating on request or response objectsCopyright © 2013 FuseSource, Corp.. All Rights Reserved.