/** * <p> * Retrieve a list of Strings found on the given path. Note that this is a * utility function, and not designed for data traversal. It <b>will</b> * only retrieve Strings found on the provided node, and the node must be a * JSONArray. * </p> * * @param path : An array of indeterminate length to use as the path * @return List<String> : A list of Strings, null if the node is not found */ @Override public List<String> getStringList(Object... path) { List<String> list = super.getStringList(path); if (list == null && systemConfig != null) { return systemConfig.getStringList(path); } return list; }
/** * Gets a string list from a JsonSimple object. Convenience method to return * an empty list instead of null if the node was not found. * * @param json a JsonSimple object * @param path path to the node * @return string list found at node, or empty if not found */ private List<String> getStringList(JsonSimple json, Object... path) { List<String> list = json.getStringList(path); if (list == null) { list = Collections.emptyList(); } return list; }
/** * 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; }
return JsonSimple.getStringList((JSONArray) object);
return JsonSimple.getStringList((JSONArray) object);
List<String> array = JsonSimple.getStringList((JSONArray) object); Object first = array.get(0); if (first instanceof String) {
List<String> array = JsonSimple.getStringList((JSONArray) object); if (array.size() == 1) { return (String) array.get(0);
List<String> array = JsonSimple.getStringList((JSONArray) object); Object first = array.get(0); if (first instanceof String) {
List<String> array = JsonSimple.getStringList((JSONArray) object); if (array.size() == 1) { return array.get(0);
@SuppressWarnings(value = { "unchecked" }) private void loadIncludedDir(JsonSimple config) { List<String> extList = config.getStringList(INCLUDE_DIR_KEY_EXT); log.trace( "Inclusion directory found:'" + INCLUDE_DIR_KEY
if (isArray(target)) { if (substitueProperties) { List<String> temp = JsonSimple.getStringList((JSONArray) target); for (String string : temp) { response.add(StrSubstitutor.replaceSystemProperties(string)); return JsonSimple.getStringList((JSONArray) target);
List<String> toList = config.getStringList("to"); List<String> ccList = config.getStringList("cc"); String fromAddress = config.getString(this.fromAddress, "from", "address");
/** * Generate orders for the list of normal transformers scheduled to execute * on the tool chain * * @param message * The incoming message, which contains the tool chain config for * this object * @param response * The response to edit * @param oid * The object to schedule for clearing */ private void scheduleTransformers(JsonSimple message, JsonSimple response) { String oid = message.getString(null, "oid"); List<String> list = message.getStringList("transformer", "metadata"); if (list != null && !list.isEmpty()) { for (String id : list) { JsonObject order = newTransform(response, id, oid); // Add item config to message... if it exists JsonObject itemConfig = message.getObject( "transformerOverrides", id); if (itemConfig != null) { JsonObject config = (JsonObject) order.get("config"); config.putAll(itemConfig); } } } }
/** * Generate orders for the list of normal transformers scheduled to execute * on the tool chain * * @param message The incoming message, which contains the tool chain config * for this object * @param response The response to edit * @param oid The object to schedule for clearing */ private void scheduleTransformers(JsonSimple message, JsonSimple response) { String oid = message.getString(null, "oid"); List<String> list = message.getStringList( "transformer", "metadata"); if (list != null && !list.isEmpty()) { for (String id : list) { JsonObject order = newTransform(response, id, oid); // Add item config to message... if it exists JsonObject itemConfig = message.getObject( "transformerOverrides", id); if (itemConfig != null) { JsonObject config = (JsonObject) order.get("config"); config.putAll(itemConfig); } } } }
List<String> exPath = config.getStringList("excludeCondition", "path"); String exValue = config.getString(null, "excludeCondition", "value"); if (exPath != null && !exPath.isEmpty() && exValue != null) { List<String> idPath = config.getStringList("identifier"); if (idPath == null || idPath.isEmpty()) { log.error("Ignoring invalid relationship '{}'. No 'identifier'" if (staticRelation == null) { relPath = config.getStringList("relationship");
log.error("Error accessing item configuration!"); } else { List<String> list = itemConfig.getStringList("transformer", "curation");
log.error("Error accessing item configuration!"); } else { List<String> list = itemConfig.getStringList( "transformer", "curation");
List<String> basePath = relationConfig.getStringList("path"); if (basePath == null || basePath.isEmpty()) { log.error("Ignoring invalid relationship '{}'. No 'path'"
if (name.startsWith("redbox")) { String query = (String)jsonStat.get("query"); List<String> fq = config.getStringList("config", "stats", idx, "params", "fq"); String rows = config.getString("0", "config", "stats", idx, "params", "rows"); stat = new Stat(name, query, fq, rows);
metadataPrefixes = JsonSimple.getStringList(configNode, "metadataPrefix"); if (metadataPrefixes == null || metadataPrefixes.isEmpty()) {