Package 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
Base class for
QueryResultParser
s offering common functionality for query result parsers.-
Field Summary
Modifier and TypeFieldDescriptionprotected QueryResultHandler
TheQueryResultHandler
that will handle the parsed query results.protected ValueFactory
TheValueFactory
to use for creating RDF model objects. -
Constructor Summary
ModifierConstructorDescriptionprotected
Creates a new parser base that, by default, will use the global instance ofSimpleValueFactory
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
Modifier and TypeMethodDescriptionRetrieves the current parser configuration as a single object.Collection
<RioSetting<?>> set
(RioSetting<T> setting, T value) Set a setting on the parser, and return this parser object to allow chaining.Sets the ParseErrorListener that will be notified of any errors that this parser finds during parsing.Sets the ParseLocationListener that will be notified of the parser's progress during the parse process.setParserConfig
(ParserConfig config) Sets all supplied parser configuration options.setQueryResultHandler
(QueryResultHandler handler) Sets theQueryResultHandler
to be used when parsing query results usingQueryResultParser.parseQueryResult(InputStream)
.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 Details
-
valueFactory
TheValueFactory
to use for creating RDF model objects. -
handler
TheQueryResultHandler
that will handle the parsed query results.
-
-
Constructor Details
-
AbstractQueryResultParser
protected AbstractQueryResultParser()Creates a new parser base that, by default, will use the global instance ofSimpleValueFactory
to create Value objects. -
AbstractQueryResultParser
Creates a new parser base that will use the supplied ValueFactory to create Value objects.
-
-
Method Details
-
setValueFactory
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 interfaceQueryResultParser
- Parameters:
valueFactory
- The value factory that the parser should use.
-
setQueryResultHandler
Description copied from interface:QueryResultParser
Sets theQueryResultHandler
to be used when parsing query results usingQueryResultParser.parseQueryResult(InputStream)
.- Specified by:
setQueryResultHandler
in interfaceQueryResultParser
- Parameters:
handler
- TheQueryResultHandler
to use for handling results.
-
setParserConfig
Description copied from interface:QueryResultParser
Sets all supplied parser configuration options.- Specified by:
setParserConfig
in interfaceQueryResultParser
- Parameters:
config
- a parser configuration object.
-
getParserConfig
Description copied from interface:QueryResultParser
Retrieves the current parser configuration as a single object.- Specified by:
getParserConfig
in interfaceQueryResultParser
- Returns:
- a parser configuration object representing the current configuration of the parser.
-
setParseErrorListener
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 interfaceQueryResultParser
- 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
-
setParseLocationListener
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 interfaceQueryResultParser
- 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
-
getSupportedSettings
- Specified by:
getSupportedSettings
in interfaceQueryResultParser
- Returns:
- A collection of
RioSetting
s that are supported by this QueryResultParser.
-
set
Description copied from interface:QueryResultParser
Set a setting on the parser, and return this parser object to allow chaining.- Specified by:
set
in interfaceQueryResultParser
- 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.
-