Class SimpleRegexMatcher

java.lang.Object
org.apache.rat.analysis.matchers.AbstractHeaderMatcher
org.apache.rat.analysis.matchers.SimpleRegexMatcher
All Implemented Interfaces:
IHeaderMatcher

public class SimpleRegexMatcher extends AbstractHeaderMatcher
A simple regular expression matching IHeaderMatcher
  • Constructor Details

    • SimpleRegexMatcher

      public SimpleRegexMatcher(String id, Pattern pattern)
      Constructs a regex pattern matcher with a unique random id and the specified Regex pattern.
      Parameters:
      id - the id for this matcher, may be null
      pattern - the pattern to match. Pattern will only match a single line from the input stream.
  • Method Details

    • getExpression

      public String getExpression()
      Gets the expression of the underlying matching pattern.
      Returns:
      the underlying pattern's construction expression.
    • matches

      public boolean matches(IHeaders headers)
      Description copied from interface: IHeaderMatcher
      Attempts to match text in the IHeaders instance.
      Parameters:
      headers - the representations of the headers to check
      Returns:
      true if the matcher matches the text, false otherwise.