All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.camel.builder.ExpressionClause Maven / Gradle / Ivy

There is a newer version: 4.6.0
Show newest version
/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.camel.builder;

import java.util.Map;
import java.util.function.BiFunction;
import java.util.function.Function;

import java.util.function.Supplier;
import org.apache.camel.Exchange;
import org.apache.camel.Expression;
import org.apache.camel.Message;
import org.apache.camel.builder.xml.Namespaces;
import org.apache.camel.model.ExpressionNode;
import org.apache.camel.model.language.ExpressionDefinition;
import org.apache.camel.support.ExpressionAdapter;

/**
 * Represents an expression clause within the DSL which when the expression is
 * complete the clause continues to another part of the DSL
 * 
 * @version 
 */
public class ExpressionClause extends ExpressionDefinition {
    private ExpressionClauseSupport delegate;

    public ExpressionClause(T result) {
        this.delegate = new ExpressionClauseSupport(result);
    }

    public static  ExpressionClause createAndSetExpression(T result) {
        ExpressionClause clause = new ExpressionClause(result);
        result.setExpression(clause);
        return clause;
    }

    // Helper expressions
    // -------------------------------------------------------------------------

    /**
     * Specify an {@link Expression} instance
     */
    public T expression(Expression expression) {
        return delegate.expression(expression);
    }

    /**
     * Specify the constant expression value.
     *
     * Important: this is a fixed constant value that is only set once during starting up the route,
     * do not use this if you want dynamic values during routing.
     */
    public T constant(Object value) {
        return delegate.constant(value);
    }

    /**
     * An expression of the exchange
     */
    public T exchange() {
        return delegate.exchange();
    }

    /**
     * A functional expression of the exchange
     */
    public T exchange(final Function function) {
        return delegate.expression(new ExpressionAdapter() {
            public Object evaluate(Exchange exchange) {
                return function.apply(exchange);
            }
        });
    }

    /**
     * An expression of an inbound message
     */
    public T message() {
        return inMessage();
    }

    /**
     * A functional expression of an inbound message
     */
    public T message(final Function function) {
        return inMessage(function);
    }

    /**
     * An expression of an inbound message
     */
    public T inMessage() {
        return delegate.inMessage();
    }

    /**
     * A functional expression of an inbound message
     */
    public T inMessage(final Function function) {
        return delegate.expression(new ExpressionAdapter() {
            public Object evaluate(Exchange exchange) {
                return function.apply(exchange.getIn());
            }
        });
    }

    /**
     * An expression of an outbound message
     */
    public T outMessage() {
        return delegate.outMessage();
    }

    /**
     * A functional expression of an outbound message
     */
    public T outMessage(final Function function) {
        return delegate.expression(new ExpressionAdapter() {
            public Object evaluate(Exchange exchange) {
                return function.apply(exchange.getOut());
            }
        });
    }

    /**
     * An expression of an inbound message body
     */
    public T body() {
        return delegate.body();
    }

    /**
     * A functional expression of an inbound message body
     */
    public T body(final Function function) {
        return delegate.expression(new ExpressionAdapter() {
            public Object evaluate(Exchange exchange) {
                return function.apply(exchange.getIn().getBody());
            }
        });
    }

    /**
     * A functional expression of an inbound message body
     */
    public T body(final Supplier supplier) {
        return delegate.expression(new ExpressionAdapter() {
            public Object evaluate(Exchange exchange) {
                return supplier.get();
            }
        });
    }

    /**
     * A functional expression of an inbound message body and headers
     */
    public T body(final BiFunction, Object> function) {
        return delegate.expression(new ExpressionAdapter() {
            public Object evaluate(Exchange exchange) {
                return function.apply(
                    exchange.getIn().getBody(),
                    exchange.getIn().getHeaders());
            }
        });
    }

    /**
     * An expression of an inbound message body converted to the expected type
     */
    public T body(Class expectedType) {
        return delegate.body(expectedType);
    }

    /**
     * A functional expression of an inbound message body converted to the expected type
     */
    public  T body(Class expectedType, final Function function) {
        return delegate.expression(new ExpressionAdapter() {
            public Object evaluate(Exchange exchange) {
                return function.apply(exchange.getIn().getBody(expectedType));
            }
        });
    }

