Changeset 2022


Ignore:
Timestamp:
07/10/12 13:25:03 (12 years ago)
Author:
oschonef
Message:
  • fix breakage (misplaces curly braces)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUClient.java

    r2021 r2022  
    452452                reader.readEnd(SRU_NS, "terms");
    453453                handler.onFinishTerms();
    454 
    455                 // scanResponse/echoedScanRequest
    456                 if (reader.readStart(SRU_NS, "echoedScanRequest", false)) {
    457                     reader.readEnd(SRU_NS, "echoedScanRequest", true);
    458                 }
    459 
    460                 // scanResponse/diagnostics
    461                 final List<SRUDiagnostic> diagnostics =
    462                         parseDiagnostics(reader);
    463                 if (diagnostics != null) {
    464                     handler.onDiagnostics(diagnostics);
    465                 }
    466 
    467                 // scanResponse/extraResponseData
    468                 if (reader.readStart(SRU_NS, "extraResponseData", false)) {
    469                     reader.consumeWhitespace();
    470                     proxy.reset(reader);
    471                     try {
    472                         handler.onExtraResponseData(proxy);
    473                     } catch (XMLStreamException e) {
    474                         throw new SRUClientException("handler triggered " +
    475                                 "error while parsing 'extraResponseData'", e);
    476                     }
    477                     reader.consumeWhitespace();
    478                     reader.readEnd(SRU_NS, "extraResponseData", true);
    479                 }
    480 
    481                 reader.readEnd(SRU_NS, "scanResponse");
    482             }
     454            }
     455
     456            // scanResponse/echoedScanRequest
     457            if (reader.readStart(SRU_NS, "echoedScanRequest", false)) {
     458                reader.readEnd(SRU_NS, "echoedScanRequest", true);
     459            }
     460
     461            // scanResponse/diagnostics
     462            final List<SRUDiagnostic> diagnostics = parseDiagnostics(reader);
     463            if (diagnostics != null) {
     464                handler.onDiagnostics(diagnostics);
     465            }
     466
     467            // scanResponse/extraResponseData
     468            if (reader.readStart(SRU_NS, "extraResponseData", false)) {
     469                reader.consumeWhitespace();
     470                proxy.reset(reader);
     471                try {
     472                    handler.onExtraResponseData(proxy);
     473                } catch (XMLStreamException e) {
     474                    throw new SRUClientException("handler triggered "
     475                            + "error while parsing 'extraResponseData'", e);
     476                }
     477                reader.consumeWhitespace();
     478                reader.readEnd(SRU_NS, "extraResponseData", true);
     479            }
     480
     481            reader.readEnd(SRU_NS, "scanResponse");
    483482        } catch (XMLStreamException e) {
    484483            throw new SRUClientException(e.getMessage(), e);
     
    644643                    reader.readEnd(SRU_NS, "record");
    645644                } // while
    646 
    647645                reader.readEnd(SRU_NS, "records");
    648                 int nextRecordPosition = reader.readContent(SRU_NS,
    649                         "nextRecordPosition", false, -1);
    650                 logger.debug("nextRecordPosition = {}", nextRecordPosition);
    651                 handler.onFinishRecords(nextRecordPosition);
    652 
    653                 // searchRetrieveResponse/echoedSearchRetrieveResponse
    654                 if (reader.readStart(SRU_NS, "echoedSearchRetrieveRequest", false)) {
    655                     reader.readEnd(SRU_NS, "echoedSearchRetrieveRequest", true);
    656                 }
    657 
    658                 // searchRetrieveResponse/diagnostics
    659                 final List<SRUDiagnostic> diagnostics =
    660                             parseDiagnostics(reader);
    661                 if (diagnostics != null) {
    662                     handler.onDiagnostics(diagnostics);
    663                 }
    664 
    665                 // explainResponse/extraResponseData
    666                 if (reader.readStart(SRU_NS, "extraResponseData", false)) {
    667                     reader.consumeWhitespace();
    668                     proxy.reset(reader);
    669                     try {
    670                         handler.onExtraResponseData(proxy);
    671                     } catch (XMLStreamException e) {
    672                         throw new SRUClientException("handler triggered " +
    673                                 "error while parsing 'extraResponseData'", e);
    674                     }
    675                     reader.consumeWhitespace();
    676                     reader.readEnd(SRU_NS, "extraResponseData", true);
    677                 }
    678 
    679                 reader.readEnd(SRU_NS, "searchRetrieveResponse");
    680             }
     646            }
     647
     648            int nextRecordPosition = reader.readContent(SRU_NS,
     649                    "nextRecordPosition", false, -1);
     650            logger.debug("nextRecordPosition = {}", nextRecordPosition);
     651            handler.onFinishRecords(nextRecordPosition);
     652
     653            // searchRetrieveResponse/echoedSearchRetrieveResponse
     654            if (reader.readStart(SRU_NS, "echoedSearchRetrieveRequest", false)) {
     655                reader.readEnd(SRU_NS, "echoedSearchRetrieveRequest", true);
     656            }
     657
     658            // searchRetrieveResponse/diagnostics
     659            final List<SRUDiagnostic> diagnostics = parseDiagnostics(reader);
     660            if (diagnostics != null) {
     661                handler.onDiagnostics(diagnostics);
     662            }
     663
     664            // explainResponse/extraResponseData
     665            if (reader.readStart(SRU_NS, "extraResponseData", false)) {
     666                reader.consumeWhitespace();
     667                proxy.reset(reader);
     668                try {
     669                    handler.onExtraResponseData(proxy);
     670                } catch (XMLStreamException e) {
     671                    throw new SRUClientException("handler triggered "
     672                            + "error while parsing 'extraResponseData'", e);
     673                }
     674                reader.consumeWhitespace();
     675                reader.readEnd(SRU_NS, "extraResponseData", true);
     676            }
     677
     678            reader.readEnd(SRU_NS, "searchRetrieveResponse");
    681679        } catch (XMLStreamException e) {
    682680            throw new SRUClientException(e.getMessage(), e);
     
    703701            SRUXMLStreamReader reader) throws XMLStreamException,
    704702            SRUClientException {
     703        logger.debug("XXX: try diagnostics: {}", reader.dumpState());
    705704        if (reader.readStart(SRU_NS, "diagnostics", false)) {
    706705            List<SRUDiagnostic> diagnostics = null;
     
    725724            boolean required) throws XMLStreamException, SRUClientException {
    726725        if (reader.readStart(SRU_DIAGNOSIC_NS, "diagnostic", required)) {
     726
    727727            // diagnostic/uri
    728728            String uri = reader.readContent(SRU_DIAGNOSIC_NS, "uri", true);
Note: See TracChangeset for help on using the changeset viewer.