Class MainModule

All Implemented Interfaces:
Scope

public final class MainModule extends AModule
An XQuery main module.
Author:
BaseX Team 2005-21, BSD License, Leo Woerteler
  • Constructor Details

    • MainModule

      public MainModule(VarScope vs, Expr expr, SeqType declType, String doc, InputInfo info, TokenObjMap<StaticFunc> funcs, TokenObjMap<StaticVar> vars, TokenSet imports)
      Constructor.
      Parameters:
      vs - variable scope
      expr - root expression
      declType - optional type (can be null)
      doc - documentation (can be null)
      info - input info (can be null)
      funcs - user-defined functions (can be null)
      vars - static variables (can be null)
      imports - namespace URIs of imported modules (can be null)
  • Method Details

    • get

      public static MainModule get(VarScope vs, Expr expr, SeqType declType, String doc, InputInfo ii)
      Creates a new main module for a context item declared in the prolog.
      Parameters:
      vs - variable scope
      expr - root expression
      declType - declared type (can be null)
      doc - documentation (can be null)
      ii - input info (can be null)
      Returns:
      main module
    • get

      public static MainModule get(StaticFunc sf, Expr[] args) throws QueryException
      Creates a new main module for the specified function.
      Parameters:
      sf - user-defined function
      args - arguments
      Returns:
      main module
      Throws:
      QueryException - query exception
    • comp

      public void comp(CompileContext cc) throws QueryException
      Description copied from interface: Scope
      Compiles the expression contained in this scope.
      Parameters:
      cc - compilation context
      Throws:
      QueryException - compilation errors
    • iter

      public Iter iter(QueryContext qc) throws QueryException
      Creates a result iterator which lazily evaluates this module.
      Parameters:
      qc - query context
      Returns:
      result iterator
      Throws:
      QueryException - query exception
    • value

      public Value value(QueryContext qc) throws QueryException
      Creates the result.
      Parameters:
      qc - query context
      Returns:
      result
      Throws:
      QueryException - query exception
    • databases

      public boolean databases(Locks locks, QueryContext qc)
      Adds the names of the databases that may be touched by the module.
      Parameters:
      locks - lock result
      qc - query context
      Returns:
      result of check
    • visit

      public boolean visit(ASTVisitor visitor)
      Description copied from interface: Scope
      Traverses this scope with the given ASTVisitor.
      Parameters:
      visitor - visitor
      Returns:
      continue flag
    • plan

      public void plan(QueryPlan plan)
      Description copied from class: ExprInfo
      Creates a query plan.
      Specified by:
      plan in class ExprInfo
      Parameters:
      plan - expression plan
    • plan

      public void plan(QueryString qs)
      Description copied from class: ExprInfo
      Creates a query string.
      Specified by:
      plan in class ExprInfo
      Parameters:
      qs - query string builder