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
Nested ClassesModifier and TypeClassDescriptionstatic classARequest.Wrapperused to chain a sequence ofRules together.static class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanabstract Rule.HandlermatchAndApply(Rule.Handler input) Tests whether the given inputHandler(which wraps aRequest) matches the rule, and if so returns an outputHandlerthat applies the rule logic.voidsetTerminating(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 outputHandlerthat applies the rule logic.If the input does not match,
nullis returned.- Parameters:
input- the inputHandlerthat wraps theRequest- Returns:
- an output
Handlerthat wraps the inputHandler, ornullif 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
-