use of org.apache.ivy.osgi.util.Version in project ant-ivy by apache.
the class ManifestParser method parseCapability.
private static void parseCapability(BundleInfo bundleInfo, Attributes mainAttributes, String headerName, String type) throws ParseException {
ManifestHeaderValue elements = new ManifestHeaderValue(mainAttributes.getValue(headerName));
for (ManifestHeaderElement element : elements.getElements()) {
String attVersion = element.getAttributes().get(ATTR_VERSION);
Version version = null;
try {
version = versionOf(attVersion);
} catch (NumberFormatException e) {
throw new ParseException("The " + headerName + " has an incorrect version: " + attVersion + " (" + e.getMessage() + ")", 0);
}
for (String name : element.getValues()) {
BundleCapability export = new BundleCapability(type, name, version);
bundleInfo.addCapability(export);
}
}
}
Aggregations