本文整理了Java中com.github.openjson.JSONArray.optString()
方法的一些代码示例,展示了JSONArray.optString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSONArray.optString()
方法的具体详情如下:
包路径:com.github.openjson.JSONArray
类名称:JSONArray
方法名:optString
[英]Returns the value at index if it exists, coercing it if necessary. Returns the empty string if no such value exists.
[中]返回索引处的值(如果存在),必要时强制该值。如果不存在此类值,则返回空字符串。
代码示例来源:origin: com.github.openjson/openjson
/**
* Returns the value at {@code index} if it exists, coercing it if
* necessary. Returns the empty string if no such value exists.
*
* @param index Which value to get.
* @return the value at the specified location.
*/
public String optString(int index) {
return optString(index, "");
}
代码示例来源:origin: org.wicketstuff/wicketstuff-tinymce3
@SuppressWarnings("unchecked")
private void doSuggest(final String cmd, final String id, final JSONArray paramArray)
{
final SpellChecker checker = new SpellChecker(dict);
String word = paramArray.optString(1);
List<String> suggestions = checker.getSuggestions(word, 2);
respond(suggestions.iterator(), cmd, id);
}
代码示例来源:origin: org.wicketstuff/wicketstuff-tinymce4
@SuppressWarnings("unchecked")
private void doSuggest(final String cmd, final String id, final JSONArray paramArray)
{
final SpellChecker checker = new SpellChecker(dict);
String word = paramArray.optString(1);
List<String> suggestions = checker.getSuggestions(word, 2);
respond(suggestions.iterator(), cmd, id);
}
内容来源于网络,如有侵权,请联系作者删除!