Package org.apache.rat.config.exclusion
Class MatcherSet.Builder
java.lang.Object
org.apache.rat.config.exclusion.MatcherSet.Builder
- Enclosing interface:
MatcherSet
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 Summary
FieldsModifier and TypeFieldDescriptionprotected DocumentNameMatcher
The DocumentNameMatcher that specifies excluded filesprotected DocumentNameMatcher
The DocumentNameMatcher that specifies included files -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddExcluded
(DocumentNameMatcher matcher) Adds specified DocumentNameMatcher to the excluded matchers.addExcluded
(DocumentName fromDocument, Set<String> names) Adds excluded file names from the specified document.addIncluded
(DocumentNameMatcher matcher) Adds specified DocumentNameMatcher to the included matchers.addIncluded
(DocumentName fromDocument, Set<String> names) Adds included file names from the specified document.build()
Builds a MatcherSet.static void
Adds to lists of qualified file patterns.
-
Field Details
-
included
The DocumentNameMatcher that specifies included files -
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 aExclusionUtils.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
Adds included file names from the specified document. File names are resolved relative to the directory of thefromDocument
.- Parameters:
fromDocument
- the document the names were read from.names
- the names that were read from the document. Must use the separator specified byfromDocument
.- Returns:
- this
-
addExcluded
Adds excluded file names from the specified document. File names are resolved relative to the directory of thefromDocument
.- Parameters:
fromDocument
- the document the names were read from.names
- the names that were read from the document. Must use the separator specified byfromDocument
.- Returns:
- this
-
addIncluded
Adds specified DocumentNameMatcher to the included matchers.- Parameters:
matcher
- A document name matcher to add to the included set.- Returns:
- this
-
addExcluded
Adds specified DocumentNameMatcher to the excluded matchers.- Parameters:
matcher
- A document name matcher to add to the excluded set.- Returns:
- this
-
build
Builds a MatcherSet. Whenbuild()
is called the builder is reset to the initial state.- Returns:
- the MatcherSet based upon the included and excluded matchers.
-