@Test public void getExternalId() { assertThat(ExternalIdUtil.getUrlFromExternalId("{ \"data\": [[]]}"), is("{}")); assertThat(ExternalIdUtil.getUrlFromExternalId("{ \"data\": []}"), is("{}")); assertThat(ExternalIdUtil.getUrlFromExternalId("{}"), is("{}")); }
public static String getUrlFromExternalId(String jsonString) { String externalId = null; try { JsonNode jsonNode = new ObjectMapper().readTree(jsonString); JsonNode data = jsonNode.get("data"); if (data != null) { for (JsonNode row : data) { for (JsonNode cell : row) { externalId = cell.asText(); } } } } catch (IOException e) { } return buildJsonUrl(urlForExternalId(externalId)); }
ExternalIdUtil { public static String getUrlFromExternalId(String jsonString) { String externalId = null; try { JsonNode jsonNode = new ObjectMapper().readTree(jsonString); JsonNode data = jsonNode.get("data"); if (data != null) { for (JsonNode row : data) { for (JsonNode cell : row) { externalId = cell.asText(); } } } } catch (IOException e) { } return buildJsonUrl(urlForExternalId(externalId)); } }
ExternalIdUtil { public static String getUrlFromExternalId(String jsonString) { String externalId = null; try { JsonNode jsonNode = new ObjectMapper().readTree(jsonString); JsonNode data = jsonNode.get("data"); if (data != null) { for (JsonNode row : data) { for (JsonNode cell : row) { externalId = cell.asText(); } } } } catch (IOException e) { } return buildJsonUrl(urlForExternalId(externalId)); }  }
ExternalIdUtil { public static String getUrlFromExternalId(String jsonString) { String externalId = null; try { JsonNode jsonNode = new ObjectMapper().readTree(jsonString); JsonNode data = jsonNode.get("data"); if (data != null) { for (JsonNode row : data) { for (JsonNode cell : row) { externalId = cell.asText(); } } } } catch (IOException e) { } return buildJsonUrl(urlForExternalId(externalId)); }  static String urlForExternalId(String externalId); static boolean isIRMNG(String idPrefix); static String urlForIRMNG(String externalId, String idPrefix); static Map<String, String> getURLPrefixMap(); static Map<String, String> getURLSuffixMap(); static boolean isSupported(String externalId); static TaxonomyProvider taxonomyProviderFor(String externalId); static String getUrlFromExternalId(String jsonString); static String buildJsonUrl(String url); static String toCitation(String contributor, String description, String publicationYear); static String selectValue(Map<String, String> link, String[] candidateIdsInIncreasingPreference); static boolean hasProperty(Map<String, String> link, String propertyName); static String stripPrefix(TaxonomyProvider provider, String externalId); static String prefixForUrl(String url); static boolean isLikelyId(String idCandidate); static boolean isUnlikelyId(String idCandidate); }
ExternalIdUtil { public static String getUrlFromExternalId(String jsonString) { String externalId = null; try { JsonNode jsonNode = new ObjectMapper().readTree(jsonString); JsonNode data = jsonNode.get("data"); if (data != null) { for (JsonNode row : data) { for (JsonNode cell : row) { externalId = cell.asText(); } } } } catch (IOException e) { } return buildJsonUrl(urlForExternalId(externalId)); }  static String urlForExternalId(String externalId); static boolean isIRMNG(String idPrefix); static String urlForIRMNG(String externalId, String idPrefix); static Map<String, String> getURLPrefixMap(); static Map<String, String> getURLSuffixMap(); static boolean isSupported(String externalId); static TaxonomyProvider taxonomyProviderFor(String externalId); static String getUrlFromExternalId(String jsonString); static String buildJsonUrl(String url); static String toCitation(String contributor, String description, String publicationYear); static String selectValue(Map<String, String> link, String[] candidateIdsInIncreasingPreference); static boolean hasProperty(Map<String, String> link, String propertyName); static String stripPrefix(TaxonomyProvider provider, String externalId); static String prefixForUrl(String url); static boolean isLikelyId(String idCandidate); static boolean isUnlikelyId(String idCandidate);  }