當前位置: 首頁>>代碼示例>>Java>>正文


Java Constants.BUNDLE_VERSION_ATTRIBUTE屬性代碼示例

本文整理匯總了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);
        }
    }
}
 
開發者ID:apache,項目名稱:aries-jpa,代碼行數:20,代碼來源:WrappingTransformer.java

示例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]);
}
 
開發者ID:eclipse,項目名稱:gemini.blueprint,代碼行數:7,代碼來源:OsgiHeaderUtilsTest.java

示例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]);
}
 
開發者ID:eclipse,項目名稱:gemini.blueprint,代碼行數:7,代碼來源:OsgiHeaderUtilsTest.java

示例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]);
}
 
開發者ID:eclipse,項目名稱:gemini.blueprint,代碼行數:7,代碼來源:OsgiHeaderUtilsTest.java

示例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]);
}
 
開發者ID:eclipse,項目名稱:gemini.blueprint,代碼行數:8,代碼來源:OsgiHeaderUtilsTest.java

示例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]);
}
 
開發者ID:eclipse,項目名稱:gemini.blueprint,代碼行數:8,代碼來源:OsgiHeaderUtilsTest.java

示例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]);
}
 
開發者ID:eclipse,項目名稱:gemini.blueprint,代碼行數:8,代碼來源:OsgiHeaderUtilsTest.java


注:本文中的org.osgi.framework.Constants.BUNDLE_VERSION_ATTRIBUTE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。