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 biz.aQute.bndlib Show documentation
Show all versions of biz.aQute.bndlib Show documentation
bndlib: A Swiss Army Knife for OSGi
The newest version!
package aQute.bnd.build.model.conversions;
import org.osgi.resource.Requirement;
import aQute.bnd.build.model.clauses.HeaderClause;
import aQute.bnd.osgi.resource.CapReqBuilder;
public class RequirementListConverter extends HeaderClauseListConverter {
public RequirementListConverter() {
super(new Converter() {
@Override
public Requirement convert(HeaderClause input) {
if (input == null)
return null;
try {
CapReqBuilder builder = CapReqBuilder.createCapReqBuilder(input.getName(), input.getAttribs());
return builder.buildSyntheticRequirement();
} catch (Exception e) {
throw new IllegalArgumentException(e);
}
}
@Override
public Requirement error(String msg) {
CapReqBuilder builder = new CapReqBuilder(msg);
return builder.buildSyntheticRequirement();
}
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy