public abstract class AbstractSelectorListResolver extends Object implements SelectorListResolver
Modifier and Type | Field and Description |
---|---|
protected static Object |
NULL_VALUE |
Modifier | Constructor and Description |
---|---|
protected |
AbstractSelectorListResolver(SelectableResolver selectableResolver) |
Modifier and Type | Method and Description |
---|---|
protected static void |
assertNotMultipleMatches(Map<Selectable,?> matchingConditions,
String attributeName,
BuildTarget buildTarget)
Assertion that ensures that the current configuration doesn't match multiple select dictionary
keys
|
protected static void |
assertSelectorHasDefault(BuildTarget buildTarget,
DependencyStack dependencyStack,
String attributeName,
Selector<?> selector)
Assertion for the selector to contain "DEFAULT" as key inside the dictionary.
|
protected <T> Map<Selectable,Object> |
findMatchingConditions(SelectableConfigurationContext configurationContext,
Selector<T> selector,
DependencyStack dependencyStack)
Returns the value for which the current configuration matches the key inside the select
dictionary
|
<T> T |
resolveList(SelectableConfigurationContext configurationContext,
BuildTarget buildTarget,
String attributeName,
SelectorList<T> selectorList,
Concatable<T> concatable,
DependencyStack dependencyStack)
Resolves the elements in a given
SelectorList and returns the concatenated value. |
protected abstract <T> T |
resolveSelector(SelectableConfigurationContext configurationContext,
BuildTarget buildTarget,
DependencyStack dependencyStack,
String attributeName,
Selector<T> selector) |
protected static final Object NULL_VALUE
protected AbstractSelectorListResolver(SelectableResolver selectableResolver)
@Nullable public <T> T resolveList(SelectableConfigurationContext configurationContext, BuildTarget buildTarget, String attributeName, SelectorList<T> selectorList, Concatable<T> concatable, DependencyStack dependencyStack)
SelectorListResolver
SelectorList
and returns the concatenated value.resolveList
in interface SelectorListResolver
T
- the type of elements stored in the provided selectable listbuildTarget
- the build target that contains the given list in its argumentsattributeName
- the name of the attribute that holds the given selector listselectorList
- a list with selectable elementsconcatable
- to be used when concatenating select items (e. g. lists or strings)dependencyStack
- used to provide error stacksnull
if the list is resolved to an absent element@Nullable protected abstract <T> T resolveSelector(SelectableConfigurationContext configurationContext, BuildTarget buildTarget, DependencyStack dependencyStack, String attributeName, Selector<T> selector)
protected <T> Map<Selectable,Object> findMatchingConditions(SelectableConfigurationContext configurationContext, Selector<T> selector, DependencyStack dependencyStack)
protected static void assertNotMultipleMatches(Map<Selectable,?> matchingConditions, String attributeName, BuildTarget buildTarget)
protected static void assertSelectorHasDefault(BuildTarget buildTarget, DependencyStack dependencyStack, String attributeName, Selector<?> selector)