/** * The equivalent of put(new StringAttribute(key), value). But this * is mainly a method required by CollectionAttribute, the parent class. * This method is used by setField in CollectionAttribute, * it has thus an internal value rather than an API value. */ public void cput (final String key, final Attribute value) { this.put(new StringAttribute(key), value); }
private static void fillMap (final MapAttribute ma, final java.util.Map m) { java.util.Iterator it = m.keySet().iterator(); while (it.hasNext()) { Object k = it.next(); Object v = m.get(k); if (ma instanceof StringMapAttribute) ma.put(new StringAttribute(k.toString()), java2owfe(v)); else ma.put(java2owfe(k), java2owfe(v)); } }
public synchronized Object clone () { final MapAttribute clone = (MapAttribute)ReflectionUtils.newInstance(this); java.util.Iterator it = this.map.keySet().iterator(); while (it.hasNext()) { Attribute key = (Attribute)it.next(); Attribute value = this.aget(key); //clone.put((Attribute)key.clone(), (Attribute)value.clone()); //if (key != null) clone.put((Attribute)key.clone(), clone(value)); } return clone; }
(SqlWorkItemCoder.AttributeRecord)keyAndValue.get(1); result.put (decodeChild(key.id, key.type, args), decodeChild(value.id, value.type, args));
protected void fillMap (final MapAttribute ma, final org.jdom.Element elt) throws CodingException { java.util.Iterator it = elt.getChildren(ENTRY, elt.getNamespace()).iterator(); while (it.hasNext()) { final org.jdom.Element entry = (org.jdom.Element)it.next(); org.jdom.Element key = entry.getChild(KEY, elt.getNamespace()); org.jdom.Element value = null; // those XmlUtils methods do not care about namespaces if (key == null) { key = XmlUtils.getChild(entry, 0); value = XmlUtils.getChild(entry, 1); } else { key = XmlUtils.getFirstChild(key); value = entry.getChild(VALUE, elt.getNamespace()); value = XmlUtils.getFirstChild(value); } if (key == null || value == null) continue; ma.put(decodeElement(key), decodeElement(value)); } }