本文整理了Java中org.eclipse.osgi.service.resolver.State.getStateHelper()
方法的一些代码示例,展示了State.getStateHelper()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。State.getStateHelper()
方法的具体详情如下:
包路径:org.eclipse.osgi.service.resolver.State
类名称:State
方法名:getStateHelper
[英]Returns a state helper object. State helpers provide convenience methods for manipulating states.
A possible implementation for this method would provide the same single StateHelper instance to all clients.
[中]返回状态辅助对象。状态助手提供了操纵状态的方便方法。
此方法的一个可能实现将为所有客户端提供相同的单一StateHelper实例。
代码示例来源:origin: org.codehaus.tycho/tycho-osgi-components
public StateHelper getStateHelper()
{
return state.getStateHelper();
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools
@Override
public IApiComponent[] getDependentComponents(IApiComponent[] components) throws CoreException {
ArrayList<BundleDescription> bundles = getBundleDescriptions(components);
BundleDescription[] bundleDescriptions = getState().getStateHelper().getDependentBundles(bundles.toArray(new BundleDescription[bundles.size()]));
return getApiComponents(bundleDescriptions);
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools
@Override
public IApiComponent[] getPrerequisiteComponents(IApiComponent[] components) throws CoreException {
ArrayList<BundleDescription> bundles = getBundleDescriptions(components);
BundleDescription[] bundlesDescriptions = getState().getStateHelper().getPrerequisites(bundles.toArray(new BundleDescription[bundles.size()]));
return getApiComponents(bundlesDescriptions);
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools
/**
* Resolves the root errors for the given set of errors
*
* @param rerrors
* @param collector
* @return the resolved leaf set of problem messages
*/
private String[] resolveRootErrors(ResolverError[] rerrors) {
TreeSet<String> collector = new TreeSet<>((o1, o2) -> (o1).compareTo(o2));
ResolverError error = null;
VersionConstraint[] constraints = null;
BundleDescription[] bundle = new BundleDescription[1];
for (ResolverError rerror : rerrors) {
error = rerror;
if (error.getType() != ResolverError.MISSING_REQUIRE_BUNDLE) {
collector.add(error.toString());
}
bundle[0] = error.getBundle();
constraints = bundle[0].getContainingState().getStateHelper().getUnsatisfiedLeaves(bundle);
if (constraints.length == 0) {
collector.add(error.toString());
}
for (VersionConstraint constraint : constraints) {
collector.add(constraint.toString());
}
}
return collector.toArray(new String[collector.size()]);
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools
/**
* Returns all of the visible dependent components from the current state
*
* @param components
* @return the listing of visible dependent components to the given ones
* @throws CoreException
*/
public IApiComponent[] getVisibleDependentComponents(IApiComponent[] components) throws CoreException {
ArrayList<BundleDescription> bundles = getBundleDescriptions(components);
BundleDescription[] descs = getState().getStateHelper().getDependentBundles(bundles.toArray(new BundleDescription[bundles.size()]));
HashSet<BundleDescription> visible = new HashSet<>();
ExportPackageDescription[] packages = null;
for (BundleDescription desc : descs) {
packages = getState().getStateHelper().getVisiblePackages(desc);
for (ExportPackageDescription package1 : packages) {
if (bundles.contains(package1.getSupplier())) {
visible.add(desc);
}
}
}
return getApiComponents(visible.toArray(new BundleDescription[visible.size()]));
}
代码示例来源:origin: org.eclipse.equinox/console
imports = desc.getContainingState().getStateHelper().getVisiblePackages(desc, StateHelper.VISIBLE_INCLUDE_EE_PACKAGES | StateHelper.VISIBLE_INCLUDE_ALL_HOST_WIRES);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.pde.core
public static boolean isDiscouraged(String fullyQualifiedName, IJavaProject project, BundleDescription desc) {
// allow classes within the project itself
try {
IType type = project.findType(fullyQualifiedName.replace('$', '.'));
if (type != null && type.exists()) {
HashMap<String, IPackageFragment> map = PDEJavaHelper.getPackageFragmentsHash(project, Collections.EMPTY_LIST, false);
if (map.containsValue(type.getPackageFragment())) {
return false;
}
}
} catch (JavaModelException e) {
}
// just grab the package
int dot = fullyQualifiedName.lastIndexOf('.');
if (dot != -1) // check for the default package case
fullyQualifiedName = fullyQualifiedName.substring(0, dot);
else
fullyQualifiedName = "."; //$NON-NLS-1$
State state = desc.getContainingState();
StateHelper helper = state.getStateHelper();
ExportPackageDescription[] exports = helper.getVisiblePackages(desc);
for (int i = 0; i < exports.length; i++) {
BundleDescription exporter = exports[i].getExporter();
if (exporter == null)
continue;
if (fullyQualifiedName.equals(exports[i].getName()) && helper.getAccessCode(desc, exports[i]) == StateHelper.ACCESS_DISCOURAGED)
return true;
}
return false;
}
代码示例来源:origin: org.eclipse.tycho/tycho-core
for (DependencyEntry entry : dependencyComputer.computeDependencies(state.getStateHelper(), bundleDescription)) {
if (EquinoxResolver.SYSTEM_BUNDLE_ID == entry.desc.getBundleId()) {
if (entry.rules != null) {
strictBootClasspathAccessRules);
project.setContextValue(TychoConstants.CTX_ECLIPSE_PLUGIN_BOOTCLASSPATH_EXTRA_ACCESSRULES,
dependencyComputer.computeBootClasspathExtraAccessRules(state.getStateHelper(), bundleDescription));
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools
BundleDescription bundle = ((BundleComponent) component).getBundleDescription();
if (bundle != null) {
StateHelper helper = getState().getStateHelper();
ExportPackageDescription[] visiblePackages = helper.getVisiblePackages(bundle);
for (ExportPackageDescription pkg : visiblePackages) {
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.pde.core
VersionConstraint[] constraints = desc.getContainingState().getStateHelper().getUnsatisfiedConstraints(desc);
for (int i = 0; i < constraints.length; i++) {
if (constraints[i] instanceof ImportPackageSpecification) {
代码示例来源:origin: org.eclipse/org.eclipse.pde.core
VersionConstraint[] constraints = desc.getContainingState().getStateHelper().getUnsatisfiedConstraints(desc);
for (int i = 0; i < constraints.length; i++) {
if (constraints[i] instanceof ImportPackageSpecification) {
代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.osgi
imports = desc.getContainingState().getStateHelper().getVisiblePackages(desc, StateHelper.VISIBLE_INCLUDE_EE_PACKAGES | StateHelper.VISIBLE_INCLUDE_ALL_HOST_WIRES);
代码示例来源:origin: org.eclipse/org.eclipse.osgi
imports = desc.getContainingState().getStateHelper().getVisiblePackages(desc, StateHelper.VISIBLE_INCLUDE_EE_PACKAGES | StateHelper.VISIBLE_INCLUDE_ALL_HOST_WIRES);
内容来源于网络,如有侵权,请联系作者删除!