Class AntPatternTreeMatcher
- java.lang.Object
-
- jetbrains.buildServer.util.pathMatcher.AntPatternTreeMatcher
-
public class AntPatternTreeMatcher extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AntPatternTreeMatcher.ScanOption
static interface
AntPatternTreeMatcher.SearchCallback<T extends PathNode>
-
Constructor Summary
Constructors Constructor Description AntPatternTreeMatcher()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends PathNode<T>>
Collection<T>scan(T node, Collection<String> includeRules, Collection<String> excludeRules, AntPatternTreeMatcher.ScanOption... options)
Searches for necessary elements within the tree node using supplied collections of include and exclude rules.
Exclude rules are applied first.static <T extends PathNode<T>>
Collection<T>scan(T node, Collection<String> mixedRules, AntPatternTreeMatcher.ScanOption... options)
Searches for necessary elements within the tree node using supplied collection of search rules.static <T extends PathNode<T>>
Collection<T>scanWithCallback(T node, Collection<String> mixedRules, AntPatternTreeMatcher.SearchCallback<T> callback, AntPatternTreeMatcher.ScanOption... options)
Searches for necessary elements within the tree node using supplied collection of search rules.
-
-
-
Method Detail
-
scan
public static <T extends PathNode<T>> Collection<T> scan(@NotNull T node, @NotNull Collection<String> includeRules, @NotNull Collection<String> excludeRules, AntPatternTreeMatcher.ScanOption... options)
Searches for necessary elements within the tree node using supplied collections of include and exclude rules.
Exclude rules are applied first.- Type Parameters:
T
- an implementation ofPathNode
- Parameters:
node
- root nodeincludeRules
- set of include rules (without leading +:)excludeRules
- set of exclude rules (without leading -:)options
- set of options fromAntPatternTreeMatcher.ScanOption
- Returns:
- matching elements
-
scan
public static <T extends PathNode<T>> Collection<T> scan(@NotNull T node, @NotNull Collection<String> mixedRules, AntPatternTreeMatcher.ScanOption... options)
Searches for necessary elements within the tree node using supplied collection of search rules. All rules are considered to be include by default and applied in the provided order.
To specify an exclude rule use the -: prefix- Type Parameters:
T
- an implementation ofPathNode
- Parameters:
node
- root nodemixedRules
- set of rulesoptions
- set of options fromAntPatternTreeMatcher.ScanOption
- Returns:
- matching elements
-
scanWithCallback
public static <T extends PathNode<T>> Collection<T> scanWithCallback(@NotNull T node, @NotNull Collection<String> mixedRules, @Nullable AntPatternTreeMatcher.SearchCallback<T> callback, AntPatternTreeMatcher.ScanOption... options)
Searches for necessary elements within the tree node using supplied collection of search rules. When element matches the search criteria, a callback function SearchCallback#nodeMatched(PathNode) is called and depending on its value, it either continues search, or stops. All rules are considered to be include by default and applied in the provided order.
To specify an exclude rule use the -: prefix- Type Parameters:
T
- an implementation ofPathNode
- Parameters:
node
- root nodemixedRules
- set of rulescallback
- callback to call, when matching node is found.options
- set of options fromAntPatternTreeMatcher.ScanOption
- Returns:
- matching elements
-
-