@Override public boolean configure(StaplerRequest req, JSONObject json) throws FormException { try { // for compatibility reasons, this value is stored in Jenkins Jenkins.get().setScmCheckoutRetryCount(json.getInt("scmCheckoutRetryCount")); return true; } catch (IOException e) { throw new FormException(e,"quietPeriod"); } catch (JSONException e) { throw new FormException(e.getMessage(), "quietPeriod"); } } }
/** * @param str a JSON array representation of a list of {@link AuthorityURLInfo} objects * @return the list of parsed authrority URL from the argument JSON array * @throws IllegalArgumentException if {@code str} can't be parsed to a JSONArray */ public static List<AuthorityURLInfo> fromString(String str) throws IllegalArgumentException { try { final JSONArray array; array = JSONArray.fromObject(str); final int size = array.size(); List<AuthorityURLInfo> list = new ArrayList<AuthorityURLInfo>(size); JSONObject jsonAuth; for (int i = 0; i < size; i++) { jsonAuth = array.getJSONObject(i); AuthorityURL auth = new AuthorityURL(); auth.setName(jsonAuth.getString(NAME)); auth.setHref(jsonAuth.getString(HREF)); list.add(auth); } return list; } catch (JSONException e) { throw new IllegalArgumentException(e.getMessage(), e); } }
/** * @param str a JSON array representation of a list of {@link LayerIdentifierInfo} objects * @return the list of parsed layer identifiers from the argument JSON array * @throws IllegalArgumentException if {@code str} can't be parsed to a JSONArray */ public static List<LayerIdentifierInfo> fromString(String str) throws IllegalArgumentException { try { final JSONArray array; array = JSONArray.fromObject(str); final int size = array.size(); List<LayerIdentifierInfo> list = new ArrayList<LayerIdentifierInfo>(size); JSONObject jsonAuth; for (int i = 0; i < size; i++) { jsonAuth = array.getJSONObject(i); LayerIdentifier id = new LayerIdentifier(); id.setAuthority(jsonAuth.getString(AUTHORITY)); id.setIdentifier(jsonAuth.getString(IDENTIFIER)); list.add(id); } return list; } catch (JSONException e) { throw new IllegalArgumentException(e.getMessage(), e); } }
public void FromJsonObject(JSONObject groupAttribute) throws LogException { try { this.externalName = groupAttribute.getString("externalName"); this.groupTopic = groupAttribute.getString("groupTopic"); } catch (JSONException e) { throw new LogException("FailToGenerateGroupAttribute", e.getMessage(), e, ""); } }
public void FromJsonObject(JSONObject obj) throws LogException { try { mDescription = obj.getString("description"); mStatus = obj.getString("status"); mRegion = obj.getString("region"); mOwner = obj.getString("owner"); } catch (JSONException e) { throw new LogException("InvalidErrorResponse", e.getMessage(), GetRequestId()); } }
@Override public void FromJsonObject(JSONObject inputDetail) throws LogException { try { CommonConfigFromJsonObject(inputDetail); this.tag = inputDetail.getString(Consts.CONST_CONFIG_INPUTDETAIL_TAG); } catch (JSONException e) { throw new LogException("FailToGenerateInputDetail", e.getMessage(), e, ""); } }
public void SetKey(JSONArray key) throws LogException { try { this.key = new ArrayList<String>(); for (int i = 0; i < key.size(); i++) { this.key.add(key.getString(i)); } } catch (JSONException e) { throw new LogException("FailToSetKey", e.getMessage(), e, ""); } }
public void FromJsonArray(JSONArray array) throws LogException { try { SetMachineList(array); } catch (JSONException e) { throw new LogException("FailToGenerateMachineList", e.getMessage(), e, ""); } }
public void SetShardHashKey(JSONArray shardHashKey) throws LogException { try { this.shardHashKey = new ArrayList<String>(); for (int i = 0; i < shardHashKey.size(); i++) this.shardHashKey.add(shardHashKey.getString(i)); } catch (JSONException e) { throw new LogException("FailToSetShardHashKey", e.getMessage(), e, ""); } }
public void FromJsonObject(JSONObject dict) throws LogException { try { setName(dict.getString("name")); setType(dict.getString("type")); } catch (JSONException e) { throw new LogException("FailToGenerateColumn", e.getMessage(), e, ""); } }
public void FromJsonString(String configString) throws LogException { try { JSONObject dict = JSONObject.fromObject(configString); FromJsonObject(dict); } catch (JSONException e) { throw new LogException("FailToGenerateConfig", e.getMessage(), e, ""); } } }
public void FromJsonString(String machineListString) throws LogException { try { JSONArray machineArray = JSONArray.fromObject(machineListString); FromJsonArray(machineArray); } catch (JSONException e) { throw new LogException("FailToGenerateMachineGroup", e.getMessage(), e, ""); } } }
public void FromJsonString(String logtailProfileString) throws LogException { try { JSONObject dict = JSONObject.fromObject(logtailProfileString); FromJsonObject(dict); } catch (JSONException e) { throw new LogException("FailToGenerateLogtailProfile", e.getMessage(), e, ""); } } }
public void FromJsonString(String sensitiveKeyString) throws LogException { try { JSONObject dict = JSONObject.fromObject(sensitiveKeyString); FromJsonObject(dict); } catch (JSONException e) { throw new LogException("FailToGenerateChart", e.getMessage(), e, ""); } } }
public void FromJsonString(String groupAttributeString) throws LogException { try { JSONObject groupAttribute = JSONObject.fromObject(groupAttributeString); FromJsonObject(groupAttribute); } catch (JSONException e) { throw new LogException("FailToGenerateGroupAttribute", e.getMessage(), e, ""); } } }
public void FromJsonString(String projectString) throws LogException { try { JSONObject dict = JSONObject.fromObject(projectString); FromJsonObject(dict); } catch (JSONException e) { throw new LogException("FailToGenerateProject", e.getMessage(), e, ""); } } }
public void FromJsonString(String machineGroupString) throws LogException { try { JSONObject dict = JSONObject.fromObject(machineGroupString); FromJsonObject(dict); } catch (JSONException e) { throw new LogException("FailToGenerateMachineGroup", e.getMessage(), e, ""); } } }
public void FromJsonString(String chartString) throws LogException { try { JSONObject dict = JSONObject.fromObject(chartString); FromJsonObject(dict); } catch (JSONException e) { throw new LogException("FailToGenerateChart", e.getMessage(), e, ""); } } }
public static CommonConfigInputDetail FromJsonStringS(final String inputType, final String jsonString) throws LogException { try { JSONObject inputDetail = JSONObject.fromObject(jsonString); return FromJsonObjectS(inputType, inputDetail); } catch (JSONException e) { throw new LogException("FailToGenerateInputDetail", e.getMessage(), e, ""); } }
public void FromJsonString(String chartString) throws LogException { try { JSONObject dict = JSONObject.fromObject(chartString); FromJsonObject(dict); } catch (JSONException e) { throw new LogException("FailToGenerateChart", e.getMessage(), e, ""); } } }