    /**
     * A functional expression of an inbound message body converted to the expected type and headers
     */
    public  T body(Class expectedType, final BiFunction, Object> function) {
        return delegate.expression(new ExpressionAdapter() {
            public Object evaluate(Exchange exchange) {
                return function.apply(
                    exchange.getIn().getBody(expectedType),
                    exchange.getIn().getHeaders());
            }
        });
    }

    /**
     * An expression of an outbound message body
     */
    public T outBody() {
        return delegate.outBody();
    }

    /**
     * A functional expression of an outbound message body
     */
    public T outBody(final Function function) {
        return delegate.expression(new ExpressionAdapter() {
            public Object evaluate(Exchange exchange) {
                return function.apply(exchange.getOut().getBody());
            }
        });
    }

    /**
     * A functional expression of an outbound message body and headers
     */
    public T outBody(final BiFunction, Object> function) {
        return delegate.expression(new ExpressionAdapter() {
            public Object evaluate(Exchange exchange) {
                return function.apply(
                    exchange.getOut().getBody(),
                    exchange.getOut().getHeaders());
            }
        });
    }

    /**
     * An expression of an outbound message body converted to the expected type
     */
    public T outBody(Class expectedType) {
        return delegate.outBody(expectedType);
    }

    /**
     * A functional expression of an outbound message body converted to the expected type
     */
    public  T outBody(Class expectedType, final Function function) {
        return delegate.expression(new ExpressionAdapter() {
            public Object evaluate(Exchange exchange) {
                return function.apply(exchange.getOut().getBody(expectedType));
            }
        });
    }

    /**
     * A functional expression of an outbound message body converted to the expected type and headers
     */
    public  T outBody(Class expectedType, final BiFunction, Object> function) {
        return delegate.expression(new ExpressionAdapter() {
            public Object evaluate(Exchange exchange) {
                return function.apply(
                    exchange.getOut().getBody(expectedType),
                    exchange.getOut().getHeaders());
            }
        });
    }

    /**
     * An expression of an inbound message header of the given name
     */
    public T header(String name) {
        return delegate.header(name);
    }

    /**
     * An expression of the inbound headers
     */
    public T headers() {
        return delegate.headers();
    }

    /**
     * An expression of an outbound message header of the given name
     */
    public T outHeader(String name) {
        return delegate.outHeader(name);
    }

    /**
     * An expression of the outbound headers
     */
    public T outHeaders() {
        return delegate.outHeaders();
    }

    /**
     * An expression of the inbound message attachments
     */
    public T attachments() {
        return delegate.attachments();
    }

    /**
     * An expression of an exchange property of the given name
     *
     * @deprecated use {@link #exchangeProperty(String)} instead
     */
    @Deprecated
    public T property(String name) {
        return exchangeProperty(name);
    }

    /**
     * An expression of an exchange property of the given name
     */
    public T exchangeProperty(String name) {
        return delegate.exchangeProperty(name);
    }

    /**
     * An expression of the exchange properties
     *
     * @deprecated use {@link #exchangeProperties()} instead
     */
    @Deprecated
    public T properties() {
        return exchangeProperties();
    }

    /**
     * An expression of the exchange properties
     */
    public T exchangeProperties() {
        return delegate.exchangeProperties();
    }

    // Languages
    // -------------------------------------------------------------------------

    /**
     * Evaluates an expression using the bean language
     * which basically means the bean is invoked to determine the expression
     * value.
     * 
     * @param bean the name of the bean looked up the registry
     * @return the builder to continue processing the DSL
     */
    public T method(String bean) {
        return delegate.method(bean);
    }
    
    /**
     * Evaluates an expression using the bean language
     * which basically means the bean is invoked to determine the expression
     * value.
     *
     * @param instance the instance of the bean
     * @return the builder to continue processing the DSL
     */
    public T method(Object instance) {
        return delegate.method(instance);
    }

    /**
     * Evaluates an expression using the bean language
     * which basically means the bean is invoked to determine the expression
     * value.
     * 
     * @param beanType the Class of the bean which we want to invoke
     * @return the builder to continue processing the DSL
     */
    public T method(Class beanType) {
        return delegate.method(beanType);
    }

