Class MatcherSet.Builder

java.lang.Object
org.apache.rat.config.exclusion.MatcherSet.Builder
Enclosing interface:
MatcherSet

public static class MatcherSet.Builder extends Object
A MatcherSet that assumes the files contain the already formatted strings and just need to be localised for the fileName. When build() is called the builder is reset to the initial state.
  • Field Details

    • included

      protected DocumentNameMatcher included
      The DocumentNameMatcher that specifies included files
    • excluded

      protected DocumentNameMatcher excluded
      The DocumentNameMatcher that specifies excluded files
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • segregateList

      public static void segregateList(Set<String> matching, Set<String> notMatching, Iterable<String> patterns)
      Adds to lists of qualified file patterns. Non-matching patterns start with a ExclusionUtils.NEGATION_PREFIX.
      Parameters:
      matching - the list to put matching file patterns into.
      notMatching - the list to put non-matching file patterns into.
      patterns - the patterns to match.
    • addIncluded

      public MatcherSet.Builder addIncluded(DocumentName fromDocument, Set<String> names)
      Adds included file names from the specified document. File names are resolved relative to the directory of the fromDocument.
      Parameters:
      fromDocument - the document the names were read from.
      names - the names that were read from the document. Must use the separator specified by fromDocument.
      Returns:
      this
    • addExcluded

      public MatcherSet.Builder addExcluded(DocumentName fromDocument, Set<String> names)
      Adds excluded file names from the specified document. File names are resolved relative to the directory of the fromDocument.
      Parameters:
      fromDocument - the document the names were read from.
      names - the names that were read from the document. Must use the separator specified by fromDocument.
      Returns:
      this
    • addIncluded

      public MatcherSet.Builder addIncluded(DocumentNameMatcher matcher)
      Adds specified DocumentNameMatcher to the included matchers.
      Parameters:
      matcher - A document name matcher to add to the included set.
      Returns:
      this
    • addExcluded

      public MatcherSet.Builder addExcluded(DocumentNameMatcher matcher)
      Adds specified DocumentNameMatcher to the excluded matchers.
      Parameters:
      matcher - A document name matcher to add to the excluded set.
      Returns:
      this
    • build

      public MatcherSet build()
      Builds a MatcherSet. When build() is called the builder is reset to the initial state.
      Returns:
      the MatcherSet based upon the included and excluded matchers.