public final class DeclarationPlugin extends Object implements Plugin
Declaration
s.
This plugin is necessary to parse raw, unrefined declarations into into the more specific parts such as UrlFunctionValue
and KeywordValue
. These more specific parts will not be delivered to subscription methods until the
parent Declaration
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 declarations with the delegateRefinement(Declaration, Grammar, Broadcaster)
method. For example, to check if the raw declaration content contains a
certain string and if so to refine it.
Constructor and Description |
---|
DeclarationPlugin() |
Modifier and Type | Method and Description |
---|---|
static void |
delegateRefinement(Declaration declaration,
Grammar grammar,
Broadcaster broadcaster)
A convenience method to delegate refinement of a
Declaration to this class. |
void |
refine(Declaration declaration,
Grammar grammar,
Broadcaster broadcaster)
Refines the given
Declaration . |
public void refine(Declaration declaration, Grammar grammar, Broadcaster broadcaster)
Declaration
.
If refinement is successful then a single PropertyValue
(plus one or more PropertyValueMember
s) will be
broadcasted via the given Broadcaster
.
declaration
- The declaration.grammar
- The grammar.broadcaster
- The broadcaster.public static void delegateRefinement(Declaration declaration, Grammar grammar, Broadcaster broadcaster)
Declaration
to this class.
This is mainly used by Refine
subscription methods.
If refinement is successful then a single PropertyValue
(plus one or more PropertyValueMember
s) will be
broadcasted via the given Broadcaster
.
declaration
- The declaration.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.