Ignore:
Timestamp:
05/27/13 15:54:47 (11 years ago)
Author:
oschonef
Message:
  • add preliminary Zeerex record parser and Zeerex record data object (used in explain, still disabled)
  • make non-strict mode more forgiving
  • (preliminary) add version attribute to parse() method of record data parsers
File:
1 edited

Legend:

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

    r2466 r2936  
    5656    private List<SRUDiagnostic> diagnostics;
    5757    private DocumentFragment extraResponseData;
    58     /* explain */
    59     private SRURecord record;
    6058    /* scan */
    6159    private List<SRUTerm> terms;
     
    6462    private String resultSetId;
    6563    private int resultSetIdleTime;
     64    private int nextRecordPosition;
     65    /* explain/searchRetrieve */
    6666    private List<SRURecord> records;
    67     private int nextRecordPosition;
    6867    /* statistics */
    6968    private int totalBytesTransferred;
     
    167166    /**
    168167     * Register a record data parser.
    169      *
     168     * 
    170169     * @param parser
    171170     *            a parser instance
    172      * @throws SRUClientException
    173      *             if a parser handing the same record schema is already
    174      *             registered
    175171     * @throws NullPointerException
    176172     *             if any required argument is <code>null</code>
    177173     * @throws IllegalArgumentException
    178      *             if the supplied parser is invalid
    179      */
    180     public void registerRecordParser(SRURecordDataParser parser)
    181             throws SRUClientException {
     174     *             if the supplied parser is invalid or a parser handing the
     175     *             same record schema is already registered
     176     */
     177    public void registerRecordParser(SRURecordDataParser parser) {
    182178        client.registerRecordParser(parser);
    183179    }
     
    202198        try {
    203199            client.explain(request, handler);
     200            SRURecord record = null;
     201            if ((records != null) && !records.isEmpty()) {
     202                record = records.get(0);
     203            }
    204204            return new SRUExplainResponse(request,
    205205                    diagnostics,
     
    313313        diagnostics           = null;
    314314        extraResponseData     = null;
    315         /* explain */
    316         record                = null;
    317315        /* scan */
    318316        terms                 = null;
     
    321319        resultSetId           = null;
    322320        resultSetIdleTime     = -1;
     321        nextRecordPosition    = -1;
     322        /* explain/searchRetrieve */
    323323        records               = null;
    324         nextRecordPosition    = -1;
    325324        /* statistics */
    326325        totalBytesTransferred = -1;
Note: See TracChangeset for help on using the changeset viewer.