本文整理匯總了Java中org.osgi.framework.Constants.BUNDLE_VERSION_ATTRIBUTE屬性的典型用法代碼示例。如果您正苦於以下問題:Java Constants.BUNDLE_VERSION_ATTRIBUTE屬性的具體用法?Java Constants.BUNDLE_VERSION_ATTRIBUTE怎麽用?Java Constants.BUNDLE_VERSION_ATTRIBUTE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.osgi.framework.Constants
的用法示例。
在下文中一共展示了Constants.BUNDLE_VERSION_ATTRIBUTE屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: WrappingTransformer
public WrappingTransformer(ClassTransformer delegate, ServiceReference<?> persistenceProvider) {
validate(delegate, persistenceProvider);
this.delegate = delegate;
Object packages = persistenceProvider.getProperty("org.apache.aries.jpa.container.weaving.packages");
if (packages instanceof String[]) {
for (String s : (String[])packages) {
packageImportsToAdd.add(s);
}
} else {
Bundle provider = persistenceProvider.getBundle();
String suffix = ";" + Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE + "=" + provider.getSymbolicName()
+ ";" + Constants.BUNDLE_VERSION_ATTRIBUTE + "=" + provider.getVersion();
BundleRevision br = provider.adapt(BundleWiring.class).getRevision();
for (BundleCapability bc : br.getDeclaredCapabilities(BundleRevision.PACKAGE_NAMESPACE)) {
packageImportsToAdd.add(bc.getAttributes().get(BundleRevision.PACKAGE_NAMESPACE) + suffix);
}
}
}
示例2: testParseRequireBundleEntryWithSimpleUnquotedVersion
public void testParseRequireBundleEntryWithSimpleUnquotedVersion() throws Exception {
String version = "1.0.0.a";
String entry = PKG + ";" + Constants.BUNDLE_VERSION_ATTRIBUTE + "=" + version;
String[] result = OsgiHeaderUtils.parseRequiredBundleString(entry);
assertEquals(PKG, result[0]);
assertEquals(version, result[1]);
}
示例3: testParseRequireBundleEntryWithSimpleQuotedVersion
public void testParseRequireBundleEntryWithSimpleQuotedVersion() throws Exception {
String version = "1.2.3";
String entry = PKG + ";" + Constants.BUNDLE_VERSION_ATTRIBUTE + "=\"" + version + "\"";
String[] result = OsgiHeaderUtils.parseRequiredBundleString(entry);
assertEquals(PKG, result[0]);
assertEquals(version, result[1]);
}
示例4: testParseRequireBundleEntryWithVersionRange
public void testParseRequireBundleEntryWithVersionRange() throws Exception {
String version = "[1.0.0,2.0.0a)";
String entry = PKG + ";" + Constants.BUNDLE_VERSION_ATTRIBUTE + "=\"" + version + "\"";
String[] result = OsgiHeaderUtils.parseRequiredBundleString(entry);
assertEquals(PKG, result[0]);
assertEquals(version, result[1]);
}
示例5: testParseRequireBundleEntryWithSimpleUnquotedVersionAndExtraAttributes
public void testParseRequireBundleEntryWithSimpleUnquotedVersionAndExtraAttributes() throws Exception {
String version = "1.0.0.a";
String entry = PKG + ";visibility:=reexport;" + Constants.BUNDLE_VERSION_ATTRIBUTE + "=" + version
+ ";resolution:=optional";
String[] result = OsgiHeaderUtils.parseRequiredBundleString(entry);
assertEquals(PKG, result[0]);
assertEquals(version, result[1]);
}
示例6: testParseRequireBundleEntryWithSimpleQuotedVersionAndExtraAttributes
public void testParseRequireBundleEntryWithSimpleQuotedVersionAndExtraAttributes() throws Exception {
String version = "1.0.0.a";
String entry = PKG + ";visibility:=reexport;" + Constants.BUNDLE_VERSION_ATTRIBUTE + "=\"" + version
+ "\";resolution:=optional";
String[] result = OsgiHeaderUtils.parseRequiredBundleString(entry);
assertEquals(PKG, result[0]);
assertEquals(version, result[1]);
}
示例7: testParseRequireBundleEntryWithVersionRangeAndExtraAttributes
public void testParseRequireBundleEntryWithVersionRangeAndExtraAttributes() throws Exception {
String version = "[1.0.0,2.0.0a)";
String entry = PKG + ";visibility:=reexport;" + Constants.BUNDLE_VERSION_ATTRIBUTE + "=\"" + version
+ "\";resolution:=optional";
String[] result = OsgiHeaderUtils.parseRequiredBundleString(entry);
assertEquals(PKG, result[0]);
assertEquals(version, result[1]);
}