private Object[] addArrayEntry(Object o, Object val, ClassMeta componentType) { Object[] a = (Object[])o; // Expand out the array. Object[] a2 = (Object[])Array.newInstance(a.getClass().getComponentType(), a.length+1); System.arraycopy(a, 0, a2, 0, a.length); a2[a.length] = convert(val, componentType); return a2; }
private Object[] addArrayEntry(Object o, Object val, ClassMeta componentType) { Object[] a = (Object[])o; // Expand out the array. Object[] a2 = (Object[])Array.newInstance(a.getClass().getComponentType(), a.length+1); System.arraycopy(a, 0, a2, 0, a.length); a2[a.length] = convert(val, componentType); return a2; }
private Object[] addArrayEntry(Object o, Object val, ClassMeta componentType) { Object[] a = (Object[])o; // Expand out the array. Object[] a2 = (Object[])Array.newInstance(a.getClass().getComponentType(), a.length+1); System.arraycopy(a, 0, a2, 0, a.length); a2[a.length] = convert(val, componentType); return a2; }
private Object[] setArrayEntry(Object o, int index, Object val, ClassMeta componentType) { Object[] a = (Object[])o; if (a.length <= index) { // Expand out the array. Object[] a2 = (Object[])Array.newInstance(a.getClass().getComponentType(), index+1); System.arraycopy(a, 0, a2, 0, a.length); a = a2; } a[index] = convert(val, componentType); return a; }
private Object[] setArrayEntry(Object o, int index, Object val, ClassMeta componentType) { Object[] a = (Object[])o; if (a.length <= index) { // Expand out the array. Object[] a2 = (Object[])Array.newInstance(a.getClass().getComponentType(), index+1); System.arraycopy(a, 0, a2, 0, a.length); a = a2; } a[index] = convert(val, componentType); return a; }
private Object[] setArrayEntry(Object o, int index, Object val, ClassMeta componentType) { Object[] a = (Object[])o; if (a.length <= index) { // Expand out the array. Object[] a2 = (Object[])Array.newInstance(a.getClass().getComponentType(), index+1); System.arraycopy(a, 0, a2, 0, a.length); a = a2; } a[index] = convert(val, componentType); return a; }
Object o = n.o; if (cm.isMap()) return ((Map)o).put(childKey, convert(val, cm.getValueType())); if (cm.isCollection() && o instanceof List) return ((List)o).set(parseInt(childKey), convert(val, cm.getElementType())); if (cm.isArray()) { o = setArrayEntry(n.o, parseInt(childKey), val, cm.getElementType()); if (cm.isCollection()) { Collection c = (Collection)o; c.add(convert(val, cm.getElementType())); return (c instanceof List ? url + "/" + (c.size()-1) : null); c.add(convert(val, cm.getElementType())); return (c instanceof List ? url + "/" + (c.size()-1) : null);
Object o = n.o; if (cm.isMap()) return ((Map)o).put(childKey, convert(val, cm.getValueType())); if (cm.isCollection() && o instanceof List) return ((List)o).set(parseInt(childKey), convert(val, cm.getElementType())); if (cm.isArray()) { o = setArrayEntry(n.o, parseInt(childKey), val, cm.getElementType()); if (cm.isCollection()) { Collection c = (Collection)o; c.add(convert(val, cm.getElementType())); return (c instanceof List ? url + "/" + (c.size()-1) : null); c.add(convert(val, cm.getElementType())); return (c instanceof List ? url + "/" + (c.size()-1) : null);
Object o = n.o; if (cm.isMap()) return ((Map)o).put(childKey, convert(val, cm.getValueType())); if (cm.isCollection() && o instanceof List) return ((List)o).set(parseInt(childKey), convert(val, cm.getElementType())); if (cm.isArray()) { o = setArrayEntry(n.o, parseInt(childKey), val, cm.getElementType()); if (cm.isCollection()) { Collection c = (Collection)o; c.add(convert(val, cm.getElementType())); return (c instanceof List ? url + "/" + (c.size()-1) : null); c.add(convert(val, cm.getElementType())); return (c instanceof List ? url + "/" + (c.size()-1) : null);