Package xbird.xquery.expr

Examples of xbird.xquery.expr.XQExpression.eval()


                    String selected = (String) cell.getUserObject();
                    XQExpression expr = sourceExprMap.get(selected);
                    DynamicContext dynEnv = new DynamicContext(statEnv);
                    final Sequence result;
                    try {
                        result = expr.eval(ValueSequence.EMPTY_SEQUENCE, dynEnv);
                    } catch (Exception ex) {
                        JOptionPane.showMessageDialog(frame, "eval failed!: " + ex.getMessage());
                        ex.printStackTrace();
                        return;
                    }
View Full Code Here


        }
        // #3 evaluation
        StaticContext statEnv = parser.getStaticContext();
        final Sequence result;
        try {
            result = body.eval(null, new DynamicContext(statEnv));
        } catch (XQueryException e) {
            throw new RemoteException("Evaluation failed.", e);
        }
        return (T) wrapResult(result, returnType);
    }
View Full Code Here

            }
        }
        // execute
        final Sequence<? extends Item> result;
        try {
            result = body.eval(null, new DynamicContext(loaded.staticEnv));
        } catch (XQueryException e) {
            reportError("Execution failed: " + queryPath, e, out);
            return;
        }
        // serialize       
View Full Code Here

        module.staticAnalysis(statEnv);
        // dynamic evaluation     
        XQExpression body = module.getExpression();
        dynEnv.setQueryExpression(body);
        evalHook(dynEnv);
        Sequence<? extends Item> result = body.eval(contextItem, dynEnv);
        if(PROFILE_LOG.isInfoEnabled()) {
            Profiler profiler = dynEnv.getProfiler();
            if(profiler != null && profiler.getDTMReads() > 0) {
                PROFILE_LOG.info(profiler);
            }
View Full Code Here

        collector.invokeThreadedVariables(dynEnv); // TODO REVIEWME cancelling

        final Sequence<? extends Item> resultSeq;
        _runningThreads.put(rc, Thread.currentThread());
        try {
            resultSeq = queryExpr.eval(null, dynEnv);
        } catch (XQueryException e) {
            LOG.error("execute failed: \n" + queryExpr, e);
            rc.setFault(e);
            _resHandler.onResponse(rc);
            return;
View Full Code Here

        if(_local) {
            final XQExpression valueExpr = _value;
            if(valueExpr == null) {
                throw new IllegalStateException();
            }
            result = valueExpr.eval(contextSeq, dynEnv);
            this._result = result;
        }
        return result;
    }
View Full Code Here

            int counter = 0;
            outer: for(Item it : srcItor) {
                final Comparable[] persistKeys = new Comparable[keysize];
                if(keysize == 1) {
                    final XQExpression key = _pkeyExprs.get(0);
                    final IFocus<? extends Item> pkvItor = key.eval(it, dynEnv).iterator();
                    for(Item fpv : pkvItor) {
                        if(_isNodeComp || fpv instanceof AtomicValue) {
                            persistKeys[0] = fpv;
                        } else {
                            if(counter == 0) {
View Full Code Here

                    }
                    pkvItor.closeQuietly();
                } else {// TODO FIXME multiple join keys   
                    for(int i = 0; i < keysize; i++) {
                        final XQExpression key = _pkeyExprs.get(i);
                        final Sequence<? extends Item> pkv = key.eval(it, dynEnv);
                        final Iterator<? extends Item> pkvItor = pkv.iterator();
                        if(!pkvItor.hasNext()) {
                            continue outer;
                        }
                        final Item fpv = pkvItor.next();
View Full Code Here

        assert (paramArity == argArity);
        FunctionCallContext recEnv = new FunctionCallContext(dynEnv);
        for(int i = 0; i < paramArity; i++) {
            ParametricVariable paramVar = params.get(i);
            XQExpression argExpr = _params.get(i);
            Sequence argValue = argExpr.eval(contextSeq, dynEnv);
            paramVar.allocateResult(argValue, recEnv);
        }
        Sequence<? extends Item> result = uf.eval(contextSeq, ValueSequence.EMPTY_SEQUENCE, recEnv);
        if(LOG.isDebugEnabled()) {
            LOG.debug("Invoke RecursiveCall: " + QNameUtil.toLexicalForm(getFuncName()));
View Full Code Here

            }
            final int exprlen = _exprs.size();
            while(focuss.incrExprPosition() < exprlen) {
                final int at = focuss.getExprPosition();
                final XQExpression e = _exprs.get(at);
                final Sequence<? extends Item> res = e.eval(_contextSeq, _dynEnv);
                final IFocus<? extends Item> resItor = res.iterator();
                if(resItor.hasNext()) {
                    final Item it = resItor.next();
                    focuss.setContextItem(it);
                    focuss.setRemaining(resItor);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.