Package xbird.xquery.expr.func

Examples of xbird.xquery.expr.func.DirectFunctionCall


     */
    private static XQExpression applyFLWRCutting(final FLWRExpr flwr) throws XQueryException {
        if(flwr.getWhereExpr() == null) {
            final XQExpression retExpr = flwr.getFilteredReturnExpr();
            if(retExpr instanceof DirectFunctionCall && !(retExpr instanceof RecursiveCall)) {
                final DirectFunctionCall funcall = (DirectFunctionCall) retExpr;
                final List<XQExpression> params = funcall.getParams();
                if(params.size() == 1) {
                    FunctionSignature sig = funcall.getFunction().getFunctionSignature(1);
                    Type type = sig.getArgumentType(0);
                    Occurrence occ = type.quantifier();
                    if(!occ.accepts(Occurrence.OCC_ZERO_OR_MORE.getAlignment())) {
                        return flwr; //TODO REVIEWME
                    }
View Full Code Here


                if(!clauses.isEmpty()) {
                    Binding firstClause = clauses.get(0);
                    BindingVariable bindingVar = firstClause.getVariable();
                    XQExpression bindingExpr = bindingVar.getValue();
                    if(bindingExpr instanceof DirectFunctionCall) {
                        DirectFunctionCall funcall = (DirectFunctionCall) bindingExpr;
                        if(FnCollection.FUNC_NAME.equals(funcall.getFuncName())) {
                            List<XQExpression> params = funcall.getParams();
                            final String colpath;
                            if(params.isEmpty()) {
                                colpath = "/";
                            } else {
                                XQExpression argExpr = params.get(0);
                                colpath = argExpr.eval(null, DynamicContext.DUMMY).toString();
                            }
                            MapExpr mapExpr = new MapExpr(colpath, bindingVar, flwrExpr);
                            return mapExpr.staticAnalysis(statEnv);
                        }
                    }
                }
            } else if(expr instanceof PathExpr) {
                PathExpr pathExpr = (PathExpr) expr;
                List<XQExpression> steps = pathExpr.getSteps();
                if(steps.size() > 1) {
                    XQExpression firstStep = steps.get(0);
                    if(firstStep instanceof DirectFunctionCall) {
                        DirectFunctionCall funcall = (DirectFunctionCall) firstStep;
                        if(FnCollection.FUNC_NAME.equals(funcall.getFuncName())) {
                            List<XQExpression> params = funcall.getParams();
                            final String colpath;
                            if(params.isEmpty()) {
                                colpath = "/";
                            } else {
                                XQExpression argExpr = params.get(0);
View Full Code Here

TOP

Related Classes of xbird.xquery.expr.func.DirectFunctionCall

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.