Package org.eclipse.rdf4j.query.resultio
Interface QueryResultWriter
- All Superinterfaces:
QueryResultHandler
- All Known Subinterfaces:
BooleanQueryResultWriter
,TupleQueryResultWriter
- All Known Implementing Classes:
AbstractQueryResultWriter
,BinaryQueryResultWriter
,BooleanTextWriter
,ConsoleQueryResultWriter
,SPARQLBooleanJSONWriter
,SPARQLBooleanXMLWriter
,SPARQLResultsCSVWriter
,SPARQLResultsJSONWriter
,SPARQLResultsTSVWriter
,SPARQLResultsXMLWriter
,SPARQLStarResultsJSONWriter
,SPARQLStarResultsTSVWriter
,SPARQLStarResultsXMLWriter
The base interface for writers of query results sets and boolean results.
- Author:
- Peter Ansell
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Indicates the end of the header.Gets the query result format that this writer uses.Collection
<RioSetting<?>> Retrieves the current writer configuration as a single object.void
handleNamespace
(String prefix, String uri) Handles a namespace prefix declaration.void
handleStylesheet
(String stylesheetUrl) Handles a stylesheet URL.void
setWriterConfig
(WriterConfig config) Sets all supplied writer configuration options.void
Indicates the start of the document.void
Indicates the start of the header.Methods inherited from interface org.eclipse.rdf4j.query.QueryResultHandler
endQueryResult, handleBoolean, handleLinks, handleSolution, startQueryResult
-
Method Details
-
getQueryResultFormat
QueryResultFormat getQueryResultFormat()Gets the query result format that this writer uses. -
handleNamespace
Handles a namespace prefix declaration. If this is called, it should be called beforestartDocument()
to ensure that it has a document wide effect.NOTE: If the format does not support namespaces, it must silently ignore calls to this method.
- Parameters:
prefix
- The prefix to use for the namespaceuri
- The full URI that is to be represented by the prefix.- Throws:
QueryResultHandlerException
-
startDocument
Indicates the start of the document.- Throws:
QueryResultHandlerException
- If there was an error starting the writing of the results.
-
handleStylesheet
Handles a stylesheet URL. If this is called, it must be called afterstartDocument()
and beforestartHeader()
.NOTE: If the format does not support stylesheets, it must silently ignore calls to this method.
- Parameters:
stylesheetUrl
- The URL of the stylesheet to be used to style the results.- Throws:
QueryResultHandlerException
- If there was an error handling the stylesheet. This error is not thrown in cases where stylesheets are not supported.
-
startHeader
Indicates the start of the header.- Throws:
QueryResultHandlerException
- If there was an error writing the start of the header.- See Also:
-
endHeader
Indicates the end of the header. This must be called afterstartHeader()
and before any calls toQueryResultHandler.handleSolution(org.eclipse.rdf4j.query.BindingSet)
.- Throws:
QueryResultHandlerException
- If there was an error writing the end of the header.
-
setWriterConfig
Sets all supplied writer configuration options.- Parameters:
config
- a writer configuration object.
-
getWriterConfig
WriterConfig getWriterConfig()Retrieves the current writer configuration as a single object.- Returns:
- a writer configuration object representing the current configuration of the writer.
-
getSupportedSettings
Collection<RioSetting<?>> getSupportedSettings()- Returns:
- A collection of
RioSetting
s that are supported by thisQueryResultWriter
.
-