Examples of createPredicate()


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

                String exp = getExpression();
                // trim if configured to trim
                if (exp != null && isTrim()) {
                    exp = exp.trim();
                }
                predicate = language.createPredicate(exp);
                configurePredicate(camelContext, predicate);
            }
        }
        return predicate;
    }
View Full Code Here

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

            throw new IllegalArgumentException("Cannot find the language: " + languageName + " on the classpath");
        }
        String expression = getExpressionFromAnnotation(annotation);

        if (expressionReturnType == Boolean.class || expressionReturnType == boolean.class) {
            Predicate predicate = language.createPredicate(expression);
            return PredicateToExpressionAdapter.toExpression(predicate);
        } else {
            return language.createExpression(expression);
        }
    }
View Full Code Here

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

                predicate = PredicateBuilder.toPredicate(expressionValue);
            } else if (getExpression() != null) {
                ObjectHelper.notNull("language", getLanguage());
                CamelContext camelContext = routeContext.getCamelContext();
                Language language = camelContext.resolveLanguage(getLanguage());
                predicate = language.createPredicate(getExpression());
                configurePredicate(routeContext, predicate);
            }
        }
        return predicate;
    }
View Full Code Here

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

     * to the expected value on the message exchange
     */
    protected void assertPredicate(String languageName, String expressionText, Exchange exchange, boolean expected) {
        Language language = assertResolveLanguage(languageName);

        Predicate predicate = language.createPredicate(expressionText);
        assertNotNull("No Predicate could be created for text: " + expressionText + " language: " + language, predicate);

        assertPredicate(predicate, exchange, expected);
    }

View Full Code Here

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

     * to the expected value on the message exchange
     */
    protected void assertPredicate(String languageName, String expressionText, Exchange exchange, boolean expected) {
        Language language = assertResolveLanguage(languageName);

        Predicate predicate = language.createPredicate(expressionText);
        assertNotNull("No Predicate could be created for text: " + expressionText + " language: " + language, predicate);

        assertPredicate(predicate, exchange, expected);
    }

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()

     * to the expected value on the message exchange
     */
    protected void assertPredicate(String languageName, String expressionText, Exchange exchange, boolean expected) {
        Language language = assertResolveLanguage(languageName);

        Predicate predicate = language.createPredicate(expressionText);
        assertNotNull("No Predicate could be created for text: " + expressionText + " language: " + language, predicate);

        assertPredicate(predicate, exchange, expected);
    }

View Full Code Here

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

     * to the expected value on the message exchange
     */
    protected void assertPredicate(String languageName, String expressionText, Exchange exchange, boolean expected) {
        Language language = assertResolveLanguage(languageName);

        Predicate predicate = language.createPredicate(expressionText);
        assertNotNull("No Predicate could be created for text: " + expressionText + " language: " + language, predicate);

        assertPredicate(predicate, exchange, expected);
    }

View Full Code Here

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

     * to the expected value on the message exchange
     */
    protected void assertPredicate(String languageName, String expressionText, Exchange exchange, boolean expected) {
        Language language = assertResolveLanguage(languageName);

        Predicate predicate = language.createPredicate(expressionText);
        assertNotNull("No Predicate could be created for text: " + expressionText + " language: " + language, predicate);

        assertPredicate(predicate, exchange, expected);
    }

View Full Code Here

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

    }

    @Test
    public void testPredicates() throws Exception {
        Language language = assertResolveLanguage(getLanguageName());
        assertPredicate(language.createPredicate("SELECT * FROM org.apache.camel.builder.sql.Person where city = 'London'"), exchange, true);
        assertPredicate(language.createPredicate("SELECT * FROM org.apache.camel.builder.sql.Person where city = 'Manchester'"), exchange, false);
    }

    @Test
    public void testPredicateWithHeaderVariable() throws Exception {
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.