Interface QueryResultParser<P extends QueryResultHandler>

All Known Subinterfaces:
BooleanQueryResultParser, SelectQueryResultParser
All Known Implementing Classes:
BinarySelectQueryResultParser, SPARQLCSVResultParser, SPARQLJSONBooleanResultParser, SPARQLJSONSelectResultParser, SPARQLTSVResultParser, SPARQLXMLBooleanResultParser, SPARQLXMLSelectResultParser, TextBooleanQueryResultParser

@ThreadSafe public interface QueryResultParser<P extends QueryResultHandler>

Parser for serialized query results

Since:
1.0
Version:
1.0
Author:
Michael Grove
Implementation Requirements:
Implementations of this interface should include a zero argument constructor so that they can be created by the ServiceLoader. They are also expected to be *thread safe*;
  • Method Details

    • format

      @Nonnull QueryResultFormat format()
      The format this parser can parse
      Returns:
      the format
    • parse

      default void parse(@Nonnull InputStream theStream, @Nonnull P theHandler) throws IOException
      Parse the content using the default options.
      Parameters:
      theStream - the stream to read from
      theHandler - the handler to pass parse events to
      Throws:
      InvalidQueryResults - if there was an error while parsing the results
      IOException - if there was an error while reading from the stream
    • parse

      void parse(@Nonnull InputStream theStream, @Nonnull P theHandler, @Nonnull Options theOptions) throws IOException
      Parse the results.
      Parameters:
      theStream - the stream to read from
      theHandler - the handler to pass parse events to
      theOptions - the parsing options
      Throws:
      InvalidQueryResults - if there was an error while parsing the results
      IOException - if there was an error while reading from the stream