com.googlecode.fascinator.common.JsonObject.get()方法的使用及代码示例

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

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

JsonObject.get介绍

暂无

代码示例

代码示例来源:origin: com.googlecode.redbox-mint/redbox-reports

private String getLabel(String key, JsonObject labelConfig) {
    if (labelConfig.get(key) == null) {
      return key;
    }
    return (String)labelConfig.get(key);
  }
}

代码示例来源:origin: com.googlecode.redbox-mint/redbox-reports

private String getLabel(String key, JsonObject labelConfig) {
    if (labelConfig.get(key) == null) {
      return key;
    }
    return (String)labelConfig.get(key);
  }
}

代码示例来源:origin: com.googlecode.redbox-mint/redbox-reports

private String getLabel(String key, JsonObject labelConfig) {
    if (labelConfig.get(key) == null) {
      return key;
    }
    return (String)labelConfig.get(key);
  }
}

代码示例来源:origin: com.googlecode.redbox-mint/redbox-reports

private String getLabel(String key, JsonObject labelConfig) {
    if (labelConfig.get(key) == null) {
      return key;
    }
    return (String)labelConfig.get(key);
  }
}

代码示例来源:origin: com.googlecode.redbox-mint/redbox-reports

private String processShowCriteria(JsonObject queryFilters) {
  String showOption = (String) ((JsonObject) queryFilters
      .get("showOption")).get("value");
  if ("published".equals(showOption)) {
    strPublished = "true";
    return AND_OPERATOR + "published:true";            
  } else {
    strPublished = "";
  }
  return "";
}

代码示例来源:origin: com.googlecode.redbox-mint/redbox-reports

private String processShowCriteria(JsonObject queryFilters) {
  String showOption = (String) ((JsonObject) queryFilters
      .get("showOption")).get("value");
  if ("published".equals(showOption)) {
    return AND_OPERATOR + "published:true";
  }
  return "";
}

代码示例来源:origin: com.googlecode.redbox-mint/redbox-web-service

private void initialiseKeyMap() {
  Map authorizedKeyMap = new HashMap();
  if (clients != null) {
    for (Object client : clients) {
      JsonObject clientObject = (JsonObject) client;
      authorizedKeyMap.put((String) clientObject.get("apiKey"), (String) clientObject.get("username"));
    }
  }
  this.authorizedKeyMap = Collections.synchronizedMap(authorizedKeyMap);
}

代码示例来源:origin: com.googlecode.redbox-mint/redbox-web-service

private void processDatastream(DigitalObject recordObject, JsonObject datastream) throws StorageException {
  String datastreamId = (String) datastream.get("datastream_id");
  String contents = (String) datastream.get("contents");
  StorageUtils.createOrUpdatePayload(recordObject, datastreamId, IOUtils.toInputStream(contents), "utf-8");
}

代码示例来源:origin: com.googlecode.the-fascinator/fascinator-common

/**
 * Get a list of strings found on the specified node
 *
 * @param json object to retrieve from
 * @param field The field that has the list
 * @return List<String> The resulting list
 */
public static List<String> getStringList(JsonObject json, String field) {
  List<String> response = new LinkedList<String>();
  Object object = json.get(field);
  if (object instanceof JSONArray) {
    return getStringList((JSONArray) object);
  }
  return response;
}

代码示例来源:origin: com.googlecode.redbox-mint/redbox-reports

public JsonObject findJsonObjectWithKey(String keyName) {
  Object[] reportCriteriaOptions = reportCriteriaOptionsJson.getArray(
      "results").toArray();
  for (Object object : reportCriteriaOptions) {
    JsonObject jsonObject = (JsonObject) object;
    if (keyName.equals(jsonObject.get("key"))) {
      return jsonObject;
    }
  }
  return null;
}

代码示例来源:origin: com.googlecode.the-fascinator/fascinator-common

private void processJsonObjectToProperties(JsonObject jsonObject,
      String parentKey, Properties properties) {
    for (Object o : jsonObject.keySet()) {
      String key = (String) o;
      Object value = jsonObject.get(key);
      if (value instanceof String) {
        properties.put(parentKey + "." + key, value);
      } else if (value instanceof JsonObject) {
        processJsonObjectToProperties((JsonObject) value, parentKey
            + "." + key, properties);
      }
    }

  }
}

代码示例来源:origin: com.googlecode.redbox-mint/plugin-transaction-curation-mint

/**
 * Generate an order to add a message to the System's audit log
 * 
 * @param response The response to add an order to
 * @param oid The object ID we are logging
 * @param message The message we want to log
 */
private void audit(JsonSimple response, String oid, String message) {
  JsonObject order = newSubscription(response, oid);
  JsonObject messageObject = (JsonObject) order.get("message");
  messageObject.put("eventType", message);
}

