Class Rule
java.lang.Object
org.eclipse.jetty.rewrite.handler.Rule
- Direct Known Subclasses:
CompactPathRule
,ForceRequestHeaderValueRule
,HeaderRule
,InvalidURIRule
,PatternRule
,RegexRule
,ResponseStatusHeaderRegexRule
,RuleContainer
An abstract rule that, upon matching a certain condition, may wrap
the Request
or the Handler
to execute custom logic.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
ARequest.Wrapper
used to chain a sequence ofRule
s together.static class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
abstract Rule.Handler
matchAndApply
(Rule.Handler input) Tests whether the given inputHandler
(which wraps aRequest
) matches the rule, and if so returns an outputHandler
that applies the rule logic.void
setTerminating
(boolean value) toString()
-
Constructor Details
-
Rule
public Rule()
-
-
Method Details
-
matchAndApply
Tests whether the given input
Handler
(which wraps aRequest
) matches the rule, and if so returns an outputHandler
that applies the rule logic.If the input does not match,
null
is returned.- Parameters:
input
- the inputHandler
that wraps theRequest
- Returns:
- an output
Handler
that wraps the inputHandler
, ornull
if the rule does not match - Throws:
IOException
- if applying the rule fails
-
isTerminating
public boolean isTerminating()- Returns:
- whether rules after this one are not invoked
-
setTerminating
public void setTerminating(boolean value) - Parameters:
value
- whether rules after this one are not invoked
-
toString
-