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


Java Plugin.getByPluginId方法代码示例

本文整理汇总了Java中edu.umd.cs.findbugs.Plugin.getByPluginId方法的典型用法代码示例。如果您正苦于以下问题:Java Plugin.getByPluginId方法的具体用法?Java Plugin.getByPluginId怎么用?Java Plugin.getByPluginId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在edu.umd.cs.findbugs.Plugin的用法示例。


在下文中一共展示了Plugin.getByPluginId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validate

import edu.umd.cs.findbugs.Plugin; //导入方法依赖的package包/类
/**
 *
 * @param path
 *            non null, full abstract path in the local file system
 * @return {@link Status#OK_STATUS} in case that given path might be a valid
 *         FindBugs detector package (jar file containing bugrank.txt,
 *         findbugs.xml, messages.xml and at least one class file). Returns
 *         error status in case anything goes wrong or file at given path is
 *         not considered as a valid plugin.
 */
@Nonnull
public ValidationStatus validate(String path) {
    File file = new File(path);
    Summary sum = null;
    try {
        sum = PluginLoader.validate(file);
    } catch (IllegalArgumentException e) {
        if(FindbugsPlugin.getDefault().isDebugging()) {
            e.printStackTrace();
        }
        return new ValidationStatus(IStatus.ERROR,
                "Invalid FindBugs plugin archive: " + e.getMessage(), sum, e);
    }
    Plugin loadedPlugin = Plugin.getByPluginId(sum.id);
    URI uri = file.toURI();
    if(loadedPlugin != null && !uri.equals(loadedPlugin.getPluginLoader().getURI())
            && loadedPlugin.isGloballyEnabled()) {
        return new ValidationStatus(IStatus.ERROR, "Duplicated FindBugs plugin: " + sum.id + ", already loaded from: "
                + loadedPlugin.getPluginLoader().getURI(), sum, null);
    }
    return new ValidationStatus(IStatus.OK, Status.OK_STATUS.getMessage(), sum, null);
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:33,代码来源:DetectorValidator.java

示例2: enablePlugins

import edu.umd.cs.findbugs.Plugin; //导入方法依赖的package包/类
private static void enablePlugins(Iterable<String> plugins, boolean enabled) {
    for (String pid : plugins) {
        Plugin plugin = Plugin.getByPluginId(pid);
        if (plugin != null) {
            if (plugin.cannotDisable())
                JOptionPane.showMessageDialog(null,
                        "Cannot disable plugin: " + plugin.getPluginId() + "\n" + plugin.getShortDescription(),
                        "Cannot disable plugin", JOptionPane.ERROR_MESSAGE);
            else
                plugin.setGloballyEnabled(enabled);
        }
    }
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:14,代码来源:Driver.java

示例3: enablePlugins

import edu.umd.cs.findbugs.Plugin; //导入方法依赖的package包/类
/**
 * Enables or disables a FindBugs plugin.
 * 
 * @param plugins 
 * @param enabled
 */
protected void enablePlugins(String pluginId, boolean enabled) {
    Plugin plugin = Plugin.getByPluginId(pluginId);
    if (plugin != null) {
        if (!enabled && plugin.cannotDisable()) {
            fail("Cannot disable plugin: " + plugin.getPluginId() + '\n' + plugin.getShortDescription());
        } else {
            plugin.setGloballyEnabled(enabled);
        }
    }
}
 
开发者ID:kjlubick,项目名称:fb-contrib-eclipse-quick-fixes,代码行数:17,代码来源:TestHarness.java

示例4: checkFBContribInstalled

import edu.umd.cs.findbugs.Plugin; //导入方法依赖的package包/类
private static void checkFBContribInstalled() {
    fb_contribInstalled = Plugin.getByPluginId("com.mebigfatguy.fbcontrib") != null;
    System.out.printf("fb-contrib (com.mebigfatguy.fbcontrib) is %sinstalled%n", fb_contribInstalled ? "": "not ");
}
 
开发者ID:kjlubick,项目名称:fb-contrib-eclipse-quick-fixes,代码行数:5,代码来源:TestHarness.java

示例5: checkFindSecurityBugsInstalled

import edu.umd.cs.findbugs.Plugin; //导入方法依赖的package包/类
private static void checkFindSecurityBugsInstalled() {
    findSecurityBugsInstalled = Plugin.getByPluginId("com.h3xstream.findsecbugs") != null;
    System.out.printf("Find Security Bugs (com.h3xstream.findsecbugs) is %sinstalled%n", findSecurityBugsInstalled ? "": "not ");
}
 
开发者ID:kjlubick,项目名称:fb-contrib-eclipse-quick-fixes,代码行数:5,代码来源:TestHarness.java


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