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
    Modifier
    Constructor
    Description
    protected
    AbstractCompositePlugin(@NonNull Plugin... plugins)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    enter(NodePath<?> nodePath)
    Called 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.
    void
    exit(NodePath<?> nodePath)
    Called 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<?,?>
    resolve(@NonNull Node<?,?> node, @NonNull NodePath<?> parentPath)
    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.
    scan(@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.
    void
     
    void
    Hands the plugin the configuration of the parser running it.

    Methods inherited from class com.vaadin.hilla.parser.core.AbstractPlugin

    getConfiguration, getParserConfig

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.hilla.parser.core.Plugin

    getRequiredPlugins
  • Constructor Details

    • AbstractCompositePlugin

      protected AbstractCompositePlugin(@NonNull Plugin... plugins)
  • Method Details

    • enter

      public void enter(NodePath<?> nodePath)
      Description copied from interface: Plugin
      Called 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

      public void exit(NodePath<?> nodePath)
      Description copied from interface: Plugin
      Called 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

      public @NonNull Node<?,?> resolve(@NonNull Node<?,?> node, @NonNull NodePath<?> parentPath)
      Description copied from interface: Plugin
      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. 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 found
      parentPath - 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

      public @NonNull NodeDependencies scan(@NonNull NodeDependencies nodeDependencies)
      Description copied from interface: Plugin
      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. 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

      public void setConfiguration(PluginConfiguration configuration)
      Specified by:
      setConfiguration in interface Plugin
      Overrides:
      setConfiguration in class AbstractPlugin<C extends PluginConfiguration>
    • setParserConfig

      public void setParserConfig(Parser.Config parserConfig)
      Description copied from interface: Plugin
      Hands the plugin the configuration of the parser running it.
      Specified by:
      setParserConfig in interface Plugin
      Overrides:
      setParserConfig in class AbstractPlugin<C extends PluginConfiguration>