Class SPARQLResultsXMLWriter
- java.lang.Object
-
- org.eclipse.rdf4j.query.resultio.AbstractQueryResultWriter
-
- org.eclipse.rdf4j.query.resultio.sparqlxml.SPARQLResultsXMLWriter
-
- All Implemented Interfaces:
org.eclipse.rdf4j.common.io.CharSink,org.eclipse.rdf4j.common.io.Sink,QueryResultHandler,QueryResultWriter,TupleQueryResultWriter,TupleQueryResultHandler
- Direct Known Subclasses:
SPARQLStarResultsXMLWriter
public class SPARQLResultsXMLWriter extends AbstractQueryResultWriter implements TupleQueryResultWriter
ATupleQueryResultWriterthat writes tuple query results in the SPARQL Query Results XML Format.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleandocumentOpenprotected booleanheaderCompleteprotected booleanheaderOpenprotected booleantupleVariablesFoundprotected XMLWriterxmlWriterXMLWriter to write XML to.
-
Constructor Summary
Constructors Constructor Description SPARQLResultsXMLWriter(OutputStream out)SPARQLResultsXMLWriter(Writer writer)SPARQLResultsXMLWriter(XMLWriter xmlWriter)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidendDocument()voidendHeader()voidendQueryResult()TupleQueryResultFormatgetQueryResultFormat()Collection<org.eclipse.rdf4j.rio.RioSetting<?>>getSupportedSettings()TupleQueryResultFormatgetTupleQueryResultFormat()WritergetWriter()voidhandleBoolean(boolean value)voidhandleLinks(List<String> linkUrls)voidhandleNamespace(String prefix, String uri)protected voidhandleSolutionImpl(BindingSet bindingSet)voidhandleStylesheet(String url)voidsetPrettyPrint(boolean prettyPrint)Deprecated.UseAbstractQueryResultWriter.getWriterConfig().set(BasicWriterSettings.PRETTY_PRINT, prettyPrint) instead.voidstartDocument()voidstartHeader()voidstartQueryResult(List<String> bindingNames)-
Methods inherited from class org.eclipse.rdf4j.query.resultio.AbstractQueryResultWriter
getFileFormat, getWriterConfig, handleSolution, setWriterConfig, xsdStringToPlainLiteral
-
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.QueryResultHandler
endQueryResult, handleBoolean, handleLinks, handleSolution, startQueryResult
-
Methods inherited from interface org.eclipse.rdf4j.query.resultio.QueryResultWriter
endHeader, getSupportedSettings, getWriterConfig, handleNamespace, handleStylesheet, setWriterConfig, startDocument, startHeader
-
-
-
-
Field Detail
-
xmlWriter
protected XMLWriter xmlWriter
XMLWriter to write XML to.
-
documentOpen
protected boolean documentOpen
-
headerOpen
protected boolean headerOpen
-
headerComplete
protected boolean headerComplete
-
tupleVariablesFound
protected boolean tupleVariablesFound
-
-
Constructor Detail
-
SPARQLResultsXMLWriter
public SPARQLResultsXMLWriter(OutputStream out)
-
SPARQLResultsXMLWriter
public SPARQLResultsXMLWriter(Writer writer)
-
SPARQLResultsXMLWriter
public SPARQLResultsXMLWriter(XMLWriter xmlWriter)
-
-
Method Detail
-
getTupleQueryResultFormat
public TupleQueryResultFormat getTupleQueryResultFormat()
- Specified by:
getTupleQueryResultFormatin interfaceTupleQueryResultWriter
-
getQueryResultFormat
public final TupleQueryResultFormat getQueryResultFormat()
- Specified by:
getQueryResultFormatin interfaceQueryResultWriter
-
getWriter
public Writer getWriter()
- Specified by:
getWriterin interfaceorg.eclipse.rdf4j.common.io.CharSink
-
setPrettyPrint
@Deprecated public void setPrettyPrint(boolean prettyPrint)
Deprecated.UseAbstractQueryResultWriter.getWriterConfig().set(BasicWriterSettings.PRETTY_PRINT, prettyPrint) instead.Enables/disables addition of indentation characters and newlines in the XML document. By default, pretty-printing is set to true. If set to false, no indentation and newlines are added to the XML document. This method has to be used before writing starts (that is, beforeQueryResultWriter.startDocument()is called).
-
endDocument
protected void endDocument() throws IOException- Throws:
IOException
-
handleBoolean
public void handleBoolean(boolean value) throws QueryResultHandlerException- Specified by:
handleBooleanin interfaceQueryResultHandler- Throws:
QueryResultHandlerException
-
startDocument
public void startDocument() throws QueryResultHandlerException- Specified by:
startDocumentin interfaceQueryResultWriter- Throws:
QueryResultHandlerException
-
handleStylesheet
public void handleStylesheet(String url) throws QueryResultHandlerException
- Specified by:
handleStylesheetin interfaceQueryResultWriter- Throws:
QueryResultHandlerException
-
startHeader
public void startHeader() throws QueryResultHandlerException- Specified by:
startHeaderin interfaceQueryResultWriter- Throws:
QueryResultHandlerException
-
handleLinks
public void handleLinks(List<String> linkUrls) throws QueryResultHandlerException
- Specified by:
handleLinksin interfaceQueryResultHandler- Throws:
QueryResultHandlerException
-
endHeader
public void endHeader() throws QueryResultHandlerException- Specified by:
endHeaderin interfaceQueryResultWriter- Throws:
QueryResultHandlerException
-
startQueryResult
public void startQueryResult(List<String> bindingNames) throws TupleQueryResultHandlerException
- Specified by:
startQueryResultin interfaceQueryResultHandler- Overrides:
startQueryResultin classAbstractQueryResultWriter- Throws:
TupleQueryResultHandlerException
-
endQueryResult
public void endQueryResult() throws TupleQueryResultHandlerException- Specified by:
endQueryResultin interfaceQueryResultHandler- Throws:
TupleQueryResultHandlerException
-
handleSolutionImpl
protected void handleSolutionImpl(BindingSet bindingSet) throws TupleQueryResultHandlerException
- Overrides:
handleSolutionImplin classAbstractQueryResultWriter- Throws:
TupleQueryResultHandlerException
-
getSupportedSettings
public final Collection<org.eclipse.rdf4j.rio.RioSetting<?>> getSupportedSettings()
- Specified by:
getSupportedSettingsin interfaceQueryResultWriter- Overrides:
getSupportedSettingsin classAbstractQueryResultWriter
-
handleNamespace
public void handleNamespace(String prefix, String uri) throws QueryResultHandlerException
- Specified by:
handleNamespacein interfaceQueryResultWriter- Throws:
QueryResultHandlerException
-
-