java.lang.Object
org.eclipse.jetty.rewrite.handler.Rule
Direct Known Subclasses:
CompactPathRule, ForceRequestHeaderValueRule, HeaderRule, InvalidURIRule, PatternRule, RegexRule, RuleContainer

public abstract class Rule extends Object

An abstract rule that, upon matching a certain condition, may wrap the Request or the Handler to execute custom logic.

  • Constructor Details

    • Rule

      public Rule()
  • Method Details

    • matchAndApply

      public abstract Rule.Handler matchAndApply(Rule.Handler input) throws IOException

      Tests whether the given Request should apply, and if so the rule logic is triggered.

      Parameters:
      input - the input Request and Handler
      Returns:
      the possibly wrapped Request and Handler, or null if the rule did not match
      Throws:
      IOException - if applying the rule failed
    • isTerminating

      public boolean isTerminating()
      Returns:
      when true, rules after this one are not invoked
    • setTerminating

      public void setTerminating(boolean value)
    • toString

      public String toString()
      Returns the handling and terminating flag values.
      Overrides:
      toString in class Object