Changeset 7279 for FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/utils/SimpleEndpointDescriptionParser.java
- Timestamp:
- 01/10/22 12:04:49 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/utils/SimpleEndpointDescriptionParser.java
r7273 r7279 185 185 186 186 // capabilities 187 List<URI> capabilities = new ArrayList< URI>();187 List<URI> capabilities = new ArrayList<>(); 188 188 exp = xpath.compile("//ed:Capabilities/ed:Capability"); 189 189 NodeList list = … … 225 225 226 226 // used to check for uniqueness of id attribute 227 final Set<String> xml_ids = new HashSet< String>();227 final Set<String> xml_ids = new HashSet<>(); 228 228 229 229 // supported data views 230 List<DataView> supportedDataViews = new ArrayList< DataView>();230 List<DataView> supportedDataViews = new ArrayList<>(); 231 231 exp = xpath.compile("//ed:SupportedDataViews/ed:SupportedDataView"); 232 232 list = (NodeList) exp.evaluate(doc, XPathConstants.NODESET); … … 406 406 407 407 if (supportedLayers == null) { 408 supportedLayers = new ArrayList< Layer>(list.getLength());408 supportedLayers = new ArrayList<>(list.getLength()); 409 409 } 410 410 supportedLayers.add(new Layer(id, resultId, type, encoding, … … 426 426 exp = xpath.compile("/ed:EndpointDescription/ed:Resources/ed:Resource"); 427 427 list = (NodeList) exp.evaluate(doc, XPathConstants.NODESET); 428 final Set<String> pids = new HashSet< String>();428 final Set<String> pids = new HashSet<>(); 429 429 List<ResourceInfo> resources = parseResources(xpath, list, pids, 430 430 supportedDataViews, supportedLayers, version, hasAdvView); … … 511 511 512 512 if (titles == null) { 513 titles = new HashMap< String, String>();513 titles = new HashMap<>(); 514 514 } 515 515 if (titles.containsKey(lang)) { … … 542 542 543 543 if (descrs == null) { 544 descrs = new HashMap< String, String>();544 descrs = new HashMap<>(); 545 545 } 546 546 … … 592 592 593 593 if (langs == null) { 594 langs = new ArrayList< String>();594 langs = new ArrayList<>(); 595 595 } 596 596 langs.add(s); … … 614 614 } 615 615 616 for ( int i = 0; i < refs.length; i++) {616 for (String ref2 : refs) { 617 617 DataView dataview = null; 618 618 for (DataView dv : supportedDataViews) { 619 if (ref s[i].equals(dv.getIdentifier())) {619 if (ref2.equals(dv.getIdentifier())) { 620 620 dataview = dv; 621 621 break; … … 624 624 if (dataview != null) { 625 625 if (availableDataViews == null) { 626 availableDataViews = new ArrayList< DataView>();626 availableDataViews = new ArrayList<>(); 627 627 } 628 628 availableDataViews.add(dataview); 629 629 } else { 630 630 throw new SRUConfigException( 631 "A data view with " + "identifier '" + ref s[i]+631 "A data view with " + "identifier '" + ref2 + 632 632 "' was not defined " + 633 633 "in <SupportedDataViews>"); … … 658 658 } 659 659 660 for ( int i = 0; i < refs.length; i++) {660 for (String ref2 : refs) { 661 661 Layer layer = null; 662 662 for (Layer l : supportedLayers) { 663 if (ref s[i].equals(l.getId())) {663 if (ref2.equals(l.getId())) { 664 664 layer = l; 665 665 break; … … 668 668 if (layer != null) { 669 669 if (availableLayers == null) { 670 availableLayers = new ArrayList< Layer>();670 availableLayers = new ArrayList<>(); 671 671 } 672 672 availableLayers.add(layer); 673 673 } else { 674 674 throw new SRUConfigException("A layer with " + 675 "identifier '" + ref s[i]+675 "identifier '" + ref2 + 676 676 "' was not defined " + "in <SupportedLayers>"); 677 677 } … … 692 692 693 693 if (ris == null) { 694 ris = new ArrayList< ResourceInfo>();694 ris = new ArrayList<>(); 695 695 } 696 696 if ((availableLayers != null) && (version < 1)) {
Note: See TracChangeset
for help on using the changeset viewer.