Package com.espertech.esper.epl.spec

Examples of com.espertech.esper.epl.spec.OnTriggerSetAssignment


                continue;
            }

            Tree childNode = node.getChild(i);
            ExprNode childEvalNode = astExprNodeMap.remove(childNode.getChild(0));
            assignments.add(new OnTriggerSetAssignment(childEvalNode));
        }
        return assignments;
    }
View Full Code Here


        TypeWidener[] wideners = new TypeWidener[desc.getAssignments().size()];
        List<String> properties = new ArrayList<String>();
        for (int i = 0; i < desc.getAssignments().size(); i++)
        {
            OnTriggerSetAssignment xxx = desc.getAssignments().get(i);
            Pair<String, ExprNode> assignmentPair = ExprNodeUtility.checkGetAssignmentToProp(xxx.getExpression());
            if (assignmentPair == null) {
                throw new ExprValidationException("Missing property assignment expression in assignment number " + i);
            }
            EventPropertyDescriptor writableProperty = eventTypeSPI.getWritableProperty(assignmentPair.getFirst());
View Full Code Here

            List<String> properties = new ArrayList<String>();
            ExprNode[] expressions = new ExprNode[entry.getKey().getAssignments().size()];
            for (int i = 0; i < entry.getKey().getAssignments().size(); i++)
            {
                OnTriggerSetAssignment assignment = entry.getKey().getAssignments().get(i);
                Pair<String, ExprNode> assignmentPair = ExprNodeUtility.checkGetAssignmentToProp(assignment.getExpression());
                expressions[i] = assignmentPair.getSecond();
                properties.add(assignmentPair.getFirst());
                eventPropertiesWritten.add(assignmentPair.getFirst());
            }
            EventBeanWriter writer = eventTypeSPI.getWriter(properties.toArray(new String[properties.size()]));
View Full Code Here

        EventPropertyWriter[] writers = new EventPropertyWriter[len];
        boolean[] notNullableField = new boolean[len];

        for (int i = 0; i < assignments.size(); i++)
        {
            OnTriggerSetAssignment assignment = assignments.get(i);
            String propertyName = assignment.getVariableName();
            expressions[i] = assignment.getExpression().getExprEvaluator();
            EventPropertyDescriptor writableProperty = eventTypeSPI.getWritableProperty(propertyName);

            if (writableProperty == null)
            {
                int indexDot = propertyName.indexOf(".");
                if ((namedWindowAlias != null) && (indexDot != -1)) {
                    String prefix = propertyName.substring(0, indexDot);
                    String name = propertyName.substring(indexDot + 1);
                    if (prefix.equals(namedWindowAlias)) {
                        writableProperty = eventTypeSPI.getWritableProperty(name);
                        propertyName = name;
                    }
                }
                if (writableProperty == null && indexDot != -1) {
                    String prefix = propertyName.substring(0, indexDot);
                    String name = propertyName.substring(indexDot + 1);
                    if (prefix.equals(namedWindowName)) {
                        writableProperty = eventTypeSPI.getWritableProperty(name);
                        propertyName = name;
                    }
                }
                if (writableProperty == null) {
                    throw new ExprValidationException("Property '" + propertyName + "' is not available for write access");
                }
            }
            writers[i] = eventTypeSPI.getWriter(propertyName);
            notNullableField[i] = writableProperty.getPropertyType().isPrimitive();

            properties.add(propertyName);
            wideners[i] = TypeWidenerFactory.getCheckPropertyAssignType(assignment.getExpression().toExpressionString(), assignment.getExpression().getExprEvaluator().getType(),
                    writableProperty.getPropertyType(), propertyName);
        }
        String[] propertyNames = properties.toArray(new String[properties.size()]);

        // map expression index to property index
View Full Code Here

        TypeWidener[] wideners = new TypeWidener[desc.getAssignments().size()];
        List<String> properties = new ArrayList<String>();
        for (int i = 0; i < desc.getAssignments().size(); i++)
        {
            OnTriggerSetAssignment assignment = desc.getAssignments().get(i);
            EventPropertyDescriptor writableProperty = eventTypeSPI.getWritableProperty(assignment.getVariableName());

            if (writableProperty == null)
            {
                throw new ExprValidationException("Property '" + assignment.getVariableName() + "' is not available for write access");
            }

            wideners[i] = TypeWidenerFactory.getCheckPropertyAssignType(assignment.getExpression().toExpressionString(), assignment.getExpression().getExprEvaluator().getType(),
                    writableProperty.getPropertyType(), assignment.getVariableName());
            properties.add(assignment.getVariableName());
        }

        // check copy-able
        EventBeanCopyMethod copyMethod = eventTypeSPI.getCopyMethod(properties.toArray(new String[properties.size()]));
        if (copyMethod == null)
View Full Code Here

            List<String> properties = new ArrayList<String>();
            ExprNode[] expressions = new ExprNode[entry.getKey().getAssignments().size()];
            for (int i = 0; i < entry.getKey().getAssignments().size(); i++)
            {
                OnTriggerSetAssignment assignment = entry.getKey().getAssignments().get(i);
                expressions[i] = assignment.getExpression();
                properties.add(assignment.getVariableName());
                eventPropertiesWritten.add(assignment.getVariableName());
            }
            EventBeanWriter writer = eventTypeSPI.getWriter(properties.toArray(new String[properties.size()]));
            desc.add(new InternalEventRouterEntry(priority, isDrop, entry.getKey().getOptionalWhereClause(), expressions, writer, entry.getValue().getWideners(), entry.getValue().getOutputView(), entry.getValue().getAgentInstanceLock(), entry.getValue().hasSubselect));
        }
View Full Code Here

TOP

Related Classes of com.espertech.esper.epl.spec.OnTriggerSetAssignment

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.