/** * Add a {@link Plugin} class to the list of known plugins * * @param plugin the plugin class * @param priority the priority to give the plugin */ private void addPlugin(Class<? extends Plugin> plugin, PluginPriority priority) { switch (priority) { case LOW: lowPriorityPlugins.add(plugin); break; case HIGH: highPriorityPlugins.add(plugin); break; case NORMAL: default: normalPriorityPlugins.add(plugin); break; } SupportedOptions supportedOptionsAnnotation = plugin.getAnnotation(SupportedOptions.class); if (supportedOptionsAnnotation != null) { String[] options = supportedOptionsAnnotation.value(); Collections.addAll(pluginSupportedOptions, options); } }