aQute.bnd.build.model.conversions.RequirementListConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bnd Show documentation
Show all versions of bnd Show documentation
A command line utility and Ant plugin to wrap, build, or examine bundles.
package aQute.bnd.build.model.conversions;
import java.util.Map.Entry;
import org.osgi.resource.*;
import aQute.bnd.header.*;
import aQute.bnd.osgi.resource.*;
import aQute.libg.tuple.*;
public class RequirementListConverter extends ClauseListConverter {
public RequirementListConverter() {
super(new Converter>() {
public Requirement convert(Pair input) throws IllegalArgumentException {
if (input == null)
return null;
String namespace = input.getFirst();
CapReqBuilder builder = new CapReqBuilder(namespace);
for (Entry entry : input.getSecond().entrySet()) {
String key = entry.getKey();
if (key.endsWith(":")) {
key = key.substring(0, key.length() - 1);
builder.addDirective(key, entry.getValue());
} else {
builder.addAttribute(key, entry.getValue());
}
}
return builder.buildSyntheticRequirement();
}
});
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy