public class MatcherLookup
extends java.lang.Object
The lookup doesn't target to speed up lookup for non exact pattern matcher. All non exact matchers are placed in non-keyed collection.
At lookup for matchers against specific module, all non exact pattern matchers are iterated to match with module attributes, and exact pattern matchers binding to the same key will also iterated to match with module attributes.
If there are much more exact pattern matchers than non exact pattern matchers, the matcher lookup speed can benefit from this class significantly. A quick example could be user declares lots of dependencyOverrides which are typically exact pattern matchers.
If there are balanced exact and non exact pattern matchers, the matcher lookup speed doesn't hurt by this class.
Constructor and Description |
---|
MatcherLookup() |
Modifier and Type | Method and Description |
---|---|
void |
add(MapMatcher matcher)
Add matcher.
|
java.util.List |
get(java.util.Map attrs)
Get a list of matchers which can apply to module with specified attributes
|
public void add(MapMatcher matcher)
matcher
- public java.util.List get(java.util.Map attrs)
attrs
- A map of attributes that matcher should match.