本文整理汇总了Java中jdk.tools.jlink.plugin.Plugin.getType方法的典型用法代码示例。如果您正苦于以下问题:Java Plugin.getType方法的具体用法?Java Plugin.getType怎么用?Java Plugin.getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jdk.tools.jlink.plugin.Plugin
的用法示例。
在下文中一共展示了Plugin.getType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showPlugin
import jdk.tools.jlink.plugin.Plugin; //导入方法依赖的package包/类
private void showPlugin(Plugin plugin, PrintWriter log) {
if (showsPlugin(plugin)) {
log.println("\n" + bundleHelper.getMessage("main.plugin.name")
+ ": " + plugin.getName());
// print verbose details for non-builtin plugins
if (!Utils.isBuiltin(plugin)) {
log.println(bundleHelper.getMessage("main.plugin.class")
+ ": " + plugin.getClass().getName());
log.println(bundleHelper.getMessage("main.plugin.module")
+ ": " + plugin.getClass().getModule().getName());
Category category = plugin.getType();
log.println(bundleHelper.getMessage("main.plugin.category")
+ ": " + category.getName());
log.println(bundleHelper.getMessage("main.plugin.state")
+ ": " + plugin.getStateDescription());
}
String option = plugin.getOption();
if (option != null) {
log.println(bundleHelper.getMessage("main.plugin.option")
+ ": --" + plugin.getOption()
+ (plugin.hasArguments()? ("=" + plugin.getArgumentsDescription()) : ""));
}
// description can be long spanning more than one line and so
// print a newline after description label.
log.println(bundleHelper.getMessage("main.plugin.description")
+ ": " + plugin.getDescription());
}
}
示例2: isPostProcessor
import jdk.tools.jlink.plugin.Plugin; //导入方法依赖的package包/类
public static boolean isPostProcessor(Plugin prov) {
if (prov.getType() != null) {
for (Plugin.Category pt : prov.getType()) {
if (pt instanceof Plugin.Category) {
return isPostProcessor(pt);
}
}
}
return false;
}
示例3: isPreProcessor
import jdk.tools.jlink.plugin.Plugin; //导入方法依赖的package包/类
public static boolean isPreProcessor(Plugin prov) {
if (prov.getType() != null) {
for (Plugin.Category pt : prov.getType()) {
if (pt instanceof Plugin.Category) {
return isPreProcessor(pt);
}
}
}
return false;
}
示例4: getCategory
import jdk.tools.jlink.plugin.Plugin; //导入方法依赖的package包/类
public static Plugin.Category getCategory(Plugin provider) {
if (provider.getType() != null) {
for (Plugin.Category t : provider.getType()) {
if (t instanceof Plugin.Category) {
return t;
}
}
}
return null;
}
示例5: 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);
}