本文整理汇总了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]);
}