...
Code Block |
---|
@Beta public interface PluginContext { /** * Gets the {@link PluginProperties} associated with the given plugin id. * * @param pluginId the unique identifier provide when declaring plugin usage in the program. * @return the {@link PluginProperties}. * @throws IllegalArgumentException if pluginId is not found * @throws UnsupportedOperationException if the program does not support plugin */ PluginProperties getPluginProperties(String pluginId); /** * Creates a new *instance @paramof pluginId the unique identifier provide when declaring plugin usage in the program. * @param pluginPropertiesa plugin. The instance returned will have the {@link PluginPropertiesPluginConfig} setup forwith * @throws{@link IllegalArgumentExceptionPluginProperties} ifprovided pluginIdat isthe not found * @throws UnsupportedOperationException if the program does not support plugintime when the */ {@link void setPluginProperties(String pluginIdPluginConfigurer#usePlugin(String, String, String, PluginProperties pluginProperties);} was called during /**the * Loadsprogram and returns a plugin class as specified by the given plugin idconfiguration time. * * @param pluginId the unique identifier provide when declaring plugin usage in the program. * @param <T> the class type of the plugin * @return the resulting plugin {@link Class}.A new instance of the plugin being specified by the arguments * * @throws InstantiationException if failed create a new instance * @throws IllegalArgumentException if pluginId is not found * @throws UnsupportedOperationException if the program does not support plugin */ <T> Class<T>T loadPluginClassnewPluginInstance(String pluginId) throws InstantiationException; /** * Creates a new instance of a plugin using properties provided. The instance returned will have the {@link PluginConfig} setup with * {@link PluginProperties} provided at the time when the * {@link PluginConfigurer#usePlugin(String, String, String, PluginProperties)} was called during the * program configuration time. * * @param pluginId the unique identifier provide when declaring plugin usage in the program. * @param properties the properties needs to be used to create plugin * @param <T> the class type of the plugin * @return A new instance of the plugin being specified by the arguments * * @throws InstantiationException if failed create a new instance * @throws IllegalArgumentException if pluginId is not found * @throws UnsupportedOperationException if the program does not support plugin */ <T> T newPluginInstance(String pluginId, Map<String,String> properties) throws InstantiationException; } |
...