Module org.apache.jena.querybuilder
Class SelectHandler
java.lang.Object
org.apache.jena.arq.querybuilder.handlers.SelectHandler
- All Implemented Interfaces:
Handler
A Select clause handler.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAll
(SelectHandler selectHandler) Add all the variables from the select handler variable.void
Add an Expression as variable to the select.void
addVar
(org.apache.jena.sparql.core.Var var) Add a variable to the select.void
addVar
(org.apache.jena.sparql.expr.Expr expr, org.apache.jena.sparql.core.Var var) Add an Expression as variable to the select.void
build()
Called by the build process for this handler to perform any adjustments to the query before the build completes.org.apache.jena.sparql.core.VarExprList
Return the projected var expression list.List<org.apache.jena.sparql.core.Var>
getVars()
Get the list of variables from the query.void
setDistinct
(boolean state) Set the distinct flag.void
setReduced
(boolean state) Set the reduced flag.void
Set the values for variables managed by the handler implementation.
-
Constructor Details
-
SelectHandler
Constructor.- Parameters:
aggHandler
- The aggregate handler that wraps the query we want to handle.
-
-
Method Details
-
setDistinct
public void setDistinct(boolean state) Set the distinct flag. Set or unset the distinct flag. Will set the reduced flag if it was previously set.- Parameters:
state
- the state to set the distinct flag to.
-
setReduced
public void setReduced(boolean state) Set the reduced flag. Set or unset the reduced flag. Will set the reduced flag if it was previously set.- Parameters:
state
- the state to set the reduced flag to.
-
addVar
public void addVar(org.apache.jena.sparql.core.Var var) Add a variable to the select. If the variable isnull
the variables are set to star.- Parameters:
var
- The variable to add.
-
addVar
Add an Expression as variable to the select. If the variable is the variables are set to star.- Parameters:
expression
- The expression as a string.var
- The variable to add.
-
addVar
public void addVar(org.apache.jena.sparql.expr.Expr expr, org.apache.jena.sparql.core.Var var) Add an Expression as variable to the select.- Parameters:
expr
- The expression to add.var
- The variable to add.
-
getVars
Get the list of variables from the query.- Returns:
- The list of variables in the query.
-
getProject
public org.apache.jena.sparql.core.VarExprList getProject()Return the projected var expression list.- Returns:
- The projected var expression list.
-
addAll
Add all the variables from the select handler variable.- Parameters:
selectHandler
- The select handler to copy the variables from.
-
setVars
Description copied from interface:Handler
Set the values for variables managed by the handler implementation. This method is called by the builder to set values handled by this Handler implementation. -
build
public void build()Description copied from interface:Handler
Called by the build process for this handler to perform any adjustments to the query before the build completes. The adjustments are made after setVars() has been called.
-