Examples of ExprNodeScript


Examples of com.espertech.esper.epl.script.ExprNodeScript

            Pair<String, String> mappedPropertyPair = ASTFilterSpecHelper.getMappedPropertyPair(node);
            if (mappedPropertyPair != null) {
                ExpressionScriptProvided script = findScript(mappedPropertyPair.getFirst(), 1);
                if (script != null) {
                    exprNode = new ExprNodeScript(configurationInformation.getEngineDefaults().getScripts().getDefaultDialect(), script,
                            Collections.<ExprNode>singletonList(new ExprConstantNodeImpl(mappedPropertyPair.getSecond())));
                }
            }
        }
        // --> this is more then one child node, and the first child node is a simple property
View Full Code Here

Examples of com.espertech.esper.epl.script.ExprNodeScript

        if (!scriptExpressions.isEmpty()) {
            String name = node.getChild(0).getText();
            List<ExprChainedSpec> chained = getLibFuncChain(parent);
            ExpressionScriptProvided script = findScript(name, chained.get(0).getParameters().size());
            if (script != null) {
                astExprNodeMap.put(node, new ExprNodeScript(configurationInformation.getEngineDefaults().getScripts().getDefaultDialect(), script, chained.get(0).getParameters()));
                return;
            }
        }

        // Could be a mapped property with an expression-parameter "mapped(expr)" or array property with an expression-parameter "array(expr)".
View Full Code Here

Examples of com.espertech.esper.epl.script.ExprNodeScript

        // try scripting expression
        if (!scriptExpressions.isEmpty()) {
            String name = chained.get(0).getName();
            ExpressionScriptProvided script = findScript(name, chained.get(0).getParameters().size());
            if (script != null) {
                dotNode.addChildNode(new ExprNodeScript(configurationInformation.getEngineDefaults().getScripts().getDefaultDialect(), script, chained.get(0).getParameters()));
                chained.remove(0);
            }
        }

        astExprNodeMap.put(node, dotNode);
View Full Code Here

Examples of com.espertech.esper.epl.script.ExprNodeScript

                String name = chain.get(0).getName();
                if (mapContext.getExpressionDeclarations() != null && mapContext.getExpressionDeclarations().containsKey(name)) {
                    return new ExprDeclaredNodeImpl(mapContext.getExpressionDeclarations().get(name), chain.get(0).getParameters());
                }
                if (mapContext.getScripts() != null && mapContext.getScripts().containsKey(name)) {
                    return new ExprNodeScript(mapContext.getConfiguration().getEngineDefaults().getScripts().getDefaultDialect(), mapContext.getScripts().get(name), chain.get(0).getParameters());
                }
            }
            return new ExprDotNode(chain,
                    mapContext.getConfiguration().getEngineDefaults().getExpression().isDuckTyping(),
                    mapContext.getConfiguration().getEngineDefaults().getExpression().isUdfCache());
View Full Code Here

Examples of com.espertech.esper.epl.script.ExprNodeScript

            ExprLambdaGoesNode lambdaNode = (ExprLambdaGoesNode) expr;
            LambdaExpression lambdaExpr = new LambdaExpression(new ArrayList<String>(lambdaNode.getGoesToNames()));
            return lambdaExpr;
        }
        else if (expr instanceof ExprNodeScript) {
            ExprNodeScript scriptNode = (ExprNodeScript) expr;
            DotExpression dotExpr = new DotExpression();
            dotExpr.add(scriptNode.getScript().getName(), unmapExpressionDeep(scriptNode.getParameters(), unmapContext));
            return dotExpr;
        }
        throw new IllegalArgumentException("Could not map expression node of type " + expr.getClass().getSimpleName());
    }
View Full Code Here

Examples of com.espertech.esper.epl.script.ExprNodeScript

                String name = chain.get(0).getName();
                if (mapContext.getExpressionDeclarations() != null && mapContext.getExpressionDeclarations().containsKey(name)) {
                    return new ExprDeclaredNodeImpl(mapContext.getExpressionDeclarations().get(name), chain.get(0).getParameters());
                }
                if (mapContext.getScripts() != null && mapContext.getScripts().containsKey(name)) {
                    return new ExprNodeScript(mapContext.getConfiguration().getEngineDefaults().getScripts().getDefaultDialect(), mapContext.getScripts().get(name), chain.get(0).getParameters());
                }
            }
            return new ExprDotNode(chain,
                    mapContext.getConfiguration().getEngineDefaults().getExpression().isDuckTyping(),
                    mapContext.getConfiguration().getEngineDefaults().getExpression().isUdfCache());
View Full Code Here

Examples of com.espertech.esper.epl.script.ExprNodeScript

            ExprLambdaGoesNode lambdaNode = (ExprLambdaGoesNode) expr;
            LambdaExpression lambdaExpr = new LambdaExpression(new ArrayList<String>(lambdaNode.getGoesToNames()));
            return lambdaExpr;
        }
        else if (expr instanceof ExprNodeScript) {
            ExprNodeScript scriptNode = (ExprNodeScript) expr;
            DotExpression dotExpr = new DotExpression();
            dotExpr.add(scriptNode.getScript().getName(), unmapExpressionDeep(scriptNode.getParameters(), unmapContext));
            return dotExpr;
        }
        throw new IllegalArgumentException("Could not map expression node of type " + expr.getClass().getSimpleName());
    }
View Full Code Here

Examples of com.espertech.esper.epl.script.ExprNodeScript

            Pair<String, String> mappedPropertyPair = ASTFilterSpecHelper.getMappedPropertyPair(node);
            if (mappedPropertyPair != null) {
                ExpressionScriptProvided script = findScript(mappedPropertyPair.getFirst(), 1);
                if (script != null) {
                    exprNode = new ExprNodeScript(configurationInformation.getEngineDefaults().getScripts().getDefaultDialect(), script,
                            Collections.<ExprNode>singletonList(new ExprConstantNodeImpl(mappedPropertyPair.getSecond())));
                }
            }
        }
        // --> this is more then one child node, and the first child node is a simple property
View Full Code Here

Examples of com.espertech.esper.epl.script.ExprNodeScript

        if (!scriptExpressions.isEmpty()) {
            String name = node.getChild(0).getText();
            List<ExprChainedSpec> chained = getLibFuncChain(parent);
            ExpressionScriptProvided script = findScript(name, chained.get(0).getParameters().size());
            if (script != null) {
                astExprNodeMap.put(node, new ExprNodeScript(configurationInformation.getEngineDefaults().getScripts().getDefaultDialect(), script, chained.get(0).getParameters()));
                return;
            }
        }

        // Could be a mapped property with an expression-parameter "mapped(expr)" or array property with an expression-parameter "array(expr)".
View Full Code Here

Examples of com.espertech.esper.epl.script.ExprNodeScript

        // try scripting expression
        if (!scriptExpressions.isEmpty()) {
            String name = chained.get(0).getName();
            ExpressionScriptProvided script = findScript(name, chained.get(0).getParameters().size());
            if (script != null) {
                dotNode.addChildNode(new ExprNodeScript(configurationInformation.getEngineDefaults().getScripts().getDefaultDialect(), script, chained.get(0).getParameters()));
                chained.remove(0);
            }
        }

        astExprNodeMap.put(node, dotNode);
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.