    /**
     * Evaluates an expression using the bean language
     * which basically means the bean is invoked to determine the expression
     * value.
     * 
     * @param bean the name of the bean looked up the registry
     * @param method the name of the method to invoke on the bean
     * @return the builder to continue processing the DSL
     */
    public T method(String bean, String method) {
        return delegate.method(bean, method);
    }
    
    /**
     * Evaluates an expression using the bean language
     * which basically means the bean is invoked to determine the expression
     * value.
     *
     * @param instance the instance of the bean
     * @param method the name of the method to invoke on the bean
     * @return the builder to continue processing the DSL
     */
    public T method(Object instance, String method) {
        return delegate.method(instance, method);
    }

    /**
     * Evaluates an expression using the bean language
     * which basically means the bean is invoked to determine the expression
     * value.
     * 
     * @param beanType the Class of the bean which we want to invoke
     * @param method the name of the method to invoke on the bean
     * @return the builder to continue processing the DSL
     */
    public T method(Class beanType, String method) {
        return delegate.method(beanType, method);
    }

    /**
     * Evaluates the EL
     * Language from JSP and JSF using the JUEL library
     * 
     * @param text the expression to be evaluated
     * @return the builder to continue processing the DSL
     */
    public T el(String text) {
        return delegate.el(text);
    }

    /**
     * Evaluates a Groovy
     * expression
     * 
     * @param text the expression to be evaluated
     * @return the builder to continue processing the DSL
     */
    public T groovy(String text) {
        return delegate.groovy(text);
    }

    /**
     * Evaluates a JavaScript
     * expression
     * 
     * @param text the expression to be evaluated
     * @return the builder to continue processing the DSL
     */
    public T javaScript(String text) {
        return delegate.javaScript(text);
    }

    /**
     * Evaluates a Json Path
     * expression
     *
     * @param text the expression to be evaluated
     * @return the builder to continue processing the DSL
     */
    public T jsonpath(String text) {
        return delegate.jsonpath(text);
    }

    /**
     * Evaluates a Json Path
     * expression
     *
     * @param text the expression to be evaluated
     * @param suppressExceptions whether to suppress exceptions such as PathNotFoundException
     * @return the builder to continue processing the DSL
     */
    public T jsonpath(String text, boolean suppressExceptions) {
        return delegate.jsonpath(text, suppressExceptions);
    }

    /**
     * Evaluates a Json Path
     * expression
     *
     * @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 jsonpath(String text, Class resultType) {
        return delegate.jsonpath(text, resultType);
    }

    /**
     * Evaluates a Json Path
     * expression
     *
     * @param text the expression to be evaluated
     * @param suppressExceptions whether to suppress exceptions such as PathNotFoundException
     * @param resultType the return type expected by the expression
     * @return the builder to continue processing the DSL
     */
    public T jsonpath(String text, boolean suppressExceptions, Class resultType) {
        return delegate.jsonpath(text, suppressExceptions, resultType);
    }

    /**
     * Evaluates a Json Path
     * expression
     *
     * @param text the expression to be evaluated
     * @param suppressExceptions whether to suppress exceptions such as PathNotFoundException
     * @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 jsonpath(String text, boolean suppressExceptions, Class resultType, String headerName) {
        return delegate.jsonpath(text, suppressExceptions, true, resultType, headerName);
    }

    /**
     * Evaluates a Json Path
     * expression with writeAsString enabled.
     *
     * @param text the expression to be evaluated
     * @return the builder to continue processing the DSL
     */
    public T jsonpathWriteAsString(String text) {
        return delegate.jsonpathWriteAsString(text);
    }

    /**
     * Evaluates a Json Path
     * expression with writeAsString enabled.
     *
     * @param text the expression to be evaluated
     * @param suppressExceptions whether to suppress exceptions such as PathNotFoundException
     * @return the builder to continue processing the DSL
     */
    public T jsonpathWriteAsString(String text, boolean suppressExceptions) {
        return delegate.jsonpathWriteAsString(text, suppressExceptions);
    }

    /**
     * Evaluates a Json Path
     * expression with writeAsString enabled.
     *
     * @param text the expression to be evaluated
     * @param suppressExceptions whether to suppress exceptions such as PathNotFoundException
     * @param headerName the name of the header to apply the expression to
     * @return the builder to continue processing the DSL
     */
    public T jsonpathWriteAsString(String text, boolean suppressExceptions, String headerName) {
        return delegate.jsonpathWriteAsString(text, suppressExceptions, true, headerName);
    }

