/** * 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(); } }