Package com.vaadin.hilla.parser.core
Class AbstractCompositePlugin<C extends PluginConfiguration>
java.lang.Object
com.vaadin.hilla.parser.core.AbstractPlugin<C>
com.vaadin.hilla.parser.core.AbstractCompositePlugin<C>
- All Implemented Interfaces:
Plugin
- Direct Known Subclasses:
BackbonePlugin,PluginManager
public abstract class AbstractCompositePlugin<C extends PluginConfiguration>
extends AbstractPlugin<C>
A plugin made of other plugins, run in the order they are given in: each one
scans, resolves and enters a node after the ones before it, and exits it in
the reverse order, so that the first plugin is the first to enter a node and
the last to exit it.
Creating it checks that every plugin comes after the plugins it requires
(Plugin.getRequiredPlugins()).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled on the way into a node, before the nodes below it are walked, which is where a plugin says what it knows about the node before anything below it is known.voidCalled on the way out of a node, once the nodes below it have been walked, which is where a plugin settles what depends on them.@NonNull Node<?, ?> Replaces a node the walk has found before it is walked, which is how a plugin says what a node really is: a type mapped to another one, or a node carrying more than the one found, such as its Kotlin reflection.@NonNull NodeDependenciesscan(@NonNull NodeDependencies nodeDependencies) Says what is below a node: its child nodes, walked right below it, and its related nodes, walked once below the root after everything already queued.voidsetConfiguration(PluginConfiguration configuration) voidsetParserConfig(Parser.Config parserConfig) Hands the plugin the configuration of the parser running it.Methods inherited from class com.vaadin.hilla.parser.core.AbstractPlugin
getConfiguration, getParserConfigMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.hilla.parser.core.Plugin
getRequiredPlugins
-
Constructor Details
-
AbstractCompositePlugin
-
-
Method Details
-
enter
Description copied from interface:PluginCalled on the way into a node, before the nodes below it are walked, which is where a plugin says what it knows about the node before anything below it is known. A plugin which only says which nodes there are to walk has nothing to do here. -
exit
Description copied from interface:PluginCalled on the way out of a node, once the nodes below it have been walked, which is where a plugin settles what depends on them. A composite plugin exits its plugins in the opposite order to the one it enters them in. -
resolve
Description copied from interface:PluginReplaces a node the walk has found before it is walked, which is how a plugin says what a node really is: a type mapped to another one, or a node carrying more than the one found, such as its Kotlin reflection. Called with the path of the node it is found below, before the node gets its own path, and in the order of the plugins, each one getting what the one before it returned.- Parameters:
node- the node foundparentPath- the path of the node it is found below; for a related node, the path of the root- Returns:
- the node to walk in its place, or the node itself
-
scan
Description copied from interface:PluginSays what is below a node: its child nodes, walked right below it, and its related nodes, walked once below the root after everything already queued. Called when the walk enters a node, in the order of the plugins, each one adding to what the one before it returned. A node equal to one scanned before gets the same result without being scanned again.- Parameters:
nodeDependencies- the node with what the plugins before this one found below it- Returns:
- what is below the node, with what this plugin found added
-
setConfiguration
- Specified by:
setConfigurationin interfacePlugin- Overrides:
setConfigurationin classAbstractPlugin<C extends PluginConfiguration>
-
setParserConfig
Description copied from interface:PluginHands the plugin the configuration of the parser running it.- Specified by:
setParserConfigin interfacePlugin- Overrides:
setParserConfigin classAbstractPlugin<C extends PluginConfiguration>
-