Examples of createPredicate()


Examples of org.apache.camel.language.constant.ConstantLanguage.createPredicate()

    // Fluent API
    //-------------------------------------------------------------------------
    public ExceptionType handled(boolean handled) {
        ConstantLanguage constant = new ConstantLanguage();
        return handled(constant.createPredicate(Boolean.toString(handled)));
    }
   
    public ExceptionType handled(Predicate handled) {
        setHandledPolicy(handled);
        return this;
View Full Code Here

Examples of org.apache.camel.language.constant.ConstantLanguage.createPredicate()

    // Fluent API
    //-------------------------------------------------------------------------
    public ExceptionType handled(boolean handled) {
        ConstantLanguage constant = new ConstantLanguage();
        return handled(constant.createPredicate(Boolean.toString(handled)));
    }
   
    public ExceptionType handled(Predicate handled) {
        setHandledPolicy(handled);
        return this;
View Full Code Here

Examples of org.apache.camel.language.simple.SimpleLanguage.createPredicate()

            simple.setResultType(resultType);
        }
        // resolve property placeholders
        try {
            String resolve = exchange.getContext().resolvePropertyPlaceholders(text);
            return simple.createPredicate(resolve);
        } catch (Exception e) {
            throw ObjectHelper.wrapCamelExecutionException(exchange, e);
        }
    }
View Full Code Here

Examples of org.apache.camel.model.language.ExpressionDefinition.createPredicate()

    }
   
    public Predicate createPredicate(RouteContext routeContext) {
        ExpressionDefinition expressionType = getExpressionType();
        if (expressionType != null && getPredicate() == null) {
            setPredicate(expressionType.createPredicate(routeContext));
        }
        return getPredicate();
    }
}
View Full Code Here

Examples of org.apache.camel.model.language.ExpressionType.createPredicate()

    }
   
    public Predicate createPredicate(RouteContext routeContext) {
        ExpressionType expressionType = getExpressionType();
        if (expressionType != null && getPredicate() == null) {
            setPredicate(expressionType.createPredicate(routeContext));
        }
        return getPredicate();
    }
}
View Full Code Here

Examples of org.apache.camel.model.language.ExpressionType.createPredicate()

    }

    public Predicate createPredicate(RouteContext routeContext) {
        ExpressionType predicateType = getCompletePredicate();
        if (predicateType != null && predicate == null) {
            predicate = predicateType.createPredicate(routeContext);
        }
        return predicate;
    }
}
View Full Code Here

Examples of org.apache.camel.spi.Language.createPredicate()

            @Override
            public boolean matches(Exchange exchange) {
                Language lan = exchange.getContext().resolveLanguage(language);
                if (lan != null) {
                    return lan.createPredicate(expression).matches(exchange);
                } else {
                    throw new NoSuchLanguageException(language);
                }
            }
View Full Code Here

Examples of org.apache.camel.spi.Language.createPredicate()

        Predicate answer = getRetryWhile();

        if (getRetryWhileRef() != null) {
            // its a bean expression
            Language bean = context.resolveLanguage("bean");
            answer = bean.createPredicate(getRetryWhileRef());
        }

        return answer;
    }
View Full Code Here

Examples of org.apache.camel.spi.Language.createPredicate()

    public Predicate<Exchange> createPredicate(RouteContext route) {
        if (predicate == null) {
            CamelContext camelContext = route.getCamelContext();
            Language language = camelContext.resolveLanguage(getLanguage());
            predicate = language.createPredicate(getExpression());
        }
        return predicate;
    }

    public Expression createExpression(RouteContext routeContext) {
View Full Code Here

Examples of org.apache.camel.spi.Language.createPredicate()

    public void testPredicate() throws Exception {
        Exchange exchange = new DefaultExchange(context);
        exchange.getIn().setBody(new File("src/test/resources/books.json"));

        Language lan = context.resolveLanguage("jsonpath");
        Predicate pre = lan.createPredicate("$.store.book[?(@.price < 10)]");
        boolean cheap = pre.matches(exchange);
        assertTrue("Should have cheap books", cheap);

        pre = lan.createPredicate("$.store.book[?(@.price > 30)]");
        boolean expensive = pre.matches(exchange);
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.