• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Plugin类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: main

import edu.umd.cs.findbugs.Plugin; //导入依赖的package包/类
public static void main(String[] argv) throws Exception {
	edu.umd.cs.findbugs.DetectorFactoryCollection detectorFactoryCollection =
		edu.umd.cs.findbugs.DetectorFactoryCollection.instance();

	ExecutionPlan execPlan = new ExecutionPlan();

	for (int i = 0; i < argv.length; ++i) {
		String pluginId = argv[i];
		Plugin plugin = detectorFactoryCollection.getPluginById(pluginId);
		if (plugin != null)
			execPlan.addPlugin(plugin);
	}

	execPlan.build();

	System.out.println(execPlan.passList.size() + " passes in plan");
	execPlan.print();
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:19,代码来源:ExecutionPlan.java


示例2: getRedirectURL

import edu.umd.cs.findbugs.Plugin; //导入依赖的package包/类
/**
 * @param force
 * @return
 */
public @CheckForNull URI getRedirectURL(final boolean force) {
    String redirect = dfc.getGlobalOption(KEY_REDIRECT_ALL_UPDATE_CHECKS);
    String sysprop = System.getProperty("findbugs.redirectUpdateChecks");
    if (sysprop != null)
        redirect = sysprop;
    Plugin setter = dfc.getGlobalOptionSetter(KEY_REDIRECT_ALL_UPDATE_CHECKS);
    URI redirectUri = null;
    String pluginName = setter == null ? "<unknown plugin>" : setter.getShortDescription();
    if (redirect != null && !redirect.trim().equals("")) {
        try {
            redirectUri = new URI(redirect);
            logError(Level.INFO, "Redirecting all plugin update checks to " + redirectUri + " (" + pluginName + ")");
            
        } catch (URISyntaxException e) {
            String error = "Invalid update check redirect URI in " + pluginName + ": " + redirect;
            logError(Level.SEVERE, error);
            dfc.pluginUpdateCheckComplete(pluginUpdates, force);
            throw new IllegalStateException(error);
        }
    }
    return redirectUri;
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:27,代码来源:UpdateChecker.java


示例3: getPluginThatDisabledUpdateChecks

import edu.umd.cs.findbugs.Plugin; //导入依赖的package包/类
public String getPluginThatDisabledUpdateChecks() {
    String disable = dfc.getGlobalOption(KEY_DISABLE_ALL_UPDATE_CHECKS);
    Plugin setter = dfc.getGlobalOptionSetter(KEY_DISABLE_ALL_UPDATE_CHECKS);
    String pluginName = setter == null ? "<unknown plugin>" : setter.getShortDescription();
    String disablingPlugin = null;
    if ("true".equalsIgnoreCase(disable)) {
        logError(Level.INFO, "Skipping update checks due to " + KEY_DISABLE_ALL_UPDATE_CHECKS + "=true set by "
                + pluginName);
        disablingPlugin = pluginName;
    } else if (disable != null && !"false".equalsIgnoreCase(disable)) {
        String error = "Unknown value '" + disable + "' for " + KEY_DISABLE_ALL_UPDATE_CHECKS + " in " + pluginName;
        logError(Level.SEVERE, error);
        throw new IllegalStateException(error);
    }
    return disablingPlugin;
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:17,代码来源:UpdateChecker.java


示例4: actuallyCheckforUpdates

import edu.umd.cs.findbugs.Plugin; //导入依赖的package包/类
/** protected for testing */
    protected void actuallyCheckforUpdates(URI url, Collection<Plugin> plugins, String entryPoint) throws IOException {
        LOGGER.fine("Checking for updates at " + url + " for " + getPluginNames(plugins));
        HttpURLConnection conn = (HttpURLConnection) url.toURL().openConnection();
        conn.setDoInput(true);
        conn.setDoOutput(true);
        conn.setRequestMethod("POST");
        conn.connect();
        OutputStream out = conn.getOutputStream();
        writeXml(out, plugins, entryPoint);
        // for debugging:
//        writeXml(System.out, plugins, entryPoint);
        int responseCode = conn.getResponseCode();
        if (responseCode != 200) {
            logError(SystemProperties.ASSERTIONS_ENABLED ? Level.WARNING : Level.FINE,
                    "Error checking for updates at " + url + ": "
                    + responseCode + " - " + conn.getResponseMessage());
        } else {
            parseUpdateXml(url, plugins, conn.getInputStream());
        }
        conn.disconnect();
    }
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:23,代码来源:UpdateChecker.java


示例5: addPlugin

import edu.umd.cs.findbugs.Plugin; //导入依赖的package包/类
/**
 * Add a Plugin whose Detectors should be added to the execution plan.
 */
public void addPlugin(Plugin plugin) throws OrderingConstraintException {
    if (DEBUG) {
        System.out.println("Adding plugin " + plugin.getPluginId() + " to execution plan");
    }

    pluginList.add(plugin);

    // Add ordering constraints
    copyTo(plugin.interPassConstraintIterator(), interPassConstraintList);
    copyTo(plugin.intraPassConstraintIterator(), intraPassConstraintList);

    // Add detector factories
    for (DetectorFactory factory : plugin.getDetectorFactories()) {
        if (DEBUG) {
            System.out.println("  Detector factory " + factory.getShortName());
        }
        if (factoryMap.put(factory.getFullName(), factory) != null) {
            throw new OrderingConstraintException("Detector " + factory.getFullName() + " is defined by more than one plugin");
        }
    }
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:25,代码来源:ExecutionPlan.java


示例6: main

import edu.umd.cs.findbugs.Plugin; //导入依赖的package包/类
public static void main(String[] argv) throws Exception {
    DetectorFactoryCollection detectorFactoryCollection = DetectorFactoryCollection.instance();

    ExecutionPlan execPlan = new ExecutionPlan();

    for (String pluginId : argv) {
        Plugin plugin = detectorFactoryCollection.getPluginById(pluginId);
        if (plugin != null) {
            execPlan.addPlugin(plugin);
        }
    }

    execPlan.build();

    System.out.println(execPlan.getNumPasses() + " passes in plan");
    execPlan.print();
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:18,代码来源:ExecutionPlan.java


示例7: getAdapter

import edu.umd.cs.findbugs.Plugin; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public Object getAdapter(Object adaptableObject, Class adapterType) {
    if (adapterType == IPropertySheetPage.class) {
        if (adaptableObject instanceof BugExplorerView || adaptableObject instanceof JavaEditor
                || adaptableObject instanceof AbstractFindbugsView) {
            return new BugPropertySheetPage();
        }
    }
    if (adapterType == IPropertySource.class) {
        if (adaptableObject instanceof BugPattern || adaptableObject instanceof BugInstance
                || adaptableObject instanceof DetectorFactory || adaptableObject instanceof Plugin
                || adaptableObject instanceof BugInstance.XmlProps || adaptableObject instanceof BugGroup
                || adaptableObject instanceof BugAnnotation) {
            return new PropertySource(adaptableObject);
        }
        IMarker marker = Util.getAdapter(IMarker.class, adaptableObject);
        if (!MarkerUtil.isFindBugsMarker(marker)) {
            return null;
        }
        return new MarkerPropertySource(marker);
    }
    return null;
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:24,代码来源:PropertyPageAdapterFactory.java


示例8: addDetectorInfo

import edu.umd.cs.findbugs.Plugin; //导入依赖的package包/类
private void addDetectorInfo(StringBuilder text) {
    DetectorFactory factory = bug.getDetectorFactory();
    if (factory != null) {
        Plugin plugin = factory.getPlugin();
        if (!plugin.isCorePlugin()) {
            text.append("<p><small><i>Reported by: ").append(factory.getFullName());
            text.append("<br>Contributed by plugin: ").append(plugin.getPluginId());
            text.append("<br>Provider: ").append(plugin.getProvider());
            String website = plugin.getWebsite();
            if (website != null && website.length() > 0) {
                text.append(" (<a href=\"").append(website).append("\">");
                text.append(website).append("</a>)");
            }
            text.append("</i></small>");
        }
    }
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:18,代码来源:BugInfoView.java


示例9: 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


示例10: buildFactoryMap

import edu.umd.cs.findbugs.Plugin; //导入依赖的package包/类
private Map<String, DetectorFactory> buildFactoryMap() {
	Map<String, DetectorFactory> factoryMap = new HashMap<String, DetectorFactory>();

	for (Iterator<Plugin> j = pluginList.iterator(); j.hasNext(); ) {
		Plugin plugin = j.next();
		for (Iterator<DetectorFactory> i = plugin.detectorFactoryIterator(); i.hasNext(); ) {
			DetectorFactory factory = i.next();
			factoryMap.put(factory.getFullName(), factory);
		}
	}

	return factoryMap;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:14,代码来源:ExecutionPlan.java


示例11: startUpdateCheckThread

import edu.umd.cs.findbugs.Plugin; //导入依赖的package包/类
private void startUpdateCheckThread(final URI url, final Collection<Plugin> plugins, final CountDownLatch latch) {
    if (url == null) {
        logError(Level.INFO, "Not checking for plugin updates w/ blank URL: " + getPluginNames(plugins));
        return;
    }
    final String entryPoint = getEntryPoint();
    if ((entryPoint.contains("edu.umd.cs.findbugs.FindBugsTestCase") 
            || entryPoint.contains("edu.umd.cs.findbugs.cloud.appEngine.AbstractWebCloudTest"))
            && (url.getScheme().equals("http") || url.getScheme().equals("https"))) {
        LOGGER.fine("Skipping update check because we're running in FindBugsTestCase and using "
                + url.getScheme());
        return;
    }
    Util.runInDameonThread(new Runnable() {
        public void run() {
            try {
                actuallyCheckforUpdates(url, plugins, entryPoint);
            } catch (Exception e) {
                if (e instanceof IllegalStateException && e.getMessage().contains("Shutdown in progress"))
                    return;
                logError(e, "Error doing update check at " + url);
            } finally {
                latch.countDown();
            }
        }
    }, "Check for updates");
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:28,代码来源:UpdateChecker.java


示例12: parseUpdateXml

import edu.umd.cs.findbugs.Plugin; //导入依赖的package包/类
@SuppressWarnings({ "unchecked" })
    void parseUpdateXml(URI url, Collection<Plugin> plugins, @WillClose
    InputStream inputStream) {
        try {
            Document doc = new SAXReader().read(inputStream);
//            StringWriter stringWriter = new StringWriter();
//            XMLWriter xmlWriter = new XMLWriter(stringWriter);
//            xmlWriter.write(doc);
//            xmlWriter.close();
//            System.out.println("UPDATE RESPONSE: " + stringWriter.toString());
            List<Element> pluginEls =  XMLUtil.selectNodes(doc, "fb-plugin-updates/plugin");
            Map<String, Plugin> map = new HashMap<String, Plugin>();
            for (Plugin p : plugins)
                map.put(p.getPluginId(), p);
            for (Element pluginEl : pluginEls) {
                String id = pluginEl.attributeValue("id");
                Plugin plugin = map.get(id);
                if (plugin != null) {
                    checkPlugin(pluginEl, plugin);
                }

            }
        } catch (Exception e) {
            logError(e, "Could not parse plugin version update for " + url);
        } finally {
            Util.closeSilently(inputStream);
        }
    }
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:29,代码来源:UpdateChecker.java


示例13: checkPluginRelease

import edu.umd.cs.findbugs.Plugin; //导入依赖的package包/类
private void checkPluginRelease(Plugin plugin, Element maxEl) {
    @CheckForNull Date updateDate = parseReleaseDate(maxEl);
    @CheckForNull Date installedDate = plugin.getReleaseDate();
    if (updateDate != null && installedDate != null && updateDate.before(installedDate))
        return;
    String version = maxEl.attributeValue("version");
    if (version.equals(plugin.getVersion()))
        return;

    String url = maxEl.attributeValue("url");
    String message = maxEl.element("message").getTextTrim();

    pluginUpdates.add(new PluginUpdate(plugin, version, updateDate, url, message));
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:15,代码来源:UpdateChecker.java


示例14: getPluginNames

import edu.umd.cs.findbugs.Plugin; //导入依赖的package包/类
private String getPluginNames(Collection<Plugin> plugins) {
    String text = "";
    boolean first = true;
    for (Plugin plugin : plugins) {
        text = (first ? "" : ", ") + plugin.getShortDescription();
        first = false;
    }
    return text;
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:10,代码来源:UpdateChecker.java


示例15: PluginUpdate

import edu.umd.cs.findbugs.Plugin; //导入依赖的package包/类
private PluginUpdate(Plugin plugin, String version, @CheckForNull  Date date, @CheckForNull String url, @Nonnull String message) {
    this.plugin = plugin;
    this.version = version;
    this.date = date;
    this.url = url;
    this.message = message;
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:8,代码来源:UpdateChecker.java


示例16: enableAllDetectors

import edu.umd.cs.findbugs.Plugin; //导入依赖的package包/类
/**
 * Enable or disable all known Detectors.
 *
 * @param enable
 *            true if all detectors should be enabled, false if they should
 *            all be disabled
 */
public void enableAllDetectors(boolean enable) {
    detectorEnablementMap.clear();

    Collection<Plugin> allPlugins = Plugin.getAllPlugins();
    for (Plugin plugin : allPlugins) {
        for (DetectorFactory factory : plugin.getDetectorFactories()) {
            detectorEnablementMap.put(factory.getShortName(), enable);
        }
    }
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:18,代码来源:UserPreferences.java


示例17: setUp

import edu.umd.cs.findbugs.Plugin; //导入依赖的package包/类
protected void setUp() throws Exception {
    updateCollector = new ArrayList<UpdateChecker.PluginUpdate>();
    errors = new StringBuilder();
    latch = new CountDownLatch(1);
    checked = new HashMap<String, Collection<Plugin>>();
    globalOptions = new HashMap<String, String>();
    uploadedXml = null;
    checker = new UpdateChecker(new TestingUpdateCheckCallback(latch)) {
        @Override
        protected void actuallyCheckforUpdates(URI url, Collection<Plugin> plugins, String entryPoint)
                throws IOException {
            String urlStr = url.toString();
            assertFalse(checked.containsKey(urlStr));
            checked.put(urlStr, plugins);
            ByteArrayInputStream stream = new ByteArrayInputStream(responseXml.getBytes("UTF-8"));
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            writeXml(out, plugins, "x.y.z");
            uploadedXml = new String(out.toByteArray(), "UTF-8");
            parseUpdateXml(url, plugins, stream);
        }

        @Override
        protected void logError(Exception e, String msg) {
            errors.append(msg).append("\n");
            System.err.println(msg);
            e.printStackTrace();
        }

        @Override
        protected void logError(Level level, String msg) {
            errors.append(msg).append("\n");
            System.err.println(msg);
        }
    };
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:36,代码来源:UpdateCheckerTest.java


示例18: main

import edu.umd.cs.findbugs.Plugin; //导入依赖的package包/类
public static void main(String args[]) {
    FindBugs.setNoAnalysis();
    DetectorFactoryCollection dfc = DetectorFactoryCollection.instance();
    for(Plugin p : dfc.plugins()) {
        System.out.println(p.getPluginId());
        System.out.println(p.getReleaseDate());
        System.out.println(p.getVersion());
        System.out.println();
        
    }
    
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:13,代码来源:GenerateUpdateXml.java


示例19: 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


示例20: handleWindowClose

import edu.umd.cs.findbugs.Plugin; //导入依赖的package包/类
private void handleWindowClose() {
    TreeModel bt = (MainFrame.getInstance().getTree().getModel());
    if (bt instanceof BugTreeModel)
        ((BugTreeModel) bt).checkSorter();
    Project project = getCurrentProject();

    boolean changed = pluginsAdded;
    pluginsAdded = false;
    List<String> enabledPlugins = new ArrayList<String>();
    List<String> disabledPlugins = new ArrayList<String>();
    for (Map.Entry<Plugin, EnabledSettings> entry : pluginEnabledStatus.entrySet()) {
        Plugin plugin = entry.getKey();
        EnabledSettings enabled = entry.getValue();
        if (project != null) {
            Boolean newSetting = enabled.project;
            Boolean existingSetting = project.getPluginStatus(plugin);
            if (existingSetting != newSetting && (newSetting == null || !newSetting.equals(existingSetting))) {
                project.setPluginStatusTrinary(plugin.getPluginId(), newSetting);
                changed = true;
            }
        }
        if (enabled.global)
            enabledPlugins.add(plugin.getPluginId());
        else
            disabledPlugins.add(plugin.getPluginId());
        if (plugin.isGloballyEnabled() != enabled.global) {
            plugin.setGloballyEnabled(enabled.global);
            changed = true;
        }
    }

    if (changed && project != null) {
        MainFrame.getInstance().updateBugTree();
        MainFrame.getInstance().setProjectChanged(true);
    }
    if (project == null) {
        GUISaveState.getInstance().setPluginsEnabled(enabledPlugins, disabledPlugins);
        GUISaveState.getInstance().save();
    }
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:41,代码来源:PreferencesFrame.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HoloCircularProgressBar类代码示例发布时间:2022-05-22
下一篇:
Java SharedTicketInfo类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap