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
QueryResultParsers offering common functionality for query result parsers.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected QueryResultHandlerTheQueryResultHandlerthat will handle the parsed query results.protected ValueFactoryTheValueFactoryto use for creating RDF model objects. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new parser base that, by default, will use the global instance ofSimpleValueFactoryto create Value objects.protectedAbstractQueryResultParser(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 theQueryResultHandlerto 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, waitMethods inherited from interface org.eclipse.rdf4j.query.resultio.QueryResultParser
getQueryResultFormat, parseQueryResult
-
Field Details
-
valueFactory
TheValueFactoryto use for creating RDF model objects. -
handler
TheQueryResultHandlerthat will handle the parsed query results.
-
-
Constructor Details
-
AbstractQueryResultParser
protected AbstractQueryResultParser()Creates a new parser base that, by default, will use the global instance ofSimpleValueFactoryto 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:QueryResultParserSets the ValueFactory that the parser will use to create Value objects for the parsed query result.- Specified by:
setValueFactoryin interfaceQueryResultParser- Parameters:
valueFactory- The value factory that the parser should use.
-
setQueryResultHandler
Description copied from interface:QueryResultParserSets theQueryResultHandlerto be used when parsing query results usingQueryResultParser.parseQueryResult(InputStream).- Specified by:
setQueryResultHandlerin interfaceQueryResultParser- Parameters:
handler- TheQueryResultHandlerto use for handling results.
-
setParserConfig
Description copied from interface:QueryResultParserSets all supplied parser configuration options.- Specified by:
setParserConfigin interfaceQueryResultParser- Parameters:
config- a parser configuration object.
-
getParserConfig
Description copied from interface:QueryResultParserRetrieves the current parser configuration as a single object.- Specified by:
getParserConfigin interfaceQueryResultParser- Returns:
- a parser configuration object representing the current configuration of the parser.
-
setParseErrorListener
Description copied from interface:QueryResultParserSets the ParseErrorListener that will be notified of any errors that this parser finds during parsing.- Specified by:
setParseErrorListenerin 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:QueryResultParserSets the ParseLocationListener that will be notified of the parser's progress during the parse process.- Specified by:
setParseLocationListenerin 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:
getSupportedSettingsin interfaceQueryResultParser- Returns:
- A collection of
RioSettings that are supported by this QueryResultParser.
-
set
Description copied from interface:QueryResultParserSet a setting on the parser, and return this parser object to allow chaining.- Specified by:
setin 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.
-