    /**
     * Evaluates a JXPath expression
     * 
     * @param text the expression to be evaluated
     * @return the builder to continue processing the DSL
     */
    public T jxpath(String text) {
        return delegate.jxpath(text);
    }

    /**
     * Evaluates a JXPath expression
     *
     * @param text the expression to be evaluated
     * @param lenient to configure whether lenient is in use or not
     * @return the builder to continue processing the DSL
     */
    public T jxpath(String text, boolean lenient) {
        return delegate.jxpath(text, lenient);
    }

    /**
     * Evaluates an OGNL
     * expression
     * 
     * @param text the expression to be evaluated
     * @return the builder to continue processing the DSL
     */
    public T ognl(String text) {
        return delegate.ognl(text);
    }

    /**
     * Evaluates a MVEL
     * expression
     *
     * @param text the expression to be evaluated
     * @return the builder to continue processing the DSL
     */
    public T mvel(String text) {
        return delegate.mvel(text);
    }

    /**
     * Evaluates a PHP
     * expression
     * 
     * @param text the expression to be evaluated
     * @return the builder to continue processing the DSL
     */
    public T php(String text) {
        return delegate.php(text);
    }

    /**
     * Evaluates a Python
     * expression
     * 
     * @param text the expression to be evaluated
     * @return the builder to continue processing the DSL
     */
    public T python(String text) {
        return delegate.python(text);
    }

    /**
     * Evaluates a Ref
     * expression
     * 
     * @param ref refers to the expression to be evaluated
     * @return the builder to continue processing the DSL
     */
    public T ref(String ref) {
        return delegate.ref(ref);
    }

    /**
     * Evaluates a Ruby
     * expression
     *
     * @param text the expression to be evaluated
     * @return the builder to continue processing the DSL
     */
    public T ruby(String text) {
        return delegate.ruby(text);
    }

    /**
     * Evaluates an SQL
     * expression
     * 
     * @param text the expression to be evaluated
     * @return the builder to continue processing the DSL
     */
    public T sql(String text) {
        return delegate.sql(text);
    }

    /**
     * Evaluates a SpEL
     * expression
     * 
     * @param text the expression to be evaluated
     * @return the builder to continue processing the DSL
     */
    public T spel(String text) {
        return delegate.spel(text);
    }
    
    /**
     * Evaluates a Simple
     * expression
     * 
     * @param text the expression to be evaluated
     * @return the builder to continue processing the DSL
     */
    public T simple(String text) {
        return delegate.simple(text);
    }

    /**
     * Evaluates a Simple
     * expression
     *
     * @param text the expression to be evaluated
     * @param resultType the result type
     * @return the builder to continue processing the DSL
     */
    public T simple(String text, Class resultType) {
        return delegate.simple(text, resultType);
    }

    /**
     * Evaluates a token expression on the message body
     *
     * @param token the token
     * @return the builder to continue processing the DSL
     */
    public T tokenize(String token) {
        return delegate.tokenize(token);
    }

    /**
     * Evaluates a token expression on the message body
     *
     * @param token the token
     * @param regex whether the token is a regular expression or not
     * @return the builder to continue processing the DSL
     */
    public T tokenize(String token, boolean regex) {
        return tokenize(token, regex, false);
    }

    /**
     * Evaluates a token expression on the message body
     *
     * @param token the token
     * @param regex whether the token is a regular expression or not
     * @param skipFirst whether to skip the first element
     * @return the builder to continue processing the DSL
     */
    public T tokenize(String token, boolean regex, boolean skipFirst) {
        return delegate.tokenize(token, null, regex, skipFirst);
    }

    /**
     * Evaluates a token expression on the message body
     *
     * @param token the token
     * @param regex whether the token is a regular expression or not
     * @param group to group by the given number
     * @return the builder to continue processing the DSL
     */
    public T tokenize(String token, boolean regex, int group) {
        return tokenize(token, regex, group, false);
    }

