IPluginPrerequisite
are directed to the headers associated with the relevant bundle.
In particular, the Require-Bundle
header contains all available information
about the prerequisites of a plug-in. Having retrieved the header, the ManifestElement
helper class can be used to parse the value and discover the individual
prerequisite plug-ins. The various header attributes are defined in Constants
.
For example,
String header = bundle.getHeaders().get(Constants.REQUIRE_BUNDLE); ManifestElement[] elements = ManifestElement.parseHeader( Constants.REQUIRE_BUNDLE, header); if (elements == null) return; elements[0].getValue(); // the prerequisite plug-in id elements[0].getAttribute(Constants.BUNDLE_VERSION_ATTRIBUTE); // the prerequisite plug-in version ...
See IPluginDescriptor
for information on the relationship between plug-in
descriptors and bundles.
This interface must only be used by plug-ins which explicitly require the org.eclipse.core.runtime.compatibility plug-in.
@Deprecated public interface IPluginPrerequisite
IPluginDescriptor.getPluginPrerequisites()
Modifier and Type | Method and Description |
---|---|
PluginVersionIdentifier |
getResolvedVersionIdentifier()
Deprecated.
Callers of this method should interrogate the current
State
of the platform. For example,
State state = Platform.getPlatformAdmin().getState(); BundleDescription bundle = state.getBundle("my plug-in id", my plug-in version); BundleSpecification spec = bundle.getRequiredBundle("required plug-in id"); BundleDescription prereq = spec.getSupplier(); |
String |
getUniqueIdentifier()
Deprecated.
Given a manifest element equivalent of a plug-in
prerequisite (see the class comment), this method is replaced by:
element.getValue(); |
PluginVersionIdentifier |
getVersionIdentifier()
Deprecated.
Callers of this method should interrogate the current
State
of the platform. For example,
State state = Platform.getPlatformAdmin().getState(); BundleDescription bundle = state.getBundle("my plug-in id", my plug-in version); BundleSpecification spec = bundle.getRequiredBundle("required plug-in id"); Version reqMinVersion = spec.getVersionRange().getMinimum(); |
boolean |
isExported()
Deprecated.
Given a manifest element equivalent of a plug-in
prerequisite (see the class comment), this method is replaced by:
element.getAttribute(Constants.REPROVIDE_ATTRIBUTE); |
boolean |
isMatchedAsCompatible()
Deprecated.
Callers of this method should interrogate the current
State
of the platform. For example,
State state = Platform.getPlatformAdmin().getState(); BundleDescription bundle = state.getBundle("my plug-in id", my plug-in version); BundleSpecification spec = bundle.getRequiredBundle("required plug-in id"); VersionRange versionRange = spec.getVersionRange(); if (versionRange == null || versionRange.getMinimum() == null) return false; Version minimum = versionRange.getMinimum(); Version maximum = versionRange.getMaximum() == null ? Version.maxVersion : versionRange.getMaximum(); if (!minimum.isInclusive() || maximum.isInclusive()) return false; else if (minimum.getMajorComponent() == maximum.getMajorComponent() - 1) return true; return false; |
boolean |
isMatchedAsEquivalent()
Deprecated.
Callers of this method should interrogate the current
State
of the platform. For example,
State state = Platform.getPlatformAdmin().getState(); BundleDescription bundle = state.getBundle("my plug-in id", my plug-in version); BundleSpecification spec = bundle.getRequiredBundle("required plug-in id"); VersionRange versionRange = spec.getVersionRange(); if (versionRange == null || versionRange.getMinimum() == null) return false; Version minimum = versionRange.getMinimum(); Version maximum = versionRange.getMaximum() == null ? Version.maxVersion : versionRange.getMaximum(); if (!minimum.isInclusive() || maximum.isInclusive()) return false; else if (minimum.getMajorComponent() == maximum.getMajorComponent() - 1) return false; else if (minimum.getMajorComponent() != maximum.getMajorComponent()) return false; else if (minimum.getMinorComponent() == maximum.getMinorComponent() - 1) return true; return false; |
boolean |
isMatchedAsExact()
Deprecated.
Callers of this method should interrogate the current
State
of the platform. For example,
State state = Platform.getPlatformAdmin().getState(); BundleDescription bundle = state.getBundle("my plug-in id", my plug-in version); BundleSpecification spec = bundle.getRequiredBundle("required plug-in id"); VersionRange versionRange = spec.getVersionRange(); if (versionRange == null || versionRange.getMinimum() == null) return false; Version minimum = versionRange.getMinimum(); Version maximum = versionRange.getMaximum() == null ? Version.maxVersion : versionRange.getMaximum(); if (!minimum.isInclusive() || maximum.isInclusive()) return false; else if (minimum.getMajorComponent() == maximum.getMajorComponent() - 1) return false; else if (minimum.getMajorComponent() != maximum.getMajorComponent()) return false; else if (minimum.getMinorComponent() == maximum.getMinorComponent() - 1) return true; return false; |
boolean |
isMatchedAsGreaterOrEqual()
Deprecated.
Callers of this method should interrogate the current
State
of the platform. For example,
State state = Platform.getPlatformAdmin().getState(); BundleDescription bundle = state.getBundle("my plug-in id", my plug-in version); BundleSpecification spec = bundle.getRequiredBundle("required plug-in id"); VersionRange versionRange = spec.getVersionRange(); if (versionRange == null || versionRange.getMinimum() == null) return false; Version minimum = versionRange.getMinimum(); Version maximum = versionRange.getMaximum() == null ? Version.maxVersion : versionRange.getMaximum(); if (maximum.equals(Version.maxVersion)) return true; return false; |
boolean |
isMatchedAsPerfect()
Deprecated.
Callers of this method should interrogate the current
State
of the platform. For example,
State state = Platform.getPlatformAdmin().getState(); BundleDescription bundle = state.getBundle("my plug-in id", my plug-in version); BundleSpecification spec = bundle.getRequiredBundle("required plug-in id"); VersionRange versionRange = spec.getVersionRange(); if (versionRange == null || versionRange.getMinimum() == null) return false; Version minimum = versionRange.getMinimum(); Version maximum = versionRange.getMaximum() == null ? Version.maxVersion : versionRange.getMaximum(); if (minimum.equals(maximum)) return true; return false; |
boolean |
isOptional()
Deprecated.
Given a manifest element equivalent of a plug-in
prerequisite (see the class comment), this method is replaced by:
"true".equals(element.getAttribute(Constants.OPTIONAL_ATTRIBUTE); |
@Deprecated PluginVersionIdentifier getResolvedVersionIdentifier()
State
of the platform. For example,
State state = Platform.getPlatformAdmin().getState(); BundleDescription bundle = state.getBundle("my plug-in id", my plug-in version); BundleSpecification spec = bundle.getRequiredBundle("required plug-in id"); BundleDescription prereq = spec.getSupplier();
@Deprecated String getUniqueIdentifier()
element.getValue();
@Deprecated PluginVersionIdentifier getVersionIdentifier()
State
of the platform. For example,
State state = Platform.getPlatformAdmin().getState(); BundleDescription bundle = state.getBundle("my plug-in id", my plug-in version); BundleSpecification spec = bundle.getRequiredBundle("required plug-in id"); Version reqMinVersion = spec.getVersionRange().getMinimum();
null
if none.null
if
none was specified@Deprecated boolean isExported()
element.getAttribute(Constants.REPROVIDE_ATTRIBUTE);
true
if this prerequisite plug-in is exposed,
false
otherwise@Deprecated boolean isMatchedAsGreaterOrEqual()
State
of the platform. For example,
State state = Platform.getPlatformAdmin().getState(); BundleDescription bundle = state.getBundle("my plug-in id", my plug-in version); BundleSpecification spec = bundle.getRequiredBundle("required plug-in id"); VersionRange versionRange = spec.getVersionRange(); if (versionRange == null || versionRange.getMinimum() == null) return false; Version minimum = versionRange.getMinimum(); Version maximum = versionRange.getMaximum() == null ? Version.maxVersion : versionRange.getMaximum(); if (maximum.equals(Version.maxVersion)) return true; return false;
true
if greater or equal match is allowed,
false
otherwise.@Deprecated boolean isMatchedAsCompatible()
State
of the platform. For example,
State state = Platform.getPlatformAdmin().getState(); BundleDescription bundle = state.getBundle("my plug-in id", my plug-in version); BundleSpecification spec = bundle.getRequiredBundle("required plug-in id"); VersionRange versionRange = spec.getVersionRange(); if (versionRange == null || versionRange.getMinimum() == null) return false; Version minimum = versionRange.getMinimum(); Version maximum = versionRange.getMaximum() == null ? Version.maxVersion : versionRange.getMaximum(); if (!minimum.isInclusive() || maximum.isInclusive()) return false; else if (minimum.getMajorComponent() == maximum.getMajorComponent() - 1) return true; return false;
true
if compatible match is allowed,
false
if exact match is required.@Deprecated boolean isMatchedAsEquivalent()
State
of the platform. For example,
State state = Platform.getPlatformAdmin().getState(); BundleDescription bundle = state.getBundle("my plug-in id", my plug-in version); BundleSpecification spec = bundle.getRequiredBundle("required plug-in id"); VersionRange versionRange = spec.getVersionRange(); if (versionRange == null || versionRange.getMinimum() == null) return false; Version minimum = versionRange.getMinimum(); Version maximum = versionRange.getMaximum() == null ? Version.maxVersion : versionRange.getMaximum(); if (!minimum.isInclusive() || maximum.isInclusive()) return false; else if (minimum.getMajorComponent() == maximum.getMajorComponent() - 1) return false; else if (minimum.getMajorComponent() != maximum.getMajorComponent()) return false; else if (minimum.getMinorComponent() == maximum.getMinorComponent() - 1) return true; return false;
true
if only equivalent identifier match
satisfies this dependency, false
otherwise.@Deprecated boolean isMatchedAsPerfect()
State
of the platform. For example,
State state = Platform.getPlatformAdmin().getState(); BundleDescription bundle = state.getBundle("my plug-in id", my plug-in version); BundleSpecification spec = bundle.getRequiredBundle("required plug-in id"); VersionRange versionRange = spec.getVersionRange(); if (versionRange == null || versionRange.getMinimum() == null) return false; Version minimum = versionRange.getMinimum(); Version maximum = versionRange.getMaximum() == null ? Version.maxVersion : versionRange.getMaximum(); if (minimum.equals(maximum)) return true; return false;
true
if only perfectly equal
identifier match satisfies this dependency,
false
otherwise.@Deprecated boolean isMatchedAsExact()
State
of the platform. For example,
State state = Platform.getPlatformAdmin().getState(); BundleDescription bundle = state.getBundle("my plug-in id", my plug-in version); BundleSpecification spec = bundle.getRequiredBundle("required plug-in id"); VersionRange versionRange = spec.getVersionRange(); if (versionRange == null || versionRange.getMinimum() == null) return false; Version minimum = versionRange.getMinimum(); Version maximum = versionRange.getMaximum() == null ? Version.maxVersion : versionRange.getMaximum(); if (!minimum.isInclusive() || maximum.isInclusive()) return false; else if (minimum.getMajorComponent() == maximum.getMajorComponent() - 1) return false; else if (minimum.getMajorComponent() != maximum.getMajorComponent()) return false; else if (minimum.getMinorComponent() == maximum.getMinorComponent() - 1) return true; return false;
true
if only exact identifier match
satisfies this dependency, false
if compatible
plug-in will satisfy this dependency.@Deprecated boolean isOptional()
"true".equals(element.getAttribute(Constants.OPTIONAL_ATTRIBUTE);
true
if this prerequisite is optional, false
otherwise
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.