aQute.bnd.osgi.Analyzer.doExportsToImports()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(114)

本文整理了Java中aQute.bnd.osgi.Analyzer.doExportsToImports()方法的一些代码示例,展示了Analyzer.doExportsToImports()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Analyzer.doExportsToImports()方法的具体详情如下:
包路径:aQute.bnd.osgi.Analyzer
类名称:Analyzer
方法名:doExportsToImports

Analyzer.doExportsToImports介绍

[英]We will add all exports to the imports unless there is a -noimport directive specified on an export. This directive is skipped for the manifest. We also remove any version parameter so that augmentImports can do the version policy. The following method is really tricky and evolved over time. Coming from the original background of OSGi, it was a weird idea for me to have a public package that should not be substitutable. I was so much convinced that this was the right rule that I rücksichtlos imported them all. Alas, the real world was more subtle than that. It turns out that it is not a good idea to always import. First, there must be a need to import, i.e. there must be a contained package that refers to the exported package for it to make use importing that package. Second, if an exported package refers to an internal package than it should not be imported. Additionally, it is necessary to treat the exports in groups. If an exported package refers to another exported packages than it must be in the same group. A framework can only substitute exports for imports for the whole of such a group. WHY????? Not clear anymore ...
[中]我们会将所有出口添加到进口中,除非出口中指定了-noimport指令。对于清单,跳过此指令。我们还删除了任何版本参数,以便augmentImports可以执行版本策略。下面的方法非常棘手,并且随着时间的推移而不断发展。来自OSGi的原始背景,对我来说,拥有一个不可替代的公共包是一个奇怪的想法。我非常确信这是正确的规则,所以我把它们都引进了。唉,现实世界比这更微妙。事实证明,总是导入不是一个好主意。首先,必须需要导入,即必须有一个包含的包,该包引用导出的包,以便它使用导入该包。第二,如果导出的包引用内部包,则不应导入该包。此外,有必要对出口进行分组处理。如果导出的包引用其他导出的包,则它必须位于同一组中。一个框架只能用出口代替进口来代替整个这样一个集团。为什么?不清楚了。。。

代码示例

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

referredAndExported.putAll(doExportsToImports(exports));

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

referredAndExported.putAll(doExportsToImports(exports));

代码示例来源:origin: biz.aQute/bndlib

referredAndExported.putAll(doExportsToImports(exports));

代码示例来源:origin: biz.aQute.bnd/bndlib

referredAndExported.putAll(doExportsToImports(exports));

代码示例来源:origin: biz.aQute.bnd/bnd

referredAndExported.putAll(doExportsToImports(exports));

相关文章

Analyzer类方法