b.setLicense(feature.getLicense());
Iterator itPlugins = feature.getPlugins().iterator();
while (itPlugins.hasNext()) {
EclipsePlugin plugin = (EclipsePlugin) itPlugins.next();
BundleRequirement r = new BundleRequirement(BundleInfo.BUNDLE_TYPE, plugin.getId(),
new VersionRange(plugin.getVersion()), null);
b.addRequirement(r);
}
Iterator itRequires = feature.getRequires().iterator();
while (itRequires.hasNext()) {
Require require = (Require) itRequires.next();
String id;
if (require.getPlugin() != null) {
id = require.getPlugin();
} else {
id = require.getFeature();
}
VersionRange range;
if (require.getMatch().equals("greaterOrEqual")) {
range = new VersionRange(require.getVersion());
} else {
throw new IllegalStateException("unsupported match " + require.getMatch());
}
BundleRequirement r = new BundleRequirement(BundleInfo.BUNDLE_TYPE, id, range, null);
b.addRequirement(r);
}
return b;
}