当前位置: 首页>>代码示例>>Java>>正文


Java Plugin.getType方法代码示例

本文整理汇总了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());
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:32,代码来源:TaskHelper.java

示例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;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:11,代码来源:Utils.java

示例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;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:11,代码来源:Utils.java

示例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;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:11,代码来源:Utils.java

示例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);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:67,代码来源:ImagePluginConfiguration.java


注:本文中的jdk.tools.jlink.plugin.Plugin.getType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。