public QueueMessage() { this._modifiedColumns = new ArrayList<String>(); this._modifiedColumns.add("createdAt"); this._modifiedColumns.add("updatedAt"); this._modifiedColumns.add("ACL"); this._modifiedColumns.add("expires"); this._modifiedColumns.add("timeout"); this._modifiedColumns.add("delay"); this._modifiedColumns.add("message"); this.acl = new ACL(); document = new JSONObject(); try { document.put("_id", JSONObject.NULL); document.put("timeout", timeout); document.put("delay", JSONObject.NULL); document.put("_type", type); document.put("ACL", acl.getACL()); document.put("expires", JSONObject.NULL); document.put("_modifiedColumns", this._modifiedColumns); document.put("_isModified", true); document.put("message", message); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
public void addElement(String key, Object val) { try { document.put(key, val); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } }