Class PluginHelper

java.lang.Object
org.apache.camel.dsl.jbang.core.common.PluginHelper

public final class PluginHelper extends Object
Helper for command line plugins that add sub-commands and functionality when enabled by the user. Loads and saves plugin configuration from/to the user home directory.
  • Field Details

  • Method Details

    • addPlugins

      public static void addPlugins(picocli.CommandLine commandLine, CamelJBangMain main, String... args)
      Loads the plugin Json configuration from the user home and goes through all configured plugins adding the plugin commands to the current command line. Tries to resolve each plugin from the classpath with the factory finder pattern. If present the plugin is called to customize the command line to add all sub-commands of the plugin.
      Parameters:
      commandLine - the command line to add commands to
      main - the current Camel JBang main
    • getOrCreatePluginConfig

      public static org.apache.camel.util.json.JsonObject getOrCreatePluginConfig()
    • createPluginConfig

      public static org.apache.camel.util.json.JsonObject createPluginConfig()
    • savePluginConfig

      public static void savePluginConfig(org.apache.camel.util.json.JsonObject plugins)
    • enable

      public static void enable(PluginType pluginType)