本文整理匯總了Java中javax.annotation.processing.SupportedOptions類的典型用法代碼示例。如果您正苦於以下問題:Java SupportedOptions類的具體用法?Java SupportedOptions怎麽用?Java SupportedOptions使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SupportedOptions類屬於javax.annotation.processing包,在下文中一共展示了SupportedOptions類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addPlugin
import javax.annotation.processing.SupportedOptions; //導入依賴的package包/類
/**
* 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);
}
}