Package org.eclipse.rdf4j.query.impl
Class TupleQueryResultBuilder
- java.lang.Object
-
- org.eclipse.rdf4j.query.AbstractTupleQueryResultHandler
-
- org.eclipse.rdf4j.query.impl.TupleQueryResultBuilder
-
- All Implemented Interfaces:
QueryResultHandler
,TupleQueryResultHandler
public class TupleQueryResultBuilder extends AbstractTupleQueryResultHandler
A TupleQueryResultHandler that can be used to create a TupleQueryResult object.
-
-
Constructor Summary
Constructors Constructor Description TupleQueryResultBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TupleQueryResult
getQueryResult()
void
handleSolution(BindingSet bindingSet)
Handles a solution.void
startQueryResult(List<String> bindingNames)
Indicates the start of a sequence of Solutions.-
Methods inherited from class org.eclipse.rdf4j.query.AbstractTupleQueryResultHandler
endQueryResult, handleBoolean, handleLinks
-
-
-
-
Method Detail
-
startQueryResult
public void startQueryResult(List<String> bindingNames) throws TupleQueryResultHandlerException
Description copied from interface:QueryResultHandler
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 SPARQL query like select ?X ?Y where { ?X ?P ?Y } will have binding names X and Y.- Specified by:
startQueryResult
in interfaceQueryResultHandler
- Overrides:
startQueryResult
in classAbstractTupleQueryResultHandler
- Parameters:
bindingNames
- An ordered set of binding names.- Throws:
TupleQueryResultHandlerException
- If there was an error during the starting of the query result handler. This exception may be thrown if theQueryResultHandler.handleBoolean(boolean)
method was called before this method and the handler cannot process both boolean and tuple results simultaneously.
-
handleSolution
public void handleSolution(BindingSet bindingSet) throws TupleQueryResultHandlerException
Description copied from interface:QueryResultHandler
Handles a solution.- Specified by:
handleSolution
in interfaceQueryResultHandler
- Overrides:
handleSolution
in classAbstractTupleQueryResultHandler
- Parameters:
bindingSet
- A single set of tuple results, with binding names bound to values. Each of the binding names in the solution must have previously been registered with theQueryResultHandler.startQueryResult(List)
method.- Throws:
TupleQueryResultHandlerException
- If there was an error during the handling of the query solution. This exception may be thrown if theQueryResultHandler.handleBoolean(boolean)
method was called before this method and the handler cannot process both boolean and tuple results simultaneously.
-
getQueryResult
public TupleQueryResult getQueryResult()
-
-