Package com.espertech.esper.epl.expression

Examples of com.espertech.esper.epl.expression.ExprNode


        return raw.getStreamSpecs().get(0).getViewSpecs()[0].getObjectParameters().get(0);
    }

    public Expression compileExpressionToSODA(String expression) throws EPException
    {
        ExprNode node = compileExpression(expression);
        return StatementSpecMapper.unmap(node);
    }
View Full Code Here


        for (int i = 0; i < getChildNodes().size() - 1; i++) {
            if (optionalMaxExpressions.size() <= i) {
                continue;
            }
            ExprNode optionalMaxExpression = optionalMaxExpressions.get(i);
            if (optionalMaxExpression == null) {
                continue;
            }
            if (optionalMaxExpression.isConstantResult()) {
                Number result = (Number) optionalMaxExpression.getExprEvaluator().evaluate(null, true, null);
                if (result != null) {
                    cachedMaxPerChild[i] = result.intValue();
                }
            }
            else {
View Full Code Here

            PatternExpressionUtil.toPrecedenceFreeEPL(writer, "->", getChildNodes(), getPrecedence());
        }
        else {
            getChildNodes().get(0).toEPL(writer, PatternExpressionPrecedenceEnum.MINIMUM);
            for (int i = 1; i < getChildNodes().size(); i++) {
                ExprNode optionalMaxExpression = null;
                if (optionalMaxExpressions.size() > (i - 1)) {
                    optionalMaxExpression = optionalMaxExpressions.get(i - 1);
                }
                if (optionalMaxExpression == null) {
                    writer.append(" -> ");
                }
                else {
                    writer.append(" -[");
                    writer.append(optionalMaxExpression.toExpressionString());
                    writer.append("]> ");
                }
                getChildNodes().get(i).toEPL(writer, PatternExpressionPrecedenceEnum.MINIMUM);
            }
        }
View Full Code Here

        // validate update expressions
        try {
            for (OnTriggerSetAssignment assignment : updateSpec.getAssignments())
            {
                ExprNode validated = ExprNodeUtility.getValidatedSubtree(assignment.getExpression(), validationContext);
                assignment.setExpression(validated);
                EPStatementStartMethodHelperValidate.validateNoAggregations(validated, "Aggregation functions may not be used within an update-clause");
            }
        }
        catch (ExprValidationException e) {
View Full Code Here

        // categorized
        else if (detailParent.getType() == EsperEPL2Ast.CREATE_CTX_CAT){
            List<ContextDetailCategoryItem> items = new ArrayList<ContextDetailCategoryItem>();
            for (int i = 0; i < detailParent.getChildCount() -1; i++) {
                Tree categoryParent = detailParent.getChild(i);
                ExprNode exprNode = astExprNodeMap.remove(categoryParent.getChild(0));
                String name = categoryParent.getChild(1).getText();
                items.add(new ContextDetailCategoryItem(exprNode, name));
            }
            filterSpec = ASTExprHelper.walkFilterSpec(detailParent.getChild(detailParent.getChildCount() - 1), propertyEvalSpec, astExprNodeMap);
            contextDetail = new ContextDetailCategory(items, filterSpec);
View Full Code Here

                null, statementContext.getTimeProvider(), statementContext.getVariableService(), exprEvaluatorContextStatement,
                statementContext.getEventAdapterService(), statementContext.getStatementName(), statementContext.getStatementId(), statementContext.getAnnotations(), statementContext.getContextDescriptor(), false);
        for (SelectClauseElementCompiled compiled : statementSpec.getSelectClauseSpec().getSelectExprList()) {
            if (compiled instanceof SelectClauseExprCompiledSpec) {
                SelectClauseExprCompiledSpec expr = (SelectClauseExprCompiledSpec) compiled;
                ExprNode validatedExpression = ExprNodeUtility.getValidatedSubtree(expr.getSelectExpression(), validationContext);
                expr.setSelectExpression(validatedExpression);
                if (expr.getAssignedName() == null) {
                    if (expr.getProvidedName() == null) {
                        expr.setAssignedName(expr.getSelectExpression().toExpressionString());
                    }
View Full Code Here

        {
            // Evaluate assignment expression
            StreamTypeService typeService = new StreamTypeServiceImpl(new EventType[0], new String[0], new boolean[0], services.getEngineURI(), false);
            ExprEvaluatorContextStatement evaluatorContextStmt = new ExprEvaluatorContextStatement(statementContext);
            ExprValidationContext validationContext = new ExprValidationContext(typeService, statementContext.getMethodResolutionService(), null, statementContext.getSchedulingService(), statementContext.getVariableService(), evaluatorContextStmt, statementContext.getEventAdapterService(), statementContext.getStatementName(), statementContext.getStatementId(), statementContext.getAnnotations(), statementContext.getContextDescriptor(), false);
            ExprNode validated = ExprNodeUtility.getValidatedSubtree(createDesc.getAssignment(), validationContext);
            value = validated.getExprEvaluator().evaluate(null, true, evaluatorContextStmt);
        }

        // Create variable
        try
        {
View Full Code Here

            RowRegexExprNodeAtom atom = (RowRegexExprNodeAtom) node;

            // assign stream number for single-variables for most direct expression eval; multiple-variable gets -1
            int streamNum = variableStreams.get(atom.getTag()).getFirst();
            boolean multiple = variableStreams.get(atom.getTag()).getSecond();
            ExprNode expressionDef = variableDefinitions.get(atom.getTag());

            RegexNFAStateBase nextState;
            if ((atom.getType() == RegexNFATypeEnum.ZERO_TO_MANY) || (atom.getType() == RegexNFATypeEnum.ZERO_TO_MANY_RELUCTANT))
            {
                nextState = new RegexNFAStateZeroToMany(toString(nodeNumStack), atom.getTag(), streamNum, multiple, atom.getType().isGreedy(), expressionDef);
View Full Code Here

            RowRegexExprNodeAtom atom = (RowRegexExprNodeAtom) node;

            // assign stream number for single-variables for most direct expression eval; multiple-variable gets -1
            int streamNum = variableStreams.get(atom.getTag()).getFirst();
            boolean multiple = variableStreams.get(atom.getTag()).getSecond();
            ExprNode expressionDef = variableDefinitions.get(atom.getTag());

            RegexNFAStateBase nextState;
            if ((atom.getType() == RegexNFATypeEnum.ZERO_TO_MANY) || (atom.getType() == RegexNFATypeEnum.ZERO_TO_MANY_RELUCTANT))
            {
                nextState = new RegexNFAStateZeroToMany(toString(nodeNumStack), atom.getTag(), streamNum, multiple, atom.getType().isGreedy(), expressionDef);
View Full Code Here

        for (int i = 0; i < getChildNodes().size() - 1; i++) {
            if (optionalMaxExpressions.size() <= i) {
                continue;
            }
            ExprNode optionalMaxExpression = optionalMaxExpressions.get(i);
            if (optionalMaxExpression == null) {
                continue;
            }
            if (optionalMaxExpression.isConstantResult()) {
                Number result = (Number) optionalMaxExpression.getExprEvaluator().evaluate(null, true, null);
                if (result != null) {
                    cachedMaxPerChild[i] = result.intValue();
                }
            }
            else {
View Full Code Here

TOP

Related Classes of com.espertech.esper.epl.expression.ExprNode

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.