Search in sources :

Example 11 with XPathExpression

use of org.apache.camel.model.language.XPathExpression in project camel by apache.

the class ExpressionClauseSupport method xpath.

/**
     * Evaluates an <a href="http://camel.apache.org/xpath.html">XPath
     * expression</a> with the specified result type and set of namespace
     * prefixes and URIs
     *
     * @param text the expression to be evaluated
     * @param resultType the return type expected by the expression
     * @param namespaces the namespace prefix and URIs to use
     * @return the builder to continue processing the DSL
     */
public T xpath(String text, Class<?> resultType, Map<String, String> namespaces) {
    XPathExpression expression = new XPathExpression(text);
    expression.setResultType(resultType);
    expression.setNamespaces(namespaces);
    setExpressionType(expression);
    return result;
}
Also used : XPathExpression(org.apache.camel.model.language.XPathExpression) JXPathExpression(org.apache.camel.model.language.JXPathExpression)

Aggregations

XPathExpression (org.apache.camel.model.language.XPathExpression)11 JXPathExpression (org.apache.camel.model.language.JXPathExpression)5 SimpleBuilder (org.apache.camel.builder.SimpleBuilder)2 ValueBuilder (org.apache.camel.builder.ValueBuilder)2 XPathBuilder (org.apache.camel.builder.xml.XPathBuilder)2 ExpressionDefinition (org.apache.camel.model.language.ExpressionDefinition)2 SimpleExpression (org.apache.camel.model.language.SimpleExpression)2 Expression (org.apache.camel.Expression)1 Predicate (org.apache.camel.Predicate)1 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)1 Test (org.junit.Test)1