Class NotMatcher

All Implemented Interfaces:
IHeaderMatcher

public class NotMatcher extends AbstractHeaderMatcher
An IHeaderMatcher that reverses the result of an enclosed matcher.
  • Constructor Details

    • NotMatcher

      public NotMatcher(IHeaderMatcher enclosed)
      Create the matcher with the enclosed matcher.
      Parameters:
      enclosed - the enclosed matcher
    • NotMatcher

      public NotMatcher(String id, IHeaderMatcher enclosed)
      Create the matcher with the enclosed matcher and id.
      Parameters:
      id - the id for this matcher.
      enclosed - the enclosed matcher
  • Method Details

    • matches

      public IHeaderMatcher.State matches(String line)
      Description copied from interface: IHeaderMatcher
      Attempts to match line and returns the State after the match is attempted.
      Parameters:
      line - next line of text, not null
      Returns:
      the new state after the matching was attempted.
    • reset

      public void reset()
      Description copied from interface: IHeaderMatcher
      Resets this state State.i. If text is being cached this method should clear that cache.
    • finalizeState

      public IHeaderMatcher.State finalizeState()
      Description copied from interface: IHeaderMatcher
      Gets the final state for this matcher. This is called after the EOF on the input. At this point there should be no matchers in an State.i state.
    • currentState

      public IHeaderMatcher.State currentState()
      Description copied from interface: IHeaderMatcher
      Gets the the current state of the matcher. All matchers should be in State.i at the start.
      Returns:
      the current state of the matcher.