Class SPARQLBooleanXMLWriter
- java.lang.Object
-
- org.eclipse.rdf4j.query.resultio.AbstractQueryResultWriter
-
- org.eclipse.rdf4j.query.resultio.sparqlxml.SPARQLBooleanXMLWriter
-
- All Implemented Interfaces:
org.eclipse.rdf4j.common.io.CharSink,org.eclipse.rdf4j.common.io.Sink,BooleanQueryResultHandler,QueryResultHandler,BooleanQueryResultWriter,QueryResultWriter
public class SPARQLBooleanXMLWriter extends AbstractQueryResultWriter implements BooleanQueryResultWriter
ABooleanQueryResultWriterthat writes boolean 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 SPARQLBooleanXMLWriter(OutputStream out)SPARQLBooleanXMLWriter(Writer writer)SPARQLBooleanXMLWriter(XMLWriter xmlWriter)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidendDocument()voidendHeader()voidendQueryResult()BooleanQueryResultFormatgetBooleanQueryResultFormat()BooleanQueryResultFormatgetQueryResultFormat()Collection<org.eclipse.rdf4j.rio.RioSetting<?>>getSupportedSettings()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)voidwrite(boolean value)-
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
-
SPARQLBooleanXMLWriter
public SPARQLBooleanXMLWriter(OutputStream out)
-
SPARQLBooleanXMLWriter
public SPARQLBooleanXMLWriter(Writer writer)
-
SPARQLBooleanXMLWriter
public SPARQLBooleanXMLWriter(XMLWriter xmlWriter)
-
-
Method Detail
-
getBooleanQueryResultFormat
public final BooleanQueryResultFormat getBooleanQueryResultFormat()
- Specified by:
getBooleanQueryResultFormatin interfaceBooleanQueryResultWriter
-
getQueryResultFormat
public final BooleanQueryResultFormat getQueryResultFormat()
- Specified by:
getQueryResultFormatin interfaceQueryResultWriter
-
write
public void write(boolean value) throws IOException- Specified by:
writein interfaceBooleanQueryResultWriter- Throws:
IOException
-
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
-
-