Search in sources :

Example 1 with ProvideCapability

use of aQute.bnd.annotation.headers.ProvideCapability in project bnd by bndtools.

the class AnnotationHeaders method doProvideCapability.

/*
	 * Provide-Capability header
	 */
private void doProvideCapability(Annotation a) throws Exception {
    ProvideCapability annotation = a.getAnnotation(ProvideCapability.class);
    Parameters p = new Parameters();
    Attrs attrs = getAttributes(a, "ns");
    directivesAndVersion(attrs, "uses", "mandatory", "effective");
    p.put(annotation.ns(), attrs);
    String value = attrs.remove("name");
    if (value != null)
        attrs.put(annotation.ns(), value);
    value = attrs.remove("value");
    String s = p.toString();
    if (value != null)
        s += ";" + annotation.value();
    add(Constants.PROVIDE_CAPABILITY, s);
}
Also used : Parameters(aQute.bnd.header.Parameters) Attrs(aQute.bnd.header.Attrs) ProvideCapability(aQute.bnd.annotation.headers.ProvideCapability)

Aggregations

ProvideCapability (aQute.bnd.annotation.headers.ProvideCapability)1 Attrs (aQute.bnd.header.Attrs)1 Parameters (aQute.bnd.header.Parameters)1