Interface IHeaderMatcher

All Known Subinterfaces:
ILicense
All Known Implementing Classes:
AbstractHeaderMatcher, AbstractMatcherContainer, AbstractSimpleMatcher, AndMatcher, CopyrightMatcher, FullTextMatcher, NotMatcher, OrMatcher, SimpleRegexMatcher, SimpleTextMatcher, SPDXMatcherFactory.Match, UnknownLicense

public interface IHeaderMatcher
Performs explicit checks against a line from the header of a file. For implementations that need to check multiple lines the implementation must cache the earlier lines.
  • Method Details

    • getId

      String getId()
      Get the identifier for this matcher.

      All matchers must have unique identifiers

      Returns:
      the Identifier for this matcher.
    • reset

      void reset()
      Resets this state State.i. If text is being cached this method should clear that cache.
    • matches

      IHeaderMatcher.State matches(String line)
      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.
    • finalizeState

      IHeaderMatcher.State finalizeState()
      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

      IHeaderMatcher.State currentState()
      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.