    /**
     * Evaluates a token expression on the message body
     *
     * @param token the token
     * @param regex whether the token is a regular expression or not
     * @param group to group by the given number
     * @return the builder to continue processing the DSL
     */
    public T tokenize(String token, boolean regex, String group) {
        return tokenize(token, regex, group, false);
    }

    /**
     * Evaluates a token expression on the message body
     *
     * @param token the token
     * @param regex whether the token is a regular expression or not
     * @param group to group by the given number
     * @param skipFirst whether to skip the first element
     * @return the builder to continue processing the DSL
     */
    public T tokenize(String token, boolean regex, int group, boolean skipFirst) {
        return delegate.tokenize(token, null, regex, group, skipFirst);
    }

    /**
     * Evaluates a token expression on the message body
     *
     * @param token the token
     * @param regex whether the token is a regular expression or not
     * @param group to group by the given number
     * @param skipFirst whether to skip the first element
     * @return the builder to continue processing the DSL
     */
    public T tokenize(String token, boolean regex, String group, boolean skipFirst) {
        return delegate.tokenize(token, null, regex, group, skipFirst);
    }

    /**
     * Evaluates a token expression on the message body
     *
     * @param token the token
     * @param group to group by the given number
     * @return the builder to continue processing the DSL
     */
    public T tokenize(String token, int group) {
        return delegate.tokenize(token, group);
    }

    /**
     * Evaluates a token expression on the message body
     *
     * @param token the token
     * @param group to group by the given number
     * @param skipFirst whether to skip the first element
     * @return the builder to continue processing the DSL
     */
    public T tokenize(String token, int group, boolean skipFirst) {
        return delegate.tokenize(token, group, skipFirst);
    }

    /**
     * Evaluates a token expression on the given header
     *
     * @param token the token
     * @param headerName name of header to tokenize
     * @return the builder to continue processing the DSL
     */
    public T tokenize(String token, String headerName) {
        return delegate.tokenize(token, headerName);
    }

    /**
     * Evaluates a token expression on the given header
     *
     * @param token the token
     * @param headerName name of header to tokenize
     * @param regex whether the token is a regular expression or not
     * @return the builder to continue processing the DSL
     */
    public T tokenize(String token, String headerName, boolean regex) {
        return delegate.tokenize(token, headerName, regex);
    }

