/** * The implementation of cget() as defined in the parent * class CollectionAttribute. */ public Attribute cget (final String key) { if (key.equals(K_KEYSET)) return new ListAttribute(this.map.keySet()); return (Attribute)this.map.get(new StringAttribute(key)); }
private static ListAttribute array2owfe (final Object array) { //log.debug("array2owfe()"); final ListAttribute result = new ListAttribute(Array.getLength(array)); //result.setArray(true); for (int i=0; i<Array.getLength(array); i++) result.add(java2owfe(Array.get(array, i))); return result; }
/** * Turns a java List into an OpenWFE ListAttribute */ public static ListAttribute list2owfe (java.util.List l) { ListAttribute result = new ListAttribute(); java.util.Iterator it = l.iterator(); while (it.hasNext()) { result.add(java2owfe(it.next())); } return result; }
public synchronized Object clone () { ListAttribute clone = new ListAttribute(this.size()); java.util.Iterator it = this.list.iterator(); while (it.hasNext()) { Attribute a = (Attribute)it.next(); clone.add((Attribute)a.clone()); } return clone; }
private void expand (final InFlowWorkItem wi, final String fieldName, final String toFieldName, final Attribute a, String separator, final boolean trim) { if (separator.equals("|")) separator = "\\|"; // // there may be other special cases, but for now, it's sufficient // // do the job final String value = a.toString(); final String[] ss = value.split(separator); final ListAttribute la = new ListAttribute(ss.length); for (int i=0; i<ss.length; i++) { String s = ss[i]; if (trim) s = s.trim(); la.add(new StringAttribute(s)); if (log.isDebugEnabled()) log.debug("expand() "+i+" -> '"+s+"'"); } String fn = fieldName; if (toFieldName != null) fn = toFieldName; wi.getAttributes().put(fn, la); }
public Attribute decode (final Object o, final java.util.Map args) throws CodingException { final org.jdom.Element elt = enforceElement(o); ListAttribute la = new ListAttribute(); java.util.Iterator it = elt.getChildren().iterator(); // // there's no getChildren(ns) method... // going on without it for now... while (it.hasNext()) { org.jdom.Element child = (org.jdom.Element)it.next(); AttributeCoder coder = getXmlWorkItemCoder() .getAttributeCoder(child.getName()); Attribute a = coder.decode(child, null); la.add(a); } return la; }
final ListAttribute la = new ListAttribute(); final ListAttribute la = new ListAttribute();
archive = new ListAttribute();