org.apache.sling.commons.json.JSONObject.isNull()方法的使用及代码示例

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

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

JSONObject.isNull介绍

[英]Determine if the value associated with the key is null or if there is no value.
[中]确定与键关联的值是null还是没有值。

代码示例

代码示例来源:origin: org.apache.sling/org.apache.sling.commons.json

/**
   * Convert a JSONObject into a cookie list. A cookie list is a sequence
   * of name/value pairs. The names are separated from the values by '='.
   * The pairs are separated by ';'. The characters '%', '+', '=', and ';'
   * in the names and values are replaced by "%hh".
   * @param o A JSONObject
   * @return A cookie list string
   * @throws JSONException
   */
  public static String toString(JSONObject o) throws JSONException {
    boolean      b = false;
    Iterator<String>     keys = o.keys();
    String       s;
    StringBuffer sb = new StringBuffer();
    while (keys.hasNext()) {
      s = keys.next();
      if (!o.isNull(s)) {
        if (b) {
          sb.append(';');
        }
        sb.append(Cookie.escape(s));
        sb.append("=");
        sb.append(Cookie.escape(o.getString(s)));
        b = true;
      }
    }
    return sb.toString();
  }
}

代码示例来源:origin: org.apache.sling/org.apache.sling.commons.json

if (!s.equals("HTTP-Version")      && !s.equals("Status-Code") &&
    !s.equals("Reason-Phrase") && !s.equals("Method") &&
    !s.equals("Request-URI")   && !o.isNull(s)) {
  sb.append(s);
  sb.append(": ");

代码示例来源:origin: io.wcm/io.wcm.caconfig.editor

if (propertyType == ConfigurationMetadata.class || properties.isNull(propertyName)) {

相关文章