resource.getCapability().add(cap);
}
}
private void convertBundleToCapability(Resource resource, BundleDescription.SymbolicName symbolicName) {
Capability cap = new Capability();
cap.setName(CAPABILITY_BUNDLE);
cap.getP().add(createP("symbolicname", null, symbolicName.getName()));
cap.getP().add(createP("version", "version", bundleDescription.getVersion().toString()));
cap.getP().add(createP("manifestversion", "version", (String) bundleDescription.getHeaders().get(Constants.BUNDLE_MANIFESTVERSION)));
String attachment = symbolicName.getDirectives().get("fragment-attachment");
if (attachment != null) {
cap.getP().add(createP("fragment-attachment", null, attachment));
}
String singleton = symbolicName.getDirectives().get("singleton");
if (singleton != null) {
cap.getP().add(createP("singleton", null, singleton));
}
resource.getCapability().add(cap);
}