public void append(StringBuilder sb) { String del = ""; for (Map.Entry<String,String> e : entrySet()) { sb.append(del); sb.append(e.getKey()); sb.append("="); sb.append(e.getValue()); del = ";"; } }
public void append(StringBuilder sb) { String del = ""; for (Map.Entry<String, String> e : entrySet()) { sb.append(del); append(sb, e); del = ";"; } }
public void append(StringBuilder sb) { String del = ""; for (Map.Entry<String, String> e : entrySet()) { sb.append(del); append(sb, e); del = ";"; } }
public void append(StringBuilder sb) { String del = ""; for (Map.Entry<String, String> e : entrySet()) { sb.append(del); append(sb, e); del = ";"; } }
public void append(StringBuilder sb) { String del = ""; for (Map.Entry<String, String> e : entrySet()) { sb.append(del); append(sb, e); del = ";"; } }
public CapReqBuilder(String ns, Attrs attrs) { this.namespace = ns; for (Entry<String,String> entry : attrs.entrySet()) { String key = entry.getKey(); if (key.endsWith(":")) addDirective(key.substring(0, key.length() - 1), entry.getValue()); else addAttribute(key, entry.getValue()); } }
public CapReqBuilder(String namespace, Attrs attrs) throws Exception { this(namespace); for (Entry<String, String> entry : attrs.entrySet()) { String key = entry.getKey(); if (key.endsWith(":")) addDirective(key.substring(0, key.length() - 1), entry.getValue()); else addAttribute(key, entry.getValue()); } }
public CapReqBuilder(String ns, Attrs attrs) { this.namespace = ns; for (Entry<String,String> entry : attrs.entrySet()) { String key = entry.getKey(); if (key.endsWith(":")) addDirective(key.substring(0, key.length() - 1), entry.getValue()); else addAttribute(key, entry.getValue()); } }
public CapReqBuilder(String namespace, Attrs attrs) throws Exception { this(namespace); for (Entry<String, String> entry : attrs.entrySet()) { String key = entry.getKey(); if (key.endsWith(":")) addDirective(key.substring(0, key.length() - 1), entry.getValue()); else addAttribute(key, entry.getValue()); } }
/** * 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()); } }
public CapReqBuilder addDirectives(Attrs directives) { for (Entry<String, String> e : directives.entrySet()) { String key = Attrs.toDirective(e.getKey()); if (key != null) addDirective(key, e.getValue()); } return this; }
public CapReqBuilder addDirectives(Attrs directives) { for (Entry<String, String> e : directives.entrySet()) { String key = Attrs.toDirective(e.getKey()); if (key != null) addDirective(key, e.getValue()); } return this; }
/** * 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()); } }
public static Requirement getRequirementFrom(String namespace, Attrs attrs) { CapReqBuilder builder = new CapReqBuilder(namespace); for (Entry<String,String> entry : attrs.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(); } }
public static Requirement getRequirementFrom(String namespace, Attrs attrs) { CapReqBuilder builder = new CapReqBuilder(namespace); for (Entry<String,String> entry : attrs.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(); } }
public static void copyAttribsToBuilder(CapReqBuilder builder, Attrs attribs) { for (Entry<String,String> attrib : attribs.entrySet()) { String key = attrib.getKey(); if (key.endsWith(":")) { String directiveName = key.substring(0, key.length() - 1); builder.addDirective(directiveName, attrib.getValue()); } else { // TODO Type type = attribs.getType(key); Object value = attribs.getTyped(key); builder.addAttribute(key, value); } } }
public static void copyAttribsToBuilder(CapReqBuilder builder, Attrs attribs) { for (Entry<String,String> attrib : attribs.entrySet()) { String key = attrib.getKey(); if (key.endsWith(":")) { String directiveName = key.substring(0, key.length() - 1); builder.addDirective(directiveName, attrib.getValue()); } else { // TODO Type type = attribs.getType(key); Object value = attribs.getTyped(key); builder.addAttribute(key, value); } } }
public Requirement convert(Pair<String,Attrs> input) throws IllegalArgumentException { String namespace = input.getFirst(); CapReqBuilder builder = new CapReqBuilder(namespace); for (Entry<String,String> 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(); } });
void doExportService(Domain domain, List< ? super Capability> caps) throws Exception { @SuppressWarnings("deprecation") Parameters exports = new Parameters(domain.get(Constants.EXPORT_SERVICE)); for (Entry<String,Attrs> export : exports.entrySet()) { String service = Processor.removeDuplicateMarker(export.getKey()); CapReqBuilder builder = new CapReqBuilder(Namespaces.NS_SERVICE).addAttribute(Constants.OBJECTCLASS, service); for (Entry<String,String> attribEntry : export.getValue().entrySet()) builder.addAttribute(attribEntry.getKey(), attribEntry.getValue()); builder.addDirective(Namespaces.DIRECTIVE_EFFECTIVE, Namespaces.EFFECTIVE_ACTIVE); caps.add(builder.buildCapability()); } }
void doExportService(Domain domain, List< ? super Capability> caps) throws Exception { @SuppressWarnings("deprecation") Parameters exports = new Parameters(domain.get(Constants.EXPORT_SERVICE)); for (Entry<String,Attrs> export : exports.entrySet()) { String service = Processor.removeDuplicateMarker(export.getKey()); CapReqBuilder builder = new CapReqBuilder(Namespaces.NS_SERVICE).addAttribute(Constants.OBJECTCLASS, service); for (Entry<String,String> attribEntry : export.getValue().entrySet()) builder.addAttribute(attribEntry.getKey(), attribEntry.getValue()); builder.addDirective(Namespaces.DIRECTIVE_EFFECTIVE, Namespaces.EFFECTIVE_ACTIVE); caps.add(builder.buildCapability()); } }