org.openrdf.query.resultio.sparqlxml
Class SPARQLResultsXMLWriter

java.lang.Object
  extended by org.openrdf.query.resultio.sparqlxml.SPARQLResultsXMLWriter
All Implemented Interfaces:
TupleQueryResultWriter, TupleQueryResultHandler

public class SPARQLResultsXMLWriter
extends Object
implements TupleQueryResultWriter

A TupleQueryResultWriter that writes tuple query results in the SPARQL Query Results XML Format.


Constructor Summary
SPARQLResultsXMLWriter(OutputStream out)
           
SPARQLResultsXMLWriter(XMLWriter xmlWriter)
           
 
Method Summary
 void endQueryResult()
          Indicates the end of a sequence of solutions.
 TupleQueryResultFormat getTupleQueryResultFormat()
          Gets the query result format that this writer uses.
 void handleSolution(BindingSet bindingSet)
          Handles a solution.
 void setPrettyPrint(boolean prettyPrint)
          Enables/disables addition of indentation characters and newlines in the XML document.
 void startQueryResult(List<String> bindingNames)
          Indicates the start of a sequence of Solutions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SPARQLResultsXMLWriter

public SPARQLResultsXMLWriter(OutputStream out)

SPARQLResultsXMLWriter

public SPARQLResultsXMLWriter(XMLWriter xmlWriter)
Method Detail

getTupleQueryResultFormat

public final TupleQueryResultFormat getTupleQueryResultFormat()
Description copied from interface: TupleQueryResultWriter
Gets the query result format that this writer uses.

Specified by:
getTupleQueryResultFormat in interface TupleQueryResultWriter

setPrettyPrint

public void setPrettyPrint(boolean prettyPrint)
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, before #startTupleSet is called).


startQueryResult

public void startQueryResult(List<String> bindingNames)
                      throws TupleQueryResultHandlerException
Description copied from interface: TupleQueryResultHandler
Indicates the start of a sequence of Solutions. The supplied bindingNames are an indication of the values that are in the Solutions. For example, a SeRQL query like select X, Y from {X} P {Y} will have binding names X and Y.

Specified by:
startQueryResult in interface TupleQueryResultHandler
Parameters:
bindingNames - An ordered set of binding names.
Throws:
TupleQueryResultHandlerException

endQueryResult

public void endQueryResult()
                    throws TupleQueryResultHandlerException
Description copied from interface: TupleQueryResultHandler
Indicates the end of a sequence of solutions.

Specified by:
endQueryResult in interface TupleQueryResultHandler
Throws:
TupleQueryResultHandlerException

handleSolution

public void handleSolution(BindingSet bindingSet)
                    throws TupleQueryResultHandlerException
Description copied from interface: TupleQueryResultHandler
Handles a solution.

Specified by:
handleSolution in interface TupleQueryResultHandler
Throws:
TupleQueryResultHandlerException


Copyright © 2001-2008 Aduna. All Rights Reserved.