handler.startElement("", CapabilityHandler.CAPABILITY, CapabilityHandler.CAPABILITY, atts);
if (type.equals(BundleInfo.BUNDLE_TYPE)) {
// nothing to do, already handled with the resource tag
} else if (type.equals(BundleInfo.PACKAGE_TYPE)) {
saxCapabilityProperty("package", capability.getName(), handler);
Version v = capability.getRawVersion();
if (v != null) {
saxCapabilityProperty("version", v.toString(), handler);
}
Set/* <String> */uses = ((ExportPackage) capability).getUses();
if (uses != null && !uses.isEmpty()) {
StringBuffer builder = new StringBuffer();
Iterator itUse = uses.iterator();
while (itUse.hasNext()) {
String use = (String) itUse.next();
if (builder.length() != 0) {
builder.append(',');
}
builder.append(use);
}
saxCapabilityProperty("uses", builder.toString(), handler);
}
} else if (type.equals(BundleInfo.SERVICE_TYPE)) {
saxCapabilityProperty("service", capability.getName(), handler);
Version v = capability.getRawVersion();
if (v != null) {
saxCapabilityProperty("version", v.toString(), handler);
}
} else {
// oups
}
handler.endElement("", CapabilityHandler.CAPABILITY, CapabilityHandler.CAPABILITY);