org.eclipse.rdf4j.query.resultio

## Class AbstractQueryResultParser

- java.lang.Object
- - org.eclipse.rdf4j.query.resultio.AbstractQueryResultParser

- All Implemented Interfaces:
    QueryResultParser
  Direct Known Subclasses:
    AbstractSPARQLJSONParser, AbstractSPARQLXMLParser, AbstractTupleQueryResultParser, BooleanTextParser, QueryResultParserBase

      public abstract class AbstractQueryResultParser
      extends Object
      implements QueryResultParser

  Base class for `QueryResultParser`s offering common functionality for query result parsers.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected QueryResultHandler` | `handler` The `QueryResultHandler` that will handle the parsed query results.
    `protected ValueFactory` | `valueFactory` The `ValueFactory` to use for creating RDF model objects.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractQueryResultParser()` Creates a new parser base that, by default, will use the global instance of `SimpleValueFactory` to create Value objects.
    `protected` | `AbstractQueryResultParser(ValueFactory valueFactory)` Creates a new parser base that will use the supplied ValueFactory to create Value objects.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ParseErrorListener` | `getParseErrorListener()`
    `ParseLocationListener` | `getParseLocationListener()`
    `ParserConfig` | `getParserConfig()` Retrieves the current parser configuration as a single object.
    `Collection<RioSetting<?>>` | `getSupportedSettings()`
    `<T> QueryResultParser` | `set(RioSetting<T> setting, T value)` Set a setting on the parser, and return this parser object to allow chaining.
    `QueryResultParser` | `setParseErrorListener(ParseErrorListener el)` Sets the ParseErrorListener that will be notified of any errors that this parser finds during parsing.
    `QueryResultParser` | `setParseLocationListener(ParseLocationListener el)` Sets the ParseLocationListener that will be notified of the parser's progress during the parse process.
    `QueryResultParser` | `setParserConfig(ParserConfig config)` Sets all supplied parser configuration options.
    `QueryResultParser` | `setQueryResultHandler(QueryResultHandler handler)` Sets the `QueryResultHandler` to be used when parsing query results using `QueryResultParser.parseQueryResult(InputStream)`.
    `QueryResultParser` | `setValueFactory(ValueFactory valueFactory)` Sets the ValueFactory that the parser will use to create Value objects for the parsed query result.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.eclipse.rdf4j.query.resultio.QueryResultParser

      `getQueryResultFormat, parseQueryResult`

- - ### Field Detail

    - #### valueFactory

          protected ValueFactory valueFactory

      The `ValueFactory` to use for creating RDF model objects.

    - #### handler

          protected QueryResultHandler handler

      The `QueryResultHandler` that will handle the parsed query results.

  - ### Constructor Detail

    - #### AbstractQueryResultParser

          protected AbstractQueryResultParser()

      Creates a new parser base that, by default, will use the global instance of `SimpleValueFactory` to create Value objects.

    - #### AbstractQueryResultParser

          protected AbstractQueryResultParser(ValueFactory valueFactory)

      Creates a new parser base that will use the supplied ValueFactory to create Value objects.

  - ### Method Detail

    - #### setValueFactory

          public QueryResultParser setValueFactory(ValueFactory valueFactory)

      Description copied from interface: `QueryResultParser`
      Sets the ValueFactory that the parser will use to create Value objects for the parsed query result.
      Specified by:
        `setValueFactory` in interface `QueryResultParser`
      Parameters:
        `valueFactory` - The value factory that the parser should use.

    - #### setQueryResultHandler

          public QueryResultParser setQueryResultHandler(QueryResultHandler handler)

      Description copied from interface: `QueryResultParser`
      Sets the `QueryResultHandler` to be used when parsing query results using `QueryResultParser.parseQueryResult(InputStream)`.
      Specified by:
        `setQueryResultHandler` in interface `QueryResultParser`
      Parameters:
        `handler` - The `QueryResultHandler` to use for handling results.

    - #### setParserConfig

          public QueryResultParser setParserConfig(ParserConfig config)

      Description copied from interface: `QueryResultParser`
      Sets all supplied parser configuration options.
      Specified by:
        `setParserConfig` in interface `QueryResultParser`
      Parameters:
        `config` - a parser configuration object.

    - #### getParserConfig

          public ParserConfig getParserConfig()

      Description copied from interface: `QueryResultParser`
      Retrieves the current parser configuration as a single object.
      Specified by:
        `getParserConfig` in interface `QueryResultParser`
      Returns:
        a parser configuration object representing the current configuration of the parser.

    - #### setParseErrorListener

          public QueryResultParser setParseErrorListener(ParseErrorListener el)

      Description copied from interface: `QueryResultParser`
      Sets the ParseErrorListener that will be notified of any errors that this parser finds during parsing.
      Specified by:
        `setParseErrorListener` in interface `QueryResultParser`
      Parameters:
        `el` - The ParseErrorListener that will be notified of errors or warnings.
      Returns:
        Either a copy of this parser, if it is immutable, or this object, to allow chaining of method calls.

    - #### getParseErrorListener

          public ParseErrorListener getParseErrorListener()

    - #### setParseLocationListener

          public QueryResultParser setParseLocationListener(ParseLocationListener el)

      Description copied from interface: `QueryResultParser`
      Sets the ParseLocationListener that will be notified of the parser's progress during the parse process.
      Specified by:
        `setParseLocationListener` in interface `QueryResultParser`
      Parameters:
        `el` - The ParseLocationListener that will be notified of the parser's progress.
      Returns:
        Either a copy of this parser, if it is immutable, or this object, to allow chaining of method calls.

    - #### getParseLocationListener

          public ParseLocationListener getParseLocationListener()

    - #### getSupportedSettings

          public Collection<RioSetting<?>> getSupportedSettings()

      Specified by:
        `getSupportedSettings` in interface `QueryResultParser`
      Returns:
        A collection of `RioSetting`s that are supported by this QueryResultParser.

    - #### set

          public <T> QueryResultParser set(RioSetting<T> setting,
                                           T value)

      Description copied from interface: `QueryResultParser`
      Set a setting on the parser, and return this parser object to allow chaining.
      Specified by:
        `set` in interface `QueryResultParser`
      Parameters:
        `setting` - The setting to change.
        `value` - The value to change.
      Returns:
        Either a copy of this parser, if it is immutable, or this object, to allow chaining of method calls.

Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.