public final class SelectorPlugin extends Object implements Plugin
Selector
s.
This plugin is necessary to parse raw, unrefined selectors into the more specific SelectorPart
s such as ClassSelector
and IdSelector
. These more specific parts will not be delivered to subscription methods until the parent
Selector
is first refined. See the main readme file for more information on refinement.
In custom refiner plugins, you can reuse the logic from this class to parse selectors with the delegateRefinement(Selector, Grammar, Broadcaster)
method. For example, to check if the raw selector content contains a
certain string and if so to refine it.
Constructor and Description |
---|
SelectorPlugin() |
Modifier and Type | Method and Description |
---|---|
static void |
delegateRefinement(Selector selector,
Grammar grammar,
Broadcaster broadcaster)
A convenience method to delegate refinement of a
Selector to this class. |
void |
refine(Selector selector,
Grammar grammar,
Broadcaster broadcaster)
Refines the given
Selector . |
public void refine(Selector selector, Grammar grammar, Broadcaster broadcaster)
Selector
.
If refinement is successful one or more SelectorPart
s will be broadcasted via the
given Broadcaster
.
selector
- The selector.grammar
- The grammar.broadcaster
- The broadcaster.public static void delegateRefinement(Selector selector, Grammar grammar, Broadcaster broadcaster)
Selector
to this class.
This is mainly used by Refine
subscription methods.
If refinement is successful one or more SelectorPart
s will be broadcasted via the
given Broadcaster
.
selector
- Refine this selector.grammar
- The grammar.broadcaster
- The broadcaster.Copyright (c) 2019, Salesforce.com, Inc. All rights reserved. Licensed under the BSD 3-Clause license. For full license text, see the LICENSE file in the repository.