public class TupleResultBuilder extends Object
QueryResultWriter
to make it easier to generate results in servlets.Constructor and Description |
---|
TupleResultBuilder(QueryResultWriter writer,
ValueFactory valueFactory) |
Modifier and Type | Method and Description |
---|---|
TupleResultBuilder |
bool(boolean result) |
TupleResultBuilder |
end()
This must be called if
start(String...) is used, after all results are generated using either
namedResult(String, Object) or result(Object...) . |
TupleResultBuilder |
endBoolean() |
void |
flush() |
TupleResultBuilder |
link(List<String> url) |
TupleResultBuilder |
namedResult(String name,
Object result)
start(String...) must be called before using this method. |
void |
prefix(String prefix,
String namespace) |
TupleResultBuilder |
result(Object... result)
start(String...) must be called before using this method. |
TupleResultBuilder |
start(String... variables)
This must be called before calling
namedResult(String, Object) or result(Object...) . |
TupleResultBuilder |
startBoolean() |
TupleResultBuilder |
transform(String path,
String xsl) |
TupleResultBuilder |
variables(String... names) |
public TupleResultBuilder(QueryResultWriter writer, ValueFactory valueFactory)
public void prefix(String prefix, String namespace) throws QueryResultHandlerException
QueryResultHandlerException
public TupleResultBuilder transform(String path, String xsl) throws QueryResultHandlerException
QueryResultHandlerException
public TupleResultBuilder start(String... variables) throws QueryResultHandlerException
namedResult(String, Object)
or result(Object...)
.variables
- one or more variable namesQueryResultHandlerException
public TupleResultBuilder startBoolean()
public TupleResultBuilder variables(String... names) throws QueryResultHandlerException
QueryResultHandlerException
public TupleResultBuilder link(List<String> url) throws QueryResultHandlerException
QueryResultHandlerException
public TupleResultBuilder bool(boolean result) throws QueryResultHandlerException
QueryResultHandlerException
public TupleResultBuilder result(Object... result) throws QueryResultHandlerException
start(String...)
must be called before using this method.result
- a single result, one value for each variable, in the same order as the variable names were providedQueryResultHandlerException
public TupleResultBuilder namedResult(String name, Object result) throws QueryResultHandlerException
start(String...)
must be called before using this method.name
- the variable name, from the set of provided variable namesresult
- the result value associated with the given variable nameQueryResultHandlerException
public TupleResultBuilder end() throws QueryResultHandlerException
start(String...)
is used, after all results are generated using either
namedResult(String, Object)
or result(Object...)
.
This must not be called if bool(boolean)
or endBoolean()
have been called.
QueryResultHandlerException
public TupleResultBuilder endBoolean()
public void flush()
Copyright © 2015-2022 Eclipse Foundation. All Rights Reserved.