Package com.stardog.stark.query.io

# 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 Summary

  Modifier and Type
  Method
  Description
  `QueryResultFormat`
  `format()`
  The format this parser can parse
  `default void`
  `parse(InputStream theStream, P theHandler)`
  Parse the content using the `default options`.
  `void`
  `parse(InputStream theStream, P theHandler, Options theOptions)`
  Parse the results.

- ## 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