Class InlineContext


  • public final class InlineContext
    extends Object
    Context for inlining expressions.
    Author:
    BaseX Team 2005-22, BSD License, Christian Gruen
    • Field Detail

      • var

        public final Var var
        Variable reference, or null for context reference.
      • expr

        public final Expr expr
        Expression to inline.
    • Constructor Detail

      • InlineContext

        public InlineContext​(Var var,
                             Expr expr,
                             CompileContext cc)
        Constructor.
        Parameters:
        var - variable (Var reference) or context (null) to replace
        expr - expression to inline
        cc - compilation context
    • Method Detail

      • inlineable

        public boolean inlineable​(Expr... targets)
        Checks if inlining into the specified expressions is possible. See Expr.inlineable(org.basex.query.InlineContext) for further details.
        Parameters:
        targets - target expressions
        Returns:
        result of check
      • inlineOrNull

        public Expr inlineOrNull​(Expr target)
                          throws QueryException
        Inlines an expression into the specified target expression, or returns null if no inlining is required. See Expr.inline(org.basex.query.InlineContext) for further details.
        Parameters:
        target - expression in which the expression will be inlined
        Returns:
        optimized expression or null
        Throws:
        QueryException - query exception
      • inline

        public boolean inline​(Expr[] exprs)
                       throws QueryException
        Inlines an expression into the specified expressions.
        Parameters:
        exprs - expressions to update
        Returns:
        true if the array has changed, false otherwise
        Throws:
        QueryException - query exception
      • inline

        public boolean inline​(Expr[] exprs,
                              boolean error)
                       throws QueryException
        Inlines an expression into the specified expressions.
        Parameters:
        exprs - expressions to update
        error - catch errors
        Returns:
        true if the array has changed, false otherwise
        Throws:
        QueryException - query exception