Class PluginHelper
java.lang.Object
org.apache.camel.dsl.jbang.core.common.PluginHelper
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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddPlugins(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.static org.apache.camel.util.json.JsonObjectstatic voidenable(PluginType pluginType) static org.apache.camel.util.json.JsonObjectstatic voidsavePluginConfig(org.apache.camel.util.json.JsonObject plugins)
-
Field Details
-
PLUGIN_CONFIG
- See Also:
-
-
Method Details
-
addPlugins
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 tomain- 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
-