org.eclipse.osgi.service.resolver.State.getSystemPackages()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(156)

本文整理了Java中org.eclipse.osgi.service.resolver.State.getSystemPackages()方法的一些代码示例,展示了State.getSystemPackages()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。State.getSystemPackages()方法的具体详情如下:
包路径:org.eclipse.osgi.service.resolver.State
类名称:State
方法名:getSystemPackages

State.getSystemPackages介绍

[英]Returns the list of system packages which are exported by the system bundle. The list of system packages is set by the org.osgi.framework.system.packages value in the platform properties for this state.
[中]返回系统包导出的系统包列表。系统包列表由组织设置。奥斯基。框架系统在该状态的平台属性中包含值。

代码示例

代码示例来源:origin: org.eclipse/org.eclipse.osgi

public ExportPackageDescription[] getSystemPackages() {
  return target.getSystemPackages();
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.osgi

public ExportPackageDescription[] getSystemPackages() {
  return target.getSystemPackages();
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.osgi.compatibility.state

public ExportPackageDescription[] getSystemPackages() {
  return platformAdmin.getSystemState().getSystemPackages();
}

代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.osgi.compatibility.state

public ExportPackageDescription[] getSystemPackages() {
  return platformAdmin.getSystemState().getSystemPackages();
}

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools

/**
 * Returns whether the specified package is supplied by the system library.
 *
 * @param packageName package name
 * @return whether the specified package is supplied by the system library
 */
private boolean isSystemPackage(String packageName) {
  if (packageName.startsWith("java.")) { //$NON-NLS-1$
    return true;
  }
  if (fSystemPackageNames == null) {
    ExportPackageDescription[] systemPackages = getState().getSystemPackages();
    fSystemPackageNames = new HashSet<>(systemPackages.length);
    for (ExportPackageDescription systemPackage : systemPackages) {
      fSystemPackageNames.add(systemPackage.getName());
    }
  }
  return fSystemPackageNames.contains(packageName);
}

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui

private static Map<String, ExportPackageDescription> getValidPackages(String pkgName, String qualifiedTypeToImport) {
  ExportPackageDescription[] knownPackages = PDECore.getDefault().getModelManager().getState().getState().getExportedPackages();
  Map<String, ExportPackageDescription> validPackages = new HashMap<>();
  for (ExportPackageDescription knownPackage : knownPackages) {
    if (knownPackage.getName().equals(pkgName)) {
      validPackages.put(knownPackage.getName(), knownPackage);
    }
  }
  // remove system packages if they happen to be included. Adding a system package won't resolve anything, since package package already comes from JRE
  if (!validPackages.isEmpty()) {
    knownPackages = PDECore.getDefault().getModelManager().getState().getState().getSystemPackages();
    for (ExportPackageDescription knownPackage : knownPackages) {
      validPackages.remove(knownPackage.getName());
    }
  }
  Map<String, ExportPackageDescription> packages = new HashMap<>();
  for (ExportPackageDescription exportPackageDescription : validPackages.values()) {
    packages.put(qualifiedTypeToImport, exportPackageDescription);
  }
  return packages;
}

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui

ExportPackageDescription[] systemPackages = PDECore.getDefault().getModelManager().getState().getState().getSystemPackages();
for (ExportPackageDescription systemPackage : systemPackages) {
  packages.remove(systemPackage.getName());

相关文章