net.sf.json.JSONException.getMessage()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(128)

本文整理了Java中net.sf.json.JSONException.getMessage()方法的一些代码示例,展示了JSONException.getMessage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSONException.getMessage()方法的具体详情如下:
包路径:net.sf.json.JSONException
类名称:JSONException
方法名:getMessage

JSONException.getMessage介绍

暂无

代码示例

代码示例来源:origin: jenkinsci/jenkins

@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");
    }
  }
}

代码示例来源:origin: geoserver/geoserver

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

代码示例来源:origin: geoserver/geoserver

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

代码示例来源:origin: com.aliyun.openservices/aliyun-log

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, "");
  }
}

代码示例来源:origin: com.aliyun.openservices/aliyun-log

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

代码示例来源:origin: com.aliyun.openservices/aliyun-log

@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, "");
  }
}

代码示例来源:origin: com.aliyun.openservices/aliyun-log

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, "");
  }
}

代码示例来源:origin: com.aliyun.openservices/aliyun-log

public void FromJsonArray(JSONArray array) throws LogException {
  try {
    SetMachineList(array);
  } catch (JSONException e) {
    throw new LogException("FailToGenerateMachineList", e.getMessage(), e, "");
  }
}

代码示例来源:origin: aliyun/aliyun-log-java-sdk

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, "");
  }
}

代码示例来源:origin: aliyun/aliyun-log-java-sdk

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, "");
  }
}

代码示例来源:origin: com.aliyun.openservices/aliyun-log

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, "");
    }
  }
}

代码示例来源:origin: com.aliyun.openservices/aliyun-log

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, "");
    }
  }
}

代码示例来源:origin: com.aliyun.openservices/aliyun-log

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, "");
    }
  }
}

代码示例来源:origin: com.aliyun.openservices/aliyun-log

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, "");
    }
  }
}

代码示例来源:origin: com.aliyun.openservices/aliyun-log

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, "");
    }
  }
}

代码示例来源:origin: com.aliyun.openservices/aliyun-log

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, "");
    }
  }
}

代码示例来源:origin: com.aliyun.openservices/aliyun-log

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, "");
    }
  }
}

代码示例来源:origin: com.aliyun.openservices/aliyun-log

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, "");
    }
  }
}

代码示例来源:origin: aliyun/aliyun-log-java-sdk

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, "");
  }
}

代码示例来源:origin: aliyun/aliyun-log-java-sdk

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, "");
    }
  }
}

相关文章

微信公众号

最新文章

更多