Package org.eclipse.rdf4j.workbench.util
Class TupleResultBuilder
java.lang.Object
org.eclipse.rdf4j.workbench.util.TupleResultBuilder
A small wrapper around
QueryResultWriter
to make it easier to generate results in servlets.- Author:
- peter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbool
(boolean result) end()
This must be called ifstart(String...)
is used, after all results are generated using eithernamedResult(String, Object)
orresult(Object...)
.void
flush()
namedResult
(String name, Object result) start(String...)
must be called before using this method.void
start(String...)
must be called before using this method.This must be called before callingnamedResult(String, Object)
orresult(Object...)
.
-
Constructor Details
-
TupleResultBuilder
-
-
Method Details
-
prefix
- Throws:
QueryResultHandlerException
-
transform
- Throws:
QueryResultHandlerException
-
start
This must be called before callingnamedResult(String, Object)
orresult(Object...)
.- Parameters:
variables
- one or more variable names- Returns:
- this builder, for the convenience of chaining calls
- Throws:
QueryResultHandlerException
-
startBoolean
-
variables
- Throws:
QueryResultHandlerException
-
link
- Throws:
QueryResultHandlerException
-
bool
- Throws:
QueryResultHandlerException
-
result
start(String...)
must be called before using this method.- Parameters:
result
- a single result, one value for each variable, in the same order as the variable names were provided- Returns:
- this builder, for the convenience of chaining calls
- Throws:
QueryResultHandlerException
-
namedResult
public TupleResultBuilder namedResult(String name, Object result) throws QueryResultHandlerException start(String...)
must be called before using this method.- Parameters:
name
- the variable name, from the set of provided variable namesresult
- the result value associated with the given variable name- Returns:
- this builder, for the convenience of chaining calls
- Throws:
QueryResultHandlerException
-
end
This must be called ifstart(String...)
is used, after all results are generated using eithernamedResult(String, Object)
orresult(Object...)
.This must not be called if
bool(boolean)
orendBoolean()
have been called.- Returns:
- This object, for chaining with other calls.
- Throws:
QueryResultHandlerException
-
endBoolean
-
flush
public void flush()
-