public Attrs with(String key, String value) { put(key, value); return this; } }
@Override public void putAll(Map<? extends String, ? extends String> other) { if (other instanceof Attrs) { putAll((Attrs) other); return; } for (Map.Entry<? extends String, ? extends String> e : other.entrySet()) { put(e.getKey(), e.getValue()); } }
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)); } }
public Attrs with(String key, String value) { put(key, value); return this; } }
public Attrs with(String key, String value) { put(key, value); return this; } }
public static Attrs create(String key, String value) { Attrs attrs = new Attrs(); attrs.put(key, value); return attrs; }
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 static Attrs create(String key, String value) { Attrs attrs = new Attrs(); attrs.put(key, value); return attrs; }
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); }
/** * Merge the attributes */ public void mergeWith(Attrs other, boolean override) { for ( Map.Entry<String,String> e: other.entrySet()) { String local = get( e.getKey()); if ( override || local == null ) put(e.getKey(), e.getValue()); } }
private void addExtenderRequirement(Set<String> requires, List<String> beans, Version version) { Version next = version.bumpMajor(); Parameters p = new Parameters(); Attrs a = new Attrs(); a.put(Constants.FILTER_DIRECTIVE, "\"(&(osgi.extender=osgi.cdi)(version>=" + version + ")(!(version>=" + next + ")))\""); a.put("beans:List<String>", String.join(",", beans)); p.put("osgi.extender", a); String s = p.toString(); requires.add(s); }
public static VersionedClause error(String msg) { Attrs a = new Attrs(); a.put("PARSE ERROR", msg); return new VersionedClause("ERROR", a); } }
public void addRequireBundle(String bsn, VersionRange range) throws Exception { Attrs attrs = new Attrs(); attrs.put("bundle-version", range.toString()); addRequireBundle(bsn, attrs); }
public void addRequireBundle(String bsn, VersionRange range) throws Exception { Attrs attrs = new Attrs(); attrs.put("bundle-version", range.toString()); addRequireBundle(bsn, attrs); }
private void addExtenderRequirement(Set<String> requires, Version version) { Version next = version.bumpMajor(); Parameters p = new Parameters(); Attrs a = new Attrs(); a.put(Constants.FILTER_DIRECTIVE, "\"(&(" + ExtenderNamespace.EXTENDER_NAMESPACE + "=" + ComponentConstants.COMPONENT_CAPABILITY_NAME + ")(" + ExtenderNamespace.CAPABILITY_VERSION_ATTRIBUTE + ">=" + version + ")(!(" + ExtenderNamespace.CAPABILITY_VERSION_ATTRIBUTE + ">=" + next + ")))\""); p.put(ExtenderNamespace.EXTENDER_NAMESPACE, a); String s = p.toString(); requires.add(s); }
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); } }