    /**
     * Evaluates a token pair expression on the message body.
     * 

* Tokens is not included. * * @param startToken the start token * @param endToken the end token * @return the builder to continue processing the DSL */ public T tokenizePair(String startToken, String endToken) { return tokenizePair(startToken, endToken, false); } /** * Evaluates a token pair expression on the message body * * @param startToken the start token * @param endToken the end token * @param includeTokens whether to include tokens * @return the builder to continue processing the DSL */ public T tokenizePair(String startToken, String endToken, boolean includeTokens) { return delegate.tokenizePair(startToken, endToken, includeTokens); } /** * Evaluates a XML token expression on the message body with XML content * * @param tagName the the tag name of the child nodes to tokenize * @return the builder to continue processing the DSL */ public T tokenizeXML(String tagName) { return tokenizeXML(tagName, null); } /** * Evaluates a XML token expression on the message body with XML content * * @param tagName the the tag name of the child nodes to tokenize * @param group to group by the given number * @return the builder to continue processing the DSL */ public T tokenizeXML(String tagName, int group) { return tokenizeXML(tagName, null, group); } /** * Evaluates a token pair expression on the message body with XML content * * @param tagName the the tag name of the child nodes to tokenize * @param inheritNamespaceTagName parent or root tag name that contains namespace(s) to inherit * @return the builder to continue processing the DSL */ public T tokenizeXML(String tagName, String inheritNamespaceTagName) { return tokenizeXML(tagName, inheritNamespaceTagName, 0); } /** * Evaluates a token pair expression on the message body with XML content * * @param tagName the the tag name of the child nodes to tokenize * @param inheritNamespaceTagName parent or root tag name that contains namespace(s) to inherit * @param group to group by the given number * @return the builder to continue processing the DSL */ public T tokenizeXML(String tagName, String inheritNamespaceTagName, int group) { return delegate.tokenizeXMLPair(tagName, inheritNamespaceTagName, group); } public T xtokenize(String path, Namespaces namespaces) { return xtokenize(path, 'i', namespaces); } public T xtokenize(String path, char mode, Namespaces namespaces) { return xtokenize(path, mode, namespaces, 0); } public T xtokenize(String path, char mode, Namespaces namespaces, int group) { return delegate.xtokenize(path, mode, namespaces, group); } /** * Evaluates an XPath * expression * * @param text the expression to be evaluated * @return the builder to continue processing the DSL */ public T xpath(String text) { return delegate.xpath(text); } /** * Evaluates an XPath * expression on the supplied header name's contents * * @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) { return delegate.xpath(text, headerName); } /** * Evaluates an XPath * expression with the specified result type * * @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) { return delegate.xpath(text, resultType); } /** * Evaluates an XPath * expression with the specified result type on the supplied * header name's contents * * @param text the expression to be evaluated * @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) { return delegate.xpath(text, resultType, headerName); } /** * Evaluates an XPath * expression 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, Namespaces namespaces) { return delegate.xpath(text, resultType, namespaces); } /** * Evaluates an XPath * expression with the specified result type and set of namespace * prefixes and URIs on the supplied header name's contents * * @param text the expression to be evaluated * @param resultType the return type expected by the expression * @param headerName the name of the header to apply the expression to * @param namespaces the namespace prefix and URIs to use * * @return the builder to continue processing the DSL */ public T xpath(String text, Class resultType, Namespaces namespaces, String headerName) { return delegate.xpath(text, resultType, namespaces, headerName); } /** * Evaluates an XPath * expression 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 namespaces) { return delegate.xpath(text, resultType, namespaces); } /** * Evaluates an XPath * expression with the specified set of namespace prefixes and URIs * * @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, Namespaces namespaces) { return delegate.xpath(text, namespaces); } /** * Evaluates an XPath * expression with the specified set of namespace prefixes and URIs * * @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 namespaces) { return delegate.xpath(text, namespaces); } /** * Evaluates an XQuery expression * * @param text the expression to be evaluated * @return the builder to continue processing the DSL */ public T xquery(String text) { return delegate.xquery(text); } /** * Evaluates an XPath * expression on the supplied header name's contents * * @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 xquery(String text, String headerName) { return delegate.xquery(text, headerName); } /** * Evaluates an XQuery expression * with the specified result type * * @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 xquery(String text, Class resultType) { return delegate.xquery(text, resultType); } /** * Evaluates an XQuery expression * with the specified result type * * @param text the expression to be evaluated * @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 xquery(String text, Class resultType, String headerName) { return delegate.xquery(text, resultType, headerName); } /** * Evaluates an XQuery expression * 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 xquery(String text, Class resultType, Namespaces namespaces) { return delegate.xquery(text, resultType, namespaces); } /** * Evaluates an XQuery expression * with the specified result type * * @param text the expression to be evaluated * @param resultType the return type expected by the expression * @param headerName the name of the header to apply the expression to * @param namespaces the namespace prefix and URIs to use * * @return the builder to continue processing the DSL */ public T xquery(String text, Class resultType, Namespaces namespaces, String headerName) { return delegate.xquery(text, resultType, namespaces, headerName); } /** * Evaluates an XQuery expression * 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 xquery(String text, Class resultType, Map namespaces) { return delegate.xquery(text, resultType, namespaces); } /** * Evaluates an XQuery expression * with the specified set of namespace prefixes and URIs * * @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 xquery(String text, Namespaces namespaces) { return delegate.xquery(text, namespaces); } /** * Evaluates an XQuery expression * with the specified set of namespace prefixes and URIs * * @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 xquery(String text, Map namespaces) { return delegate.xquery(text, namespaces); } /** * Evaluates a given language name with the expression text * * @param language the name of the language * @param expression the expression in the given language * @return the builder to continue processing the DSL */ public T language(String language, String expression) { return delegate.language(language, expression); } // Properties // ------------------------------------------------------------------------- @Override public Expression getExpressionValue() { return delegate.getExpressionValue(); } @Override protected void setExpressionValue(Expression expressionValue) { delegate.setExpressionValue(expressionValue); } @Override public ExpressionDefinition getExpressionType() { return delegate.getExpressionType(); } @Override protected void setExpressionType(ExpressionDefinition expressionType) { delegate.setExpressionType(expressionType); } }