public void setProvided(boolean provided) { if (provided) attribs.put(aQute.bnd.osgi.Constants.PROVIDE_DIRECTIVE, Boolean.toString(true)); else attribs.remove(aQute.bnd.osgi.Constants.PROVIDE_DIRECTIVE); }
public void setOptional(boolean optional) { if (optional) attribs.put(aQute.bnd.osgi.Constants.RESOLUTION_DIRECTIVE, Constants.RESOLUTION_OPTIONAL); else attribs.remove(aQute.bnd.osgi.Constants.RESOLUTION_DIRECTIVE); }
public void setOptional(boolean optional) { if (optional) attribs.put(aQute.bnd.osgi.Constants.RESOLUTION_DIRECTIVE, Constants.RESOLUTION_OPTIONAL); else attribs.remove(aQute.bnd.osgi.Constants.RESOLUTION_DIRECTIVE); }
public void setProvided(boolean provided) { if (provided) attribs.put(aQute.bnd.osgi.Constants.PROVIDE_DIRECTIVE, Boolean.toString(true)); else attribs.remove(aQute.bnd.osgi.Constants.PROVIDE_DIRECTIVE); }
public void setOptional(boolean optional) { if (optional) attribs.put(aQute.bnd.osgi.Constants.RESOLUTION_DIRECTIVE, Constants.RESOLUTION_OPTIONAL); else attribs.remove(aQute.bnd.osgi.Constants.RESOLUTION_DIRECTIVE); }
public void setProvided(boolean provided) { if (provided) attribs.put(aQute.bnd.osgi.Constants.PROVIDE_DIRECTIVE, Boolean.toString(true)); else attribs.remove(aQute.bnd.osgi.Constants.PROVIDE_DIRECTIVE); }
public void setProvided(boolean provided) { if (provided) attribs.put(aQute.bnd.osgi.Constants.PROVIDE_DIRECTIVE, Boolean.toString(true)); else attribs.remove(aQute.bnd.osgi.Constants.PROVIDE_DIRECTIVE); }
public void setOptional(boolean optional) { if (optional) attribs.put(aQute.bnd.osgi.Constants.RESOLUTION_DIRECTIVE, Constants.RESOLUTION_OPTIONAL); else attribs.remove(aQute.bnd.osgi.Constants.RESOLUTION_DIRECTIVE); }
public void setProvided(boolean provided) { if (provided) attribs.put(aQute.bnd.osgi.Constants.PROVIDE_DIRECTIVE, Boolean.toString(true)); else attribs.remove(aQute.bnd.osgi.Constants.PROVIDE_DIRECTIVE); }
public void setOptional(boolean optional) { if (optional) attribs.put(aQute.bnd.osgi.Constants.RESOLUTION_DIRECTIVE, Constants.RESOLUTION_OPTIONAL); else attribs.remove(aQute.bnd.osgi.Constants.RESOLUTION_DIRECTIVE); }
public void setListAttrib(String attrib, Collection<? extends String> value) { if (value == null || value.isEmpty()) attribs.remove(attrib); else { StringBuilder buffer = new StringBuilder(); boolean first = true; for (String string : value) { if (!first) buffer.append(','); buffer.append(string); first = false; } attribs.put(attrib, buffer.toString()); } }
public void setListAttrib(String attrib, Collection< ? extends String> value) { if (value == null || value.isEmpty()) attribs.remove(attrib); else { StringBuilder buffer = new StringBuilder(); boolean first = true; for (String string : value) { if (!first) buffer.append(','); buffer.append(string); first = false; } attribs.put(attrib, buffer.toString()); } }
private void directivesAndVersion(Attrs attrs, String... directives) { for (String directive : directives) { String s = attrs.remove(directive); if (s != null) { attrs.put(directive + ":", s); } } String remove = attrs.remove(Constants.VERSION_ATTRIBUTE); if (remove != null) { attrs.putTyped("version", Version.parseVersion(remove)); } }
private void directivesAndVersion(Attrs attrs, String... directives) { for (String directive : directives) { String s = attrs.remove(directive); if (s != null) { attrs.put(directive + ":", s); } } String remove = attrs.remove(Constants.VERSION_ATTRIBUTE); if (remove != null) { attrs.putTyped("version", Version.parseVersion(remove)); } }
private void fixupOldStyleVersions(Attrs attrs) { if (attrs.containsKey(SPECIFICATION_VERSION) && attrs.getVersion() == null) { attrs.put("version", attrs.get(SPECIFICATION_VERSION)); attrs.remove(SPECIFICATION_VERSION); } }
private void fixupOldStyleVersions(Attrs attrs) { if (attrs.containsKey(SPECIFICATION_VERSION) && attrs.getVersion() == null) { attrs.put("version", attrs.get(SPECIFICATION_VERSION)); attrs.remove(SPECIFICATION_VERSION); } }
private void fixupOldStyleVersions(Attrs attrs) { if (attrs.containsKey(SPECIFICATION_VERSION) && attrs.getVersion() == null) { attrs.put("version", attrs.get(SPECIFICATION_VERSION)); attrs.remove(SPECIFICATION_VERSION); } }
private void fixupOldStyleVersions(Attrs attrs) { if (attrs.containsKey(SPECIFICATION_VERSION) && attrs.getVersion() == null) { attrs.put("version", attrs.get(SPECIFICATION_VERSION)); attrs.remove(SPECIFICATION_VERSION); } }
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); }
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); }