Package org.apache.camel.model.language

Examples of org.apache.camel.model.language.XPathExpression


     * @param text the expression to be evaluated
     * @param namespaces the namespace prefix and URIs to use
     * @return the builder to continue processing the DSL
     */
    public T xpath(String text, Map<String, String> namespaces) {
        XPathExpression expression = new XPathExpression(text);
        expression.setNamespaces(namespaces);
        setExpressionType(expression);
        return result;
    }
View Full Code Here


        bean.setPrice(2.5);

        MockEndpoint mock = resolveMandatoryEndpoint("mock:marshal", MockEndpoint.class);
        mock.expectedMessageCount(1);

        XPathExpression xpath = new XPathExpression("count(//*[namespace-uri() = 'http://example.camel.org/apache' and local-name() = 'po']) = 1");
        xpath.setResultType(Boolean.class);
        mock.allMessages().body().matches(xpath);
       
        template.sendBody("direct:marshal", bean);       
        mock.assertIsSatisfied();
       
View Full Code Here

    @Test
    public void testXPathAssertion() throws Exception {
        MockEndpoint result = getMockEndpoint("mock:result");
        result.expectedMessageCount(1);

        XPathExpression xpath = new XPathExpression("/foo = 'bar'");
        xpath.setResultType(Boolean.class);
        result.allMessages().body().matches(xpath);

        template.sendBody("direct:start", "<foo>bar</foo>");

        assertMockEndpointsSatisfied();
View Full Code Here

     *
     * @param text the expression to be evaluated
     * @return the builder to continue processing the DSL
     */
    public T xpath(String text) {
        return expression(new XPathExpression(text));
    }
View Full Code Here

     * @param text the expression to be evaluated
     * @param headerName the name of the header to apply the expression to
     * @return the builder to continue processing the DSL
     */
    public T xpath(String text, String headerName) {
        XPathExpression expression = new XPathExpression(text);
        expression.setHeaderName(headerName);
        return expression(expression);
    }
View Full Code Here

     * @param text the expression to be evaluated
     * @param resultType the return type expected by the expression
     * @return the builder to continue processing the DSL
     */
    public T xpath(String text, Class<?> resultType) {
        XPathExpression expression = new XPathExpression(text);
        expression.setResultType(resultType);
        setExpressionType(expression);
        return result;
    }
View Full Code Here

     * @param resultType the return type expected by the expression
     * @param headerName the name of the header to apply the expression to
     * @return the builder to continue processing the DSL
     */
    public T xpath(String text, Class<?> resultType, String headerName) {
        XPathExpression expression = new XPathExpression(text);
        expression.setHeaderName(headerName);
        setExpressionType(expression);
        return result;
    }
View Full Code Here

     * @param namespaces the namespace prefix and URIs to use
     * @param headerName the name of the header to apply the expression to
     * @return the builder to continue processing the DSL
     */
    public T xpath(String text, Class<?> resultType, Namespaces namespaces, String headerName) {
        XPathExpression expression = new XPathExpression(text);
        expression.setResultType(resultType);
        expression.setNamespaces(namespaces.getNamespaces());
        expression.setHeaderName(headerName);
        setExpressionType(expression);
        return result;
    }
View Full Code Here

     * @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;
    }
View Full Code Here

     * @param text the expression to be evaluated
     * @param namespaces the namespace prefix and URIs to use
     * @return the builder to continue processing the DSL
     */
    public T xpath(String text, Map<String, String> namespaces) {
        XPathExpression expression = new XPathExpression(text);
        expression.setNamespaces(namespaces);
        setExpressionType(expression);
        return result;
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.model.language.XPathExpression

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.