本文整理汇总了Java中jdk.tools.jlink.plugin.Plugin.getName方法的典型用法代码示例。如果您正苦于以下问题:Java Plugin.getName方法的具体用法?Java Plugin.getName怎么用?Java Plugin.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jdk.tools.jlink.plugin.Plugin
的用法示例。
在下文中一共展示了Plugin.getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testOptions
import jdk.tools.jlink.plugin.Plugin; //导入方法依赖的package包/类
private static void testOptions() throws Exception {
List<Plugin> builtInPlugins = new ArrayList<>();
builtInPlugins.addAll(PluginRepository.getPlugins(ModuleLayer.boot()));
if(builtInPlugins.isEmpty()) {
throw new Exception("No builtin plugins");
}
List<String> options = new ArrayList<>();
for (Plugin p : builtInPlugins) {
if (p.getOption() == null) {
throw new Exception("Null option for " + p.getName());
}
if (options.contains(p.getName())) {
throw new Exception("Option " + p.getOption() + " used more than once");
}
options.add(p.getName());
}
}
示例2: testOptions
import jdk.tools.jlink.plugin.Plugin; //导入方法依赖的package包/类
private static void testOptions() throws Exception {
List<Plugin> builtInPlugins = new ArrayList<>();
builtInPlugins.addAll(PluginRepository.getPlugins(Layer.boot()));
if(builtInPlugins.isEmpty()) {
throw new Exception("No builtin plugins");
}
List<String> options = new ArrayList<>();
for (Plugin p : builtInPlugins) {
if (p.getOption() == null) {
throw new Exception("Null option for " + p.getName());
}
if (options.contains(p.getName())) {
throw new Exception("Option " + p.getOption() + " used more than once");
}
options.add(p.getName());
}
}
示例3: parseConfiguration
import jdk.tools.jlink.plugin.Plugin; //导入方法依赖的package包/类
public static ImagePluginStack parseConfiguration(Jlink.PluginsConfiguration pluginsConfiguration)
throws Exception {
if (pluginsConfiguration == null) {
return new ImagePluginStack();
}
Map<Category, List<Plugin>> plugins = new LinkedHashMap<>();
for (Category cat : CATEGORIES_ORDER) {
plugins.put(cat, new ArrayList<>());
}
List<String> seen = new ArrayList<>();
// split into categories and check for plugin with same name.
for (Plugin plug : pluginsConfiguration.getPlugins()) {
if (seen.contains(plug.getName())) {
throw new Exception("Plugin " + plug.getName()
+ " added more than once to stack ");
}
seen.add(plug.getName());
Category category = plug.getType();
if (category == null) {
throw new PluginException("Invalid category for "
+ plug.getName());
}
List<Plugin> lst = plugins.get(category);
lst.add(plug);
}
List<Plugin> orderedPlugins = new ArrayList<>();
plugins.entrySet().stream().forEach((entry) -> {
orderedPlugins.addAll(entry.getValue());
});
Plugin lastSorter = null;
for (Plugin plugin : orderedPlugins) {
if (plugin.getName().equals(pluginsConfiguration.getLastSorterPluginName())) {
lastSorter = plugin;
break;
}
}
if (pluginsConfiguration.getLastSorterPluginName() != null && lastSorter == null) {
throw new IOException("Unknown last plugin "
+ pluginsConfiguration.getLastSorterPluginName());
}
ImageBuilder builder = pluginsConfiguration.getImageBuilder();
if (builder == null) {
// This should be the case for jimage only creation or post-install.
builder = new ImageBuilder() {
@Override
public DataOutputStream getJImageOutputStream() {
throw new PluginException("No directory setup to store files");
}
@Override
public ExecutableImage getExecutableImage() {
throw new PluginException("No directory setup to store files");
}
@Override
public void storeFiles(ResourcePool files) {
throw new PluginException("No directory setup to store files");
}
};
}
return new ImagePluginStack(builder, orderedPlugins, lastSorter);
}