Java 类javax.annotation.processing.SupportedOptions 实例源码

项目:squidb    文件:PluginEnvironment.java   
/**
 * 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);
    }
}