/** * Parses a container in JSON notation. * * @param json The container configuration in JSON notation. * @return A parsed container configuration. * @throws JSONException If there was a problem parsing the container. */ public static Map<String, Object> parseJsonContainer(String json) throws JSONException { return parseJsonContainer(new JSONObject(json)); }
/** * Parses a container in JSON notation. * * @param json The container configuration in JSON notation. * @return A parsed container configuration. * @throws JSONException If there was a problem parsing the container. */ public static Map<String, Object> parseJsonContainer(String json) throws JSONException { return parseJsonContainer(new JSONObject(json)); }
/** * Parses a container in JSON notation. * * @param json The container configuration in JSON notation. * @return A parsed container configuration. * @throws JSONException If there was a problem parsing the container. */ public static Map<String, Object> parseJsonContainer(String json) throws JSONException { return parseJsonContainer(new JSONObject(json)); }
/** * Creates a new configuration from a JSON Object, for use in testing. * @throws ContainerConfigException */ public JsonContainerConfig(JSONObject json, Expressions expressions) throws ContainerConfigException { super(expressions); Transaction transaction = newTransaction(); Iterator<?> keys = json.keys(); while (keys.hasNext()) { JSONObject optJSONObject = json.optJSONObject((String) keys.next()); if (optJSONObject != null) { transaction.addContainer(JsonContainerConfigLoader.parseJsonContainer(optJSONObject)); } } transaction.commit(); } }
/** * Creates a new configuration from a JSON Object, for use in testing. * @throws ContainerConfigException */ public JsonContainerConfig(JSONObject json, Expressions expressions) throws ContainerConfigException { super(expressions); Transaction transaction = newTransaction(); Iterator<?> keys = json.keys(); while (keys.hasNext()) { JSONObject optJSONObject = json.optJSONObject((String) keys.next()); if (optJSONObject != null) { transaction.addContainer(JsonContainerConfigLoader.parseJsonContainer(optJSONObject)); } } transaction.commit(); } }
/** * Creates a new configuration from a JSON Object, for use in testing. * @throws ContainerConfigException */ public JsonContainerConfig(JSONObject json, Expressions expressions) throws ContainerConfigException { super(expressions); Transaction transaction = newTransaction(); Iterator<?> keys = json.keys(); while (keys.hasNext()) { JSONObject optJSONObject = json.optJSONObject((String) keys.next()); if (optJSONObject != null) { transaction.addContainer(JsonContainerConfigLoader.parseJsonContainer(optJSONObject)); } } transaction.commit(); } }