bndtools/bnd — pull request #221 by xfournet (2012-07-24 09:26:42+00:00)
Title: Be able to validate the packages imported by an AnalyzerPlugin

When writing a aQute.bnd.service.AnalyzerPlugin I would like to be a able to check that the package to import is accessible from the classpath or from the own bundle. In order to do that I actually need to access the classpathExports field of the Analyzer in order to check that with the following code

```java
String pkg = ....; // name of a package found by the plugin
PackageRef pack = analyzer.getPackageRef(pkg);
if (analyzer.getContained().containsKey(pack) || analyzer.getClasspathExports().contains(pack)) {
// add the package in the import list
if (!analyzer.getReferred().containsKey(pack)) {
analyzer.getReferred().put(pack);
}
} else {
analyzer.error("References non existing or inaccessible package: %s", pkg);
}
```

But actually there is no such getter getClasspathExports so I added one.
Feel free to comment if you don't think this is the right way to implement this check.