本文整理了Java中org.json.JSONObject.optQuery()
方法的一些代码示例,展示了JSONObject.optQuery()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSONObject.optQuery()
方法的具体详情如下:
包路径:org.json.JSONObject
类名称:JSONObject
方法名:optQuery
[英]Queries and returns a value from this object using jsonPointer, or returns null if the query fails due to a missing key.
[中]使用jsonPointer查询并返回此对象中的值,如果由于缺少键而导致查询失败,则返回null。
代码示例来源:origin: loklak/loklak_server
/**
* Queries and returns a value from this object using {@code jsonPointer}, or
* returns null if the query fails due to a missing key.
*
* @param jsonPointer the string representation of the JSON pointer
* @return the queried value or {@code null}
* @throws IllegalArgumentException if {@code jsonPointer} has invalid syntax
*/
public Object optQuery(String jsonPointer) {
return optQuery(new JSONPointer(jsonPointer));
}
代码示例来源:origin: b3log/latke
/**
* Queries and returns a value from this object using {@code jsonPointer}, or
* returns null if the query fails due to a missing key.
*
* @param jsonPointer the string representation of the JSON pointer
* @return the queried value or {@code null}
* @throws IllegalArgumentException if {@code jsonPointer} has invalid syntax
*/
public Object optQuery(String jsonPointer) {
return optQuery(new JSONPointer(jsonPointer));
}
代码示例来源:origin: org.b3log/latke
/**
* Queries and returns a value from this object using {@code jsonPointer}, or
* returns null if the query fails due to a missing key.
*
* @param jsonPointer the string representation of the JSON pointer
* @return the queried value or {@code null}
* @throws IllegalArgumentException if {@code jsonPointer} has invalid syntax
*/
public Object optQuery(String jsonPointer) {
return optQuery(new JSONPointer(jsonPointer));
}
内容来源于网络,如有侵权,请联系作者删除!