Package org.exist.xquery

Examples of org.exist.xquery.AnalyzeContextInfo


                  pm.queryStarted(context.getWatchDog());
                 
                  final FunctionCall call = new FunctionCall(context, function);
                  if (args != null)
                    {call.setArguments(args);}
                  call.analyze(new AnalyzeContextInfo());
              call.eval(NodeSet.EMPTY_SET);
            }
            } catch(final XPathException e) {
              //XXX: log
              e.printStackTrace();
View Full Code Here


    public FunUnordered(XQueryContext context) {
        super(context, signature);
    }
   
    public void analyze(AnalyzeContextInfo contextInfo) throws XPathException {
        final AnalyzeContextInfo newContextInfo = new AnalyzeContextInfo(contextInfo);
        newContextInfo.setParent(this);
        newContextInfo.addFlag(UNORDERED);
        super.analyze(newContextInfo);
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.exist.xquery.functions.ExtFulltext#analyze(org.exist.xquery.AnalyzeContextInfo)
     */
    public void analyze(AnalyzeContextInfo contextInfo) throws XPathException {
        final AnalyzeContextInfo newContextInfo = new AnalyzeContextInfo(contextInfo);
        super.analyze(newContextInfo);
        if (maxDistance != null) {
            maxDistance.analyze(newContextInfo);
        }
        if (minDistance != null) {
View Full Code Here

                LOG.debug(treeParser.getErrorMessage());
                throw new EXistException(treeParser.getErrorMessage());
            }
            LOG.info("query: " + ExpressionDumper.dump(expr));
            final long start = System.currentTimeMillis();
            expr.analyze(new AnalyzeContextInfo());
            final Sequence seq= expr.eval(null, null);
           
            QueryResponseCollection[] collections = null;
            if (!seq.isEmpty() && Type.subTypeOf(seq.getItemType(), Type.NODE))
                {collections = collectQueryInfo(scanResults(seq));}
View Full Code Here

           
            //convert the arguments
            final org.exist.xquery.value.Sequence[] fnArgs = convertToExistFunctionArguments(xqueryContext, fn, arguments);
           
            //execute the function call
            fnRef.analyze(new AnalyzeContextInfo());
            final org.exist.xquery.value.Sequence result = fnRef.evalFunction(null, null, fnArgs);
           
            return new SequenceAdapter(result);
        } catch(final URISyntaxException use) {
            throw new RestXqServiceException(use.getMessage(), use);
View Full Code Here

      XSLContext context = new XSLContext(broker.getBrokerPool());
     
      context.setDefaultFunctionNamespace(Factory.namespaceURI);
     
      XSLStylesheet expr = (XSLStylesheet) stylesheet.compile(context);
      AnalyzeContextInfo info = new AnalyzeContextInfo((XQueryContext)context);
      info.setFlags(Expression.IN_NODE_CONSTRUCTOR);
        expr.analyze(info);

        if (context.optimizationsEnabled()) {
            Optimizer optimizer = new Optimizer((XQueryContext) context);
            expr.accept(optimizer);
            if (optimizer.hasOptimized()) {
                context.reset(true);
                expr.resetState(true);
                expr.analyze(new AnalyzeContextInfo());
            }
        }

        System.out.println(ExpressionDumper.dump(expr));
        // Log the query if it is not too large, but avoid
View Full Code Here

                throw new StaticXQueryException(
                treeParser.getErrorMessage(),
                treeParser.getLastException());
            }

            expr.analyze(new AnalyzeContextInfo(context));

//            if (context.optimizationsEnabled()) {
//                Optimizer optimizer = new Optimizer(context);
//                expr.accept(optimizer);
//                if (optimizer.hasOptimized()) {
View Full Code Here

////                throw new XPathException(getASTNode(), "XQST0085 : can not undefine '" + namespaceDecls[i] + "'");
//                } else
//                    context.declareInScopeNamespace(namespaceDecls[i].getLocalName(), namespaceDecls[i].getNamespaceURI());
//            }
//        }
        AnalyzeContextInfo newContextInfo = new AnalyzeContextInfo(contextInfo);
        newContextInfo.setParent(this);
        newContextInfo.addFlag(IN_NODE_CONSTRUCTOR);
//        qnameExpr.analyze(newContextInfo);
//        if(attributes != null) {
//            for(int i = 0; i < attributes.length; i++) {
//                attributes[i].analyze(newContextInfo);
//            }
View Full Code Here

      final PathExpr expr = new PathExpr(context);
      treeParser.xpath(ast, expr);
      if (treeParser.foundErrors()) {
        throw new SAXException(treeParser.getErrorMessage());
      }
      expr.analyze(new AnalyzeContextInfo());
      final Sequence seq = expr.eval(null, null);
      return seq;
    } catch (final RecognitionException e) {
      LOG.warn("error while creating variable", e);
      throw new SAXException(e);
View Full Code Here

            expr = new PathExpr(context);
            treeParser.xpath(ast, expr);
            if (treeParser.foundErrors()) {
                LOG.debug(treeParser.getErrorMessage());
            }
            expr.analyze(new AnalyzeContextInfo());
            for (final SequenceIterator i = other.iterate(); i.hasNext();) {
                final NodeProxy p = (NodeProxy) i.nextItem();
                final IteratorItem item = new IteratorItem(broker, p, expr, docs, context);
                list.add(item);
            }
View Full Code Here

TOP

Related Classes of org.exist.xquery.AnalyzeContextInfo

Copyright © 2018 www.massapicom. 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.