List of usage examples for javax.json JsonArray forEach
default void forEach(Consumer<? super T> action)
From source file:de.tu_dortmund.ub.data.dswarm.Transform.java
private JsonArray getMappingsFromProjects(final Collection<String> projectIDs, final String serviceName, final String engineDswarmAPI) throws Exception { final JsonArrayBuilder mappingArrayBuilder = Json.createArrayBuilder(); for (final String projectID : projectIDs) { final JsonArray projectMappings = getMappingsFromProject(projectID, serviceName, engineDswarmAPI); if (projectMappings == null) { LOG.error(String.format("[%s][%d] couldn't determine mappings from project '%s'", serviceName, cnt, projectID));//w w w . ja v a 2s . c o m continue; } LOG.info(String.format("[%s][%d] retrieved '%d' mappings from project '%s'", serviceName, cnt, projectMappings.size(), projectID)); projectMappings.forEach(mappingArrayBuilder::add); } final JsonArray mappingsArray = mappingArrayBuilder.build(); LOG.info(String.format("[%s][%d] accumulated '%d' mappings from all projects", serviceName, cnt, mappingsArray.size())); return mappingsArray; }