Interface GrapesJsPluginRegistry

All Known Implementing Classes:
GrapesJsPluginRegistryImpl

public interface GrapesJsPluginRegistry
Registry for GrapesJsPlugins.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T extends GrapesJsPlugin>
    T
    find(String name)
    Gets plugin instance by its unique name.
    <T extends GrapesJsPlugin>
    T
    get(String name)
    Gets plugin instance by its unique name.
    <T extends GrapesJsPlugin>
    void
    register(T plugin, String name)
    Registers a plugin instance in the registry.
  • Method Details

    • get

      <T extends GrapesJsPlugin> T get(String name)
      Gets plugin instance by its unique name.
      Type Parameters:
      T - type of the plugin
      Parameters:
      name - name of the plugin
      Returns:
      plugin instance
      Throws:
      IllegalArgumentException - if no plugin with the passed name found
    • find

      @Nullable <T extends GrapesJsPlugin> T find(String name)
      Gets plugin instance by its unique name.
      Type Parameters:
      T - type of the plugin
      Parameters:
      name - name of the plugin
      Returns:
      plugin instance or null if not found
    • register

      @Nullable <T extends GrapesJsPlugin> void register(T plugin, String name)
      Registers a plugin instance in the registry.
      Type Parameters:
      T - type of the plugin
      Parameters:
      plugin - plugin to register
      name - unique registration name