Examples of BooleanExpression


Examples of org.apache.activemq.filter.BooleanExpression

            }
        };
    }

    protected MessageReferenceFilter createSelectorFilter(String selector) throws InvalidSelectorException {
        final BooleanExpression selectorExpression = SelectorParser.parse(selector);

        return new MessageReferenceFilter() {
            public boolean evaluate(ConnectionContext context, MessageReference r) throws JMSException {
                MessageEvaluationContext messageEvaluationContext = context.getMessageEvaluationContext();

                messageEvaluationContext.setMessageReference(r);
                if (messageEvaluationContext.getDestination() == null) {
                    messageEvaluationContext.setDestination(getActiveMQDestination());
                }

                return selectorExpression.matches(messageEvaluationContext);
            }
        };
    }
View Full Code Here

Examples of org.apache.activemq.filter.BooleanExpression

        Message[] messages = destination.browse();
        ArrayList<CompositeData> c = new ArrayList<CompositeData>();

        MessageEvaluationContext ctx = new MessageEvaluationContext();
        ctx.setDestination(destination.getActiveMQDestination());
        BooleanExpression selectorExpression = selector == null ? null : new SelectorParser().parse(selector);

        for (int i = 0; i < messages.length; i++) {
            try {

                if (selectorExpression == null) {
                    c.add(OpenTypeSupport.convert(messages[i]));
                } else {
                    ctx.setMessageReference(messages[i]);
                    if (selectorExpression.matches(ctx)) {
                        c.add(OpenTypeSupport.convert(messages[i]));
                    }
                }

            } catch (Throwable e) {
View Full Code Here

Examples of org.apache.activemq.filter.BooleanExpression

        Message[] messages = destination.browse();
        ArrayList<Object> answer = new ArrayList<Object>();

        MessageEvaluationContext ctx = new MessageEvaluationContext();
        ctx.setDestination(destination.getActiveMQDestination());
        BooleanExpression selectorExpression = selector == null ? null : new SelectorParser().parse(selector);

        for (int i = 0; i < messages.length; i++) {
            try {
                Message message = messages[i];
                if (selectorExpression == null) {
                    answer.add(OpenTypeSupport.convert(message));
                } else {
                    ctx.setMessageReference(message);
                    if (selectorExpression.matches(ctx)) {
                        answer.add(message);
                    }
                }

            } catch (Throwable e) {
View Full Code Here

Examples of org.apache.uima.ruta.expression.bool.BooleanExpression

      map = map.substring(0, map.length() - 2);
      return name + a.getNamespace() + map + ")";
    } else if (action instanceof DynamicAnchoringAction) {
      DynamicAnchoringAction a = (DynamicAnchoringAction) action;

      BooleanExpression active = a.getActive();
      NumberExpression panelty = a.getPanelty();
      NumberExpression factor = a.getFactor();

      String pa = verbalizer.verbalize(active);
      String pp = panelty == null ? "" : ", " + verbalizer.verbalize(panelty);
      String pf = factor == null ? "" : ", " + verbalizer.verbalize(factor);
      return name + pa + pp + pf + ")";
    } else if (action instanceof GetListAction) {
      GetListAction a = (GetListAction) action;
      String var = a.getVar();
      String op = verbalizer.verbalize(a.getOpExpr());
      return name + var + ", " + op + ")";
    } else if (action instanceof MarkTableAction) {
      MarkTableAction a = (MarkTableAction) action;
      TypeExpression typeExpr = a.getTypeExpr();
      NumberExpression indexExpr = a.getIndexExpr();
      WordTableExpression tableExpr = a.getTableExpr();
      Map<StringExpression, NumberExpression> featureMap = a.getFeatureMap();
      BooleanExpression ignoreCase = a.getIgnoreCase();
      NumberExpression ignoreLength = a.getIgnoreLength();
      StringExpression ignoreChar = a.getIgnoreChar();
      NumberExpression maxIgnoreChar = a.getMaxIgnoreChar();

      String type = verbalizer.verbalize(typeExpr);
View Full Code Here

Examples of org.codehaus.groovy.ast.expr.BooleanExpression

     *
     * @param method the {@link org.codehaus.groovy.ast.MethodNode} for assertion injection
     * @param precondition the {@link org.gcontracts.domain.Precondition} the assertion statement should be generated from
     */
    public void generatePreconditionAssertionStatement(final MethodNode method, final org.gcontracts.domain.Precondition precondition)  {
        final BooleanExpression preconditionBooleanExpression = addCallsToSuperMethodNodeAnnotationClosure(method.getDeclaringClass(), method, Precondition.class, precondition.booleanExpression(), false);

        BlockStatement blockStatement;

        final BlockStatement originalBlockStatement = precondition.originalBlockStatement();
        // if use execution tracker flag is found in the meta-data the annotation closure visitor discovered
View Full Code Here

Examples of org.codehaus.groovy.ast.expr.BooleanExpression

        boolean isAnotherPreconditionAvailable = AnnotationUtils.getAnnotationNodeInHierarchyWithMetaAnnotation(type.getSuperClass(), methodNode, ClassHelper.makeWithoutCaching(Precondition.class)).size() > 0;
        if (!isAnotherPreconditionAvailable) return;

        // if there is another preconditio up the inheritance path, we need a default precondition with FALSE
        // e.g. C1 <no precondition> : C2 <item != null> == false || item != null
        BooleanExpression preconditionBooleanExpression = new BooleanExpression(ConstantExpression.FALSE);
        preconditionBooleanExpression = addCallsToSuperMethodNodeAnnotationClosure(type, methodNode, Precondition.class, preconditionBooleanExpression, false);
        // if precondition could not be found in parent class, let's return
        if (preconditionBooleanExpression.getExpression() == ConstantExpression.FALSE)
            return;

        final BlockStatement blockStatement = wrapAssertionBooleanExpression(type,  methodNode, preconditionBooleanExpression, "precondition");
       
        addPrecondition(methodNode, blockStatement);
View Full Code Here

Examples of org.codehaus.groovy.ast.expr.BooleanExpression

    private BlockStatement originalBlockStatement;
    private BooleanExpression booleanExpression;

    public Assertion()  {
        this.booleanExpression = new BooleanExpression(ConstantExpression.TRUE);
    }
View Full Code Here

Examples of org.codehaus.groovy.ast.expr.BooleanExpression

    }

    public void and(T other) {
        Validate.notNull(other);

        BooleanExpression newBooleanExpression =
                new BooleanExpression(
                        new BinaryExpression(
                                booleanExpression(),
                                Token.newSymbol(Types.LOGICAL_AND, -1, -1),
                                other.booleanExpression()
                        )
                );
        newBooleanExpression.setSourcePosition(booleanExpression());

        renew(newBooleanExpression);
    }
View Full Code Here

Examples of org.codehaus.groovy.ast.expr.BooleanExpression

    }

    public void or(T other) {
        Validate.notNull(other);

        BooleanExpression newBooleanExpression =
                new BooleanExpression(
                        new BinaryExpression(
                                booleanExpression(),
                                Token.newSymbol(Types.LOGICAL_OR, -1, -1),
                                other.booleanExpression()
                        )
                );
        newBooleanExpression.setSourcePosition(booleanExpression());

        renew(newBooleanExpression);
    }
View Full Code Here

Examples of org.datanucleus.store.mapped.expression.BooleanExpression

        if (hasDiscriminator && restrictDiscriminator)
        {
            // Add the discriminator required values to the WHERE clause
            // Loop through each possible candidate type and add the discrim values for each branch
            boolean multipleDiscriminatorValues = candidateTypes.length > 1 ? true: false;
            BooleanExpression discExpr = null;
            for (int i=0; i<candidateTypes.length; i++)
            {
                // For this candidate type, go through the possible classes persistable in this table and add an OR to the WHERE clause
                String candidateName = candidateTypes[i].getName();
                BooleanExpression discExprCand = getExpressionForDiscriminatorForClass(stmt, candidateName,
                    dismd, discriminatorMapping, discrimTableExpr, storeMgr);
                if (discExpr != null)
                {
                    discExpr = discExpr.ior(discExprCand);
                }
                else
                {
                    discExpr = discExprCand;
                }
                if (includeSubclasses)
                {
                    Iterator iterator = storeMgr.getSubClassesForClass(candidateName, true, clr).iterator();
                    while (iterator.hasNext())
                    {
                        String subCandidateType = (String)iterator.next();
                        BooleanExpression discExprSub = getExpressionForDiscriminatorForClass(stmt,
                            subCandidateType, dismd, discriminatorMapping, discrimTableExpr, storeMgr);
                        discExpr = discExpr.ior(discExprSub);
                        if (!multipleDiscriminatorValues)
                        {
                            multipleDiscriminatorValues = true;
                        }
                    }
                }
            }

            if (allowNulls)
            {
                // Allow for null value of discriminator
                ScalarExpression expr = discriminatorMapping.newScalarExpression(stmt, discrimTableExpr);
                ScalarExpression val = new NullLiteral(stmt);
                BooleanExpression nullDiscExpr = expr.eq(val);
                discExpr = discExpr.ior(nullDiscExpr);
                if (!multipleDiscriminatorValues)
                {
                    multipleDiscriminatorValues = true;
                }
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.