java.lang.Object
org.eclipse.jetty.rewrite.handler.Rule
org.eclipse.jetty.rewrite.handler.RegexRule
- Direct Known Subclasses:
HeaderRegexRule,RedirectRegexRule,RewriteRegexRule,TerminatingRegexRule
Abstract rule that uses the regular expression syntax for path pattern matching.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.rewrite.handler.Rule
Rule.Handler, Rule.HttpURIHandler -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Rule.Handlerapply(Rule.Handler input, Matcher matcher) Invoked after the regular expression matched the URI path to apply the rule's logic.getRegex()matchAndApply(Rule.Handler input) Tests whether the givenRequestshould apply, and if so the rule logic is triggered.voidSets the regular expression to match with the request path.toString()Returns the handling and terminating flag values.Methods inherited from class org.eclipse.jetty.rewrite.handler.Rule
isTerminating, setTerminating
-
Constructor Details
-
RegexRule
public RegexRule() -
RegexRule
-
-
Method Details
-
getRegex
- Returns:
- the regular expression
-
setRegex
Sets the regular expression to match with the request path.
- Parameters:
regex- the regular expression
-
matchAndApply
Description copied from class:RuleTests whether the given
Requestshould apply, and if so the rule logic is triggered.- Specified by:
matchAndApplyin classRule- Parameters:
input- the inputRequestandHandler- Returns:
- the possibly wrapped
RequestandHandler, ornullif the rule did not match - Throws:
IOException- if applying the rule failed
-
apply
Invoked after the regular expression matched the URI path to apply the rule's logic.
- Parameters:
input- the inputRequestandHandlermatcher- theMatcherthat matched the request path, with capture groups available for replacement.- Returns:
- the possibly wrapped
RequestandHandler - Throws:
IOException- if applying the rule failed
-
toString
Description copied from class:RuleReturns the handling and terminating flag values.
-