@Override public void removeProperty(Object obj, Object key) { try { if( obj instanceof org.codehaus.jettison.json.JSONArray ) { int index = key instanceof Integer? (Integer) key : Integer.parseInt(key.toString()); if( index<length(obj) ) { Object temp = new Object(); // Need FIX: JSONArray.remove(int) ((org.codehaus.jettison.json.JSONArray)obj).put(index, temp); ((org.codehaus.jettison.json.JSONArray)obj).remove(temp); } } if( obj instanceof org.codehaus.jettison.json.JSONObject ) { ((org.codehaus.jettison.json.JSONObject)obj).remove(String.valueOf(key)); } } catch( org.codehaus.jettison.json.JSONException jsonException ) { throw new IllegalStateException(jsonException); } }
@Override public void removeProperty(Object obj, Object key) { try { if( obj instanceof org.codehaus.jettison.json.JSONArray ) { int index = key instanceof Integer? (Integer) key : Integer.parseInt(key.toString()); if( index<length(obj) ) { Object temp = new Object(); // Need FIX: JSONArray.remove(int) ((org.codehaus.jettison.json.JSONArray)obj).put(index, temp); ((org.codehaus.jettison.json.JSONArray)obj).remove(temp); } } if( obj instanceof org.codehaus.jettison.json.JSONObject ) { ((org.codehaus.jettison.json.JSONObject)obj).remove(String.valueOf(key)); } } catch( org.codehaus.jettison.json.JSONException jsonException ) { throw new IllegalStateException(jsonException); } }
protected JSONObject getRemoveJsonObject( JSONArray entitiesNode, int index, boolean doRemove ) { try { JSONObject jsonObject = entitiesNode.getJSONObject( index ); if( doRemove ) entitiesNode.remove( jsonObject ); return jsonObject; } catch( JSONException exception ) { throw new CascadingException( exception ); } }
protected JSONObject getRemoveJsonObject( JSONArray entitiesNode, int index, boolean doRemove ) { try { JSONObject jsonObject = entitiesNode.getJSONObject( index ); if( doRemove ) entitiesNode.remove( jsonObject ); return jsonObject; } catch( JSONException exception ) { throw new CascadingException( exception ); } }
@Override public void removeProperty(Object obj, Object key) { try { if( obj instanceof org.codehaus.jettison.json.JSONArray ) { int index = key instanceof Integer? (Integer) key : Integer.parseInt(key.toString()); if( index<length(obj) ) { Object temp = new Object(); // Need FIX: JSONArray.remove(int) ((org.codehaus.jettison.json.JSONArray)obj).put(index, temp); ((org.codehaus.jettison.json.JSONArray)obj).remove(temp); } } if( obj instanceof org.codehaus.jettison.json.JSONObject ) { ((org.codehaus.jettison.json.JSONObject)obj).remove(String.valueOf(key)); } } catch( org.codehaus.jettison.json.JSONException jsonException ) { throw new IllegalStateException(jsonException); } }