代码示例来源:origin: com.googlecode.redbox-mint/plugin-transaction-curation-redbox

/**
 * Generate an order to add a message to the System's audit log
 * 
 * @param response
 *            The response to add an order to
 * @param oid
 *            The object ID we are logging
 * @param message
 *            The message we want to log
 */
private void audit(JsonSimple response, String oid, String message) {
  JsonObject order = newSubscription(response, oid);
  JsonObject messageObject = (JsonObject) order.get("message");
  messageObject.put("eventType", message);
}

代码示例来源:origin: com.googlecode.the-fascinator/fascinator-common

/**
 * Return the List of SolrFacet objects from this result set.
 *
 * @return List<SolrFacet> : The list of facets
 */
public Map<String, SolrFacet> getFacets() {
  if (facets == null) {
    facets = new LinkedHashMap<String, SolrFacet>();
    JsonObject object = getObject("facet_counts", "facet_fields");
    if (object == null) {
      return null;
    }
    for (Object key : object.keySet()) {
      Object value = object.get(key);
      if (value instanceof JSONArray) {
        facets.put((String) key,
            new SolrFacet((String) key, (JSONArray) value));
      }
    }
  }
  return facets;
}

代码示例来源:origin: com.googlecode.the-fascinator/fascinator-common

/**
 * <p>
 * Take all of the JsonObjects found in a JsonObject, wrap them in
 * JsonSimple objects, then add to a Java Map and return.
 * </p>
 *
 * All entries found that are not JsonObjects are ignored.
 *
 * @return String : The JSON String
 */
public static Map<String, JsonSimple> toJavaMap(JsonObject object) {
  Map<String, JsonSimple> response = new LinkedHashMap<String, JsonSimple>();
  if (object != null && !object.isEmpty()) {
    for (Object key : object.keySet()) {
      Object child = object.get(key);
      if (child != null && child instanceof JsonObject) {
        response.put((String) key,
            new JsonSimple((JsonObject) child));
      }
    }
  }
  return response;
}

代码示例来源:origin: com.googlecode.the-fascinator.plugins/plugin-roles-internal

public void setConfig(JsonSimpleConfig config) throws IOException {
  // Get the basics
  file_path   = config.getString(null, "roles", "internal", "path");
  loadRoles();
  JSONArray roleJsonArray = (JSONArray)config.getObject("roles", "internal").get("defaultRoles");
  if(roleJsonArray != null) {
    defaultRoles = Arrays.copyOf(roleJsonArray.toArray(), roleJsonArray.size(), String[].class);
  }
}

代码示例来源:origin: com.googlecode.the-fascinator/fascinator-common

/**
 * Retrieve the given node from the provided object.
 *
 * @param path : An array of indeterminate length to use as the path
 * @return JsonObject : The JSON representation
 */
private Object getNode(Object object, Object path) {
  if (isArray(object)) {
    try {
      return ((JSONArray) object).get((Integer) path);
    } catch(ArrayIndexOutOfBoundsException ex) {
      return null;
    }
  }
  if (isObject(object)) {
    return ((JsonObject) object).get(path);
  }
  return null;
}

代码示例来源:origin: com.googlecode.redbox-mint/plugin-transaction-curation-mint

/**
 * Generate an order to send an email to the intended recipient
 * 
 * @param response The response to add an order to
 * @param message The message we want to send
 */
private void email(JsonSimple response, String oid, String text) {
  JsonObject object = newMessage(response,
      EmailNotificationConsumer.LISTENER_ID);
  JsonObject message = (JsonObject) object.get("message");
  message.put("to", emailAddress);
  message.put("body", text);
  message.put("oid", oid);
}

代码示例来源:origin: com.googlecode.redbox-mint/plugin-transaction-curation-redbox

/**
 * Generate an order to send an email to the intended recipient
 * 
 * @param response
 *            The response to add an order to
 * @param message
 *            The message we want to send
 */
private void email(JsonSimple response, String oid, String text) {
  JsonObject object = newMessage(response,
      EmailNotificationConsumer.LISTENER_ID);
  JsonObject message = (JsonObject) object.get("message");
  message.put("to", emailAddress);
  message.put("body", text);
  message.put("oid", oid);
}

代码示例来源:origin: com.googlecode.the-fascinator/fascinator-common

public boolean move(String id, String destination) {
  // Find our nodes
  JsonObject toRemove = getWritableParent(id);
  JsonObject toMove = getWritableNode(destination);
  // Confirm validity of request
  if (toRemove == null || toMove == null) {
    return false;
  }
  // Now actually move it
  toMove.put(id, toRemove.get(id));
  toRemove.remove(id);
  // Update metadata
  getNode(id).setParentKey(destination);
  return true;
}

相关文章