/** * Set the type of this manifest * * @param type : The new type */ public void setType(String type) { getJsonObject().put("packageType", type); }
/** * Set the hidden flag for this node. * * @param hidden : The new flag */ public void setHidden(boolean hidden) { getJsonObject().put("hidden", hidden); }
/** * Creates JSON Configuration object from the system config file * * @throws IOException if there was an error during creation */ public JsonSimpleConfig() throws IOException { super(JsonSimpleConfig.getSystemFile()); systemConfig = new JsonSimple(JsonSimpleConfig.getSystemFile()); loadIncludeDir(); }
private JsonObject createNewOrder(JsonSimple response, String type) { JsonObject order = response.writeObject("orders", -1); order.put("type", type); return order; }
/** * Return the String representation of this object's JSON, optionally * formatted for human readability. * * @return String : The JSON String */ public String toString(boolean pretty) { // Simple, just a plain old string if (!pretty) { return jsonObject.toJSONString(); } // More complicated return printNode(null, getJsonObject(), ""); }
/** * Creates a JSON object from the specified string * * @param jsonIn a JSON string * @throws IOException if there was an error parsing the string */ public JsonSimple(String jsonString) throws IOException { substitueProperties = true; if (jsonString == null) { jsonObject = new JsonObject(); } else { parse(jsonString); } }
/** * Create a new empty node * */ public ManifestNode() { super(new JsonObject()); }
public boolean delete(String id) { JsonObject toRemove = getWritableParent(id); // Confirm validity of request if (toRemove == null) { return false; } toRemove.remove(id); return true; }
/** * Get the description for this manifest * * @return String : The description of this manifest */ public String getDescription() { return getString(null, "description"); }
/** * Convert Json to String * * @return Json configuration in String */ @Override public String toString() { return toString(true); }
/** * Creates JSON Configuration object from the provided config file * * @param jsonFile : The file containing JSON * @throws IOException if there was an error during creation */ public JsonSimpleConfig(File jsonFile) throws IOException { super(jsonFile); systemConfig = new JsonSimple(JsonSimpleConfig.getSystemFile()); loadIncludeDir(); }
/** * Set the 'viewId' node for this manifest * * @param viewId : The new viewId */ public void setViewId(String viewId) { getJsonObject().put("viewId", viewId); } }
private JsonObject createNewOrder(JsonSimple response, String type) { JsonObject order = response.writeObject("orders", -1); order.put("type", type); return order; }
/** * Set the ID for this node. * * @param id : The new ID */ public void setId(String id) { getJsonObject().put("id", id); }
/** * Creates JSON Configuration object from the provided input stream * * @param jsonIn : The input stream to read * @throws IOException if there was an error during creation */ public JsonSimpleConfig(InputStream jsonIn) throws IOException { super(jsonIn); systemConfig = new JsonSimple(JsonSimpleConfig.getSystemFile()); loadIncludeDir(); }
/** * Set the description for this manifest * * @param description : The new description */ public void setDescription(String description) { getJsonObject().put("description", description); }
/** * Set the title for this node. * * @param title : The new title */ public void setTitle(String title) { getJsonObject().put("title", title); } }
/** * Creates JSON Configuration object from the provided config string * * @param jsonString : The JSON in string form * @throws IOException if there was an error during creation */ public JsonSimpleConfig(String jsonString) throws IOException { super(jsonString); systemConfig = new JsonSimple(JsonSimpleConfig.getSystemFile()); loadIncludeDir(); }
/** * Set the title for this manifest * * @param title : The new title */ public void setTitle(String title) { getJsonObject().put("title", title); }