Class SelectHandler

java.lang.Object
org.apache.jena.arq.querybuilder.handlers.SelectHandler
All Implemented Interfaces:
Handler

public class SelectHandler extends Object implements Handler
A Select clause handler.
  • Constructor Details

    • SelectHandler

      public SelectHandler(AggregationHandler aggHandler)
      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(Var var)
      Add a variable to the select. If the variable is null the variables are set to star.
      Parameters:
      var - The variable to add.
    • addVar

      public void addVar(String expression, Var var)
      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(Expr expr, Var var)
      Add an Expression as variable to the select.
      Parameters:
      expr - The expression to add.
      var - The variable to add.
    • getVars

      public List<Var> getVars()
      Get the list of variables from the query.
      Returns:
      The list of variables in the query.
    • getProject

      public VarExprList getProject()
      Return the projected var expression list.
      Returns:
      The projected var expression list.
    • addAll

      public void addAll(SelectHandler selectHandler)
      Add all the variables from the select handler variable.
      Parameters:
      selectHandler - The select handler to copy the variables from.
    • setVars

      public void setVars(Map<Var,Node> values)
      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.
      Specified by:
      setVars in interface Handler
      Parameters:
      values - The map of variable to node value.
    • 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.
      Specified by:
      build in interface Handler