Class Variables

  • All Implemented Interfaces:
    Iterable<StaticVar>

    public final class Variables
    extends ExprInfo
    implements Iterable<StaticVar>
    Container of global variables of a module.
    Author:
    BaseX Team 2005-23, BSD License, Leo Woerteler
    • Constructor Detail

      • Variables

        public Variables()
    • Method Detail

      • declare

        public StaticVar declare​(Var var,
                                 Expr expr,
                                 AnnList anns,
                                 String doc,
                                 boolean external,
                                 VarScope vs)
                          throws QueryException
        Declares a new static variable.
        Parameters:
        var - variable
        expr - bound expression, possibly null
        anns - annotations
        doc - xqdoc string
        external - external flag
        vs - variable scope
        Returns:
        static variable reference
        Throws:
        QueryException - query exception
      • checkUp

        public void checkUp()
                     throws QueryException
        Ensures that none of the variable expressions is updating.
        Throws:
        QueryException - query exception
      • check

        public void check()
                   throws QueryException
        Checks if all variables were declared and are visible to all their references.
        Throws:
        QueryException - query exception
      • newRef

        public org.basex.query.var.StaticVarRef newRef​(QNm name,
                                                       StaticContext sc,
                                                       InputInfo ii)
                                                throws QueryException
        Returns a new reference to the (possibly not yet declared) variable with the given name.
        Parameters:
        ii - input info
        name - variable name
        sc - static context
        Returns:
        reference
        Throws:
        QueryException - if the variable is not visible
      • toXml

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

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