Class ExpressionBuilder

java.lang.Object
org.apache.camel.support.builder.ExpressionBuilder

public class ExpressionBuilder extends Object
A helper class for working with expressions.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.camel.Expression
    append(org.apache.camel.Expression left, org.apache.camel.Expression right)
    Appends the String evaluations of the two expressions together
    static org.apache.camel.Expression
    beanExpression(Object bean, String method)
     
    static org.apache.camel.Expression
    beanExpression(String expression)
     
    static org.apache.camel.Expression
    beanExpression(org.apache.camel.Expression expression, String method)
     
    static org.apache.camel.Expression
    Returns the expression for the exchanges inbound message body
    static <T> org.apache.camel.Expression
    Returns the expression for the exchanges inbound message body converted to the given type
    static <T> org.apache.camel.Expression
    bodyExpression(Class<T> bodyType, BiFunction<T,Map<String,Object>,Object> function)
    Returns a functional expression for the exchanges inbound message body converted to a desired type and headers
    static <T> org.apache.camel.Expression
    bodyExpression(Class<T> bodyType, Function<T,Object> function)
    Returns a functional expression for the exchanges inbound message body converted to a desired type
    static org.apache.camel.Expression
    Returns the expression for the exchanges inbound message body converted to the given type
    static org.apache.camel.Expression
    Returns a functional expression for the exchanges inbound message body and headers
    static org.apache.camel.Expression
    Returns a functional expression for the exchanges inbound message body
    static org.apache.camel.Expression
    bodyExpression(org.apache.camel.Expression name)
    Returns the expression for the exchanges inbound message body converted to the given type
    static org.apache.camel.Expression
    Returns the expression for the message body as a one-line string
    static org.apache.camel.Expression
    Returns the expression for the exchanges inbound message body type
    static org.apache.camel.Expression
    Returns an expression for the CamelContext
    static org.apache.camel.Expression
    Returns an expression for the CamelContext name
    static org.apache.camel.Expression
    Returns an expression for the properties of the camel context
    static org.apache.camel.Expression
    Returns an expression for the property value of the camel context with the given name
    static org.apache.camel.Expression
    camelContextPropertyExpression(org.apache.camel.Expression propertyName)
    Returns an expression for the property value of the camel context with the given name
    static org.apache.camel.Expression
    concatExpression(Collection<org.apache.camel.Expression> expressions)
    Returns an expression which returns the string concatenation value of the various expressions
    static org.apache.camel.Expression
    concatExpression(Collection<org.apache.camel.Expression> expressions, String description)
    Returns an expression which returns the string concatenation value of the various expressions
    static org.apache.camel.Expression
    Returns an expression for the constant value
    static org.apache.camel.Expression
    convertToExpression(org.apache.camel.Expression expression, Class<?> type)
    Returns an expression which converts the given expression to the given type
    static org.apache.camel.Expression
    convertToExpression(org.apache.camel.Expression expression, org.apache.camel.Expression type)
    Returns an expression which converts the given expression to the given type the type expression is evaluated to
    static org.apache.camel.Expression
    Returns an expression for an exception set on the exchange
    static org.apache.camel.Expression
    Returns an expression for an exception set on the exchange
    static org.apache.camel.Expression
    Returns an expression for an exception message set on the exchange
    static org.apache.camel.Expression
    Returns an expression for an exception stacktrace set on the exchange
    static org.apache.camel.Expression
    Returns the expression for the exchange
    static org.apache.camel.Expression
    exchangeExpression(Function<org.apache.camel.Exchange,Object> function)
    Returns a functional expression for the exchange
    static org.apache.camel.Expression
    Returns an Expression for the exchange id
    static org.apache.camel.Expression
    Returns an expression for the exchange pattern
    static org.apache.camel.Expression
    Returns an expression for the exchange properties of exchange
    static org.apache.camel.Expression
    Returns an expression for the property value of exchange with the given name
    static org.apache.camel.Expression
    exchangePropertyExpression(String propertyName, boolean mandatory)
    Returns an expression for the property value of exchange with the given name
    static org.apache.camel.Expression
    exchangePropertyExpression(org.apache.camel.Expression propertyName)
    Returns an expression for the property value of exchange with the given name
    static org.apache.camel.Expression
    exchangePropertyExpression(org.apache.camel.Expression propertyName, boolean mandatory)
    Returns an expression for the property value of exchange with the given name
    static org.apache.camel.Expression
    groupIteratorExpression(org.apache.camel.Expression expression, String token, String group, boolean skipFirst)
     
    static org.apache.camel.Expression
    groupXmlIteratorExpression(org.apache.camel.Expression expression, String group)
     
    static org.apache.camel.Expression
    Returns an expression for the header value with the given name
    static org.apache.camel.Expression
    headerExpression(String headerName, boolean mandatory)
    Returns an expression for the header value with the given name
    static <T> org.apache.camel.Expression
    headerExpression(String headerName, Class<T> type)
    Returns an expression for the header value with the given name converted to the given type
    static org.apache.camel.Expression
    headerExpression(String headerName, String typeName)
    Returns an expression for the header value with the given name converted to the given type
    static org.apache.camel.Expression
    headerExpression(org.apache.camel.Expression headerName)
    Returns an expression for the header value with the given name
    static org.apache.camel.Expression
    headerExpression(org.apache.camel.Expression headerName, boolean mandatory)
    Returns an expression for the header value with the given name
    static org.apache.camel.Expression
    headerExpression(org.apache.camel.Expression headerName, org.apache.camel.Expression typeName)
    Returns an expression for the header value with the given name converted to the given type
    static org.apache.camel.Expression
    Returns an expression for the inbound message headers
    static org.apache.camel.Expression
    Returns the expression for the local hostname
    static org.apache.camel.Expression
    Returns the expression for the IN message
    static org.apache.camel.Expression
    inMessageExpression(Function<org.apache.camel.Message,Object> function)
    Returns a functional expression for the IN message
    static org.apache.camel.Expression
    joinExpression(org.apache.camel.Expression expression, String separator, String prefix)
     
    static org.apache.camel.Expression
    languageExpression(String language, String expression)
    Returns an expression for evaluating the expression/predicate using the given language
    static org.apache.camel.Expression
    languageExpression(String languageName, org.apache.camel.spi.Language language, String expression)
    Returns an expression for evaluating the expression/predicate using the given language
    static <T> org.apache.camel.Expression
    Returns the expression for the exchanges inbound message body converted to the given type.
    static <T> org.apache.camel.Expression
    mandatoryBodyExpression(Class<T> type, boolean nullBodyAllowed)
    Returns the expression for the exchanges inbound message body converted to the given type
    static org.apache.camel.Expression
    Returns the expression for the IN message
    static org.apache.camel.Expression
    Returns the expression for the message converted to the given type
    static org.apache.camel.Expression
    messageExpression(Function<org.apache.camel.Message,Object> function)
    Returns a functional expression for the IN message
    static org.apache.camel.Expression
    messageExpression(org.apache.camel.Expression name)
    Returns the expression for the message converted to the given type
    static org.apache.camel.Expression
    Returns an Expression for the inbound message id
    static org.apache.camel.Expression
    Returns an Expression for the inbound message timestamp
    static org.apache.camel.Expression
    Returns the expression for the original incoming message body
    static org.apache.camel.Expression
    prepend(org.apache.camel.Expression left, org.apache.camel.Expression right)
    Prepends the String evaluations of the two expressions together
    static org.apache.camel.Expression
    Returns the expression for the message body as pretty formatted string
    static org.apache.camel.Expression
    prettyExpression(org.apache.camel.Expression expression)
    Returns the expression as pretty formatted string
    static org.apache.camel.Expression
    propertiesComponentExist(String key, boolean negate)
     
    static org.apache.camel.Expression
     
    static org.apache.camel.Expression
    Returns an expression for lookup a bean in the Registry
    static org.apache.camel.Expression
    refExpression(org.apache.camel.Expression ref)
    Returns an expression for lookup a bean in the Registry
    static org.apache.camel.Expression
    regexReplaceAll(org.apache.camel.Expression expression, String regex, String replacement)
    Transforms the expression into a String then performs the regex replaceAll to transform the String and return the result
    static org.apache.camel.Expression
    regexReplaceAll(org.apache.camel.Expression expression, String regex, org.apache.camel.Expression replacementExpression)
    Transforms the expression into a String then performs the regex replaceAll to transform the String and return the result
    static org.apache.camel.Expression
    regexTokenizeExpression(org.apache.camel.Expression expression, String regexTokenizer)
    Returns a tokenize expression which will tokenize the string with the given regex
    static org.apache.camel.Expression
    Returns an expression for the Registry
    static org.apache.camel.Expression
    Returns an Expression for the route group
    static org.apache.camel.Expression
    Returns an Expression for the route id
    static org.apache.camel.Expression
     
    static org.apache.camel.Expression
    Creates a source Expression for languages that can accept input from other sources than the message body.
    static org.apache.camel.Expression
    singleInputLanguageExpression(String language, String expression, String source)
    Returns an expression for evaluating the expression/predicate using the given language
    static org.apache.camel.Expression
    skipFirstExpression(org.apache.camel.Expression expression)
    Returns an expression that skips the first element
    static org.apache.camel.Expression
    sortExpression(org.apache.camel.Expression expression, Comparator comparator)
    Returns a sort expression which will sort the expression with the given comparator.
    static org.apache.camel.Expression
    Returns the expression for the current step id (if any)
    static org.apache.camel.Expression
    Returns an expression for a system environment value with the given name
    static org.apache.camel.Expression
    systemEnvironmentExpression(String propertyName, String defaultValue)
    Returns an expression for a system environment value with the given name
    static org.apache.camel.Expression
    systemEnvironmentExpression(org.apache.camel.Expression propertyName, org.apache.camel.Expression defaultValue)
    Returns an expression for a system environment value with the given name
    static org.apache.camel.Expression
    Returns an expression for a system property value with the given name
    static org.apache.camel.Expression
    systemPropertyExpression(String propertyName, String defaultValue)
    Returns an expression for a system property value with the given name
    static org.apache.camel.Expression
    systemPropertyExpression(org.apache.camel.Expression exprName, org.apache.camel.Expression defaultValue)
    Returns an expression for a system property value with the given name
    static org.apache.camel.Expression
    Returns the expression for the current thread id
    static org.apache.camel.Expression
    Returns the expression for the current thread name
    static org.apache.camel.Expression
    tokenizeExpression(org.apache.camel.Expression expression, String token)
    Returns a tokenize expression which will tokenize the string with the given token
    static org.apache.camel.Expression
    tokenizeExpression(org.apache.camel.Expression expression, org.apache.camel.Expression token)
    Returns a tokenize expression which will tokenize the string with the given token
    static org.apache.camel.Expression
    tokenizePairExpression(String startToken, String endToken, boolean includeTokens)
    Returns an TokenPairExpressionIterator expression
    static org.apache.camel.Expression
    tokenizePairExpression(org.apache.camel.Expression source, String startToken, String endToken, boolean includeTokens)
    Returns an TokenPairExpressionIterator expression
    static org.apache.camel.Expression
     
    static org.apache.camel.Expression
    tokenizeXMLAwareExpression(String path, char mode, int group)
     
    static org.apache.camel.Expression
    tokenizeXMLAwareExpression(String path, char mode, int group, Namespaces namespaces)
     
    static org.apache.camel.Expression
    tokenizeXMLExpression(String tagName, String inheritNamespaceTagName)
    Returns an TokenXMLExpressionIterator expression
    static org.apache.camel.Expression
    tokenizeXMLExpression(org.apache.camel.Expression source, String tagName, String inheritNamespaceTagName)
     
    static org.apache.camel.Expression
    Returns an expression for the type converter
    static org.apache.camel.Expression
    variableExpression(String variableName)
    Returns an expression for the variable with the given name
    static org.apache.camel.Expression
    variableExpression(String variableName, boolean mandatory)
    Returns an expression for the variable with the given name
    static <T> org.apache.camel.Expression
    variableExpression(String variableName, Class<T> type)
    Returns an expression for the variable with the given name converted to the given type
    static org.apache.camel.Expression
    variableExpression(String variableName, String typeName)
    Returns an expression for the variable with the given name converted to the given type
    static org.apache.camel.Expression
    variableExpression(org.apache.camel.Expression variableName)
    Returns an expression for the variable with the given name
    static org.apache.camel.Expression
    variableExpression(org.apache.camel.Expression variableName, boolean mandatory)
    Returns an expression for the variable with the given name
    static org.apache.camel.Expression
    variableExpression(org.apache.camel.Expression variableName, org.apache.camel.Expression typeName)
    Returns an expression for the variable with the given name converted to the given type
    static org.apache.camel.Expression
    Returns an expression for the Exchange variables

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ExpressionBuilder

      public ExpressionBuilder()
  • Method Details

    • headerExpression

      public static org.apache.camel.Expression headerExpression(String headerName)
      Returns an expression for the header value with the given name

      Will fallback and look in properties if not found in headers.

      Parameters:
      headerName - the name of the header the expression will return
      Returns:
      an expression object which will return the header value
    • headerExpression

      public static org.apache.camel.Expression headerExpression(String headerName, boolean mandatory)
      Returns an expression for the header value with the given name

      Will fallback and look in properties if not found in headers.

      Parameters:
      headerName - the name of the header the expression will return
      mandatory - whether the header is mandatory and if not present an exception is thrown
      Returns:
      an expression object which will return the header value
    • headerExpression

      public static org.apache.camel.Expression headerExpression(org.apache.camel.Expression headerName)
      Returns an expression for the header value with the given name

      Will fallback and look in properties if not found in headers.

      Parameters:
      headerName - the name of the header the expression will return
      Returns:
      an expression object which will return the header value
    • headerExpression

      public static org.apache.camel.Expression headerExpression(org.apache.camel.Expression headerName, boolean mandatory)
      Returns an expression for the header value with the given name

      Will fallback and look in properties if not found in headers.

      Parameters:
      headerName - the name of the header the expression will return
      mandatory - whether the header is mandatory and if not present an exception is thrown
      Returns:
      an expression object which will return the header value
    • headerExpression

      public static <T> org.apache.camel.Expression headerExpression(String headerName, Class<T> type)
      Returns an expression for the header value with the given name converted to the given type

      Will fallback and look in properties if not found in headers.

      Parameters:
      headerName - the name of the header the expression will return
      type - the type to convert to
      Returns:
      an expression object which will return the header value
    • headerExpression

      public static org.apache.camel.Expression headerExpression(String headerName, String typeName)
      Returns an expression for the header value with the given name converted to the given type

      Will fallback and look in properties if not found in headers.

      Parameters:
      headerName - the name of the header the expression will return
      typeName - the type to convert to as a FQN class name
      Returns:
      an expression object which will return the header value
    • headerExpression

      public static org.apache.camel.Expression headerExpression(org.apache.camel.Expression headerName, org.apache.camel.Expression typeName)
      Returns an expression for the header value with the given name converted to the given type

      Will fallback and look in properties if not found in headers.

      Parameters:
      headerName - the name of the header the expression will return
      typeName - the type to convert to as a FQN class name
      Returns:
      an expression object which will return the header value
    • variableExpression

      public static org.apache.camel.Expression variableExpression(String variableName)
      Returns an expression for the variable with the given name
      Parameters:
      variableName - the name of the variable the expression will return
      Returns:
      an expression object which will return the variable value
    • variableExpression

      public static org.apache.camel.Expression variableExpression(String variableName, boolean mandatory)
      Returns an expression for the variable with the given name
      Parameters:
      variableName - the name of the variable the expression will return
      mandatory - whether the variable is mandatory and if not present an exception is thrown
      Returns:
      an expression object which will return the variable value
    • variableExpression

      public static org.apache.camel.Expression variableExpression(org.apache.camel.Expression variableName)
      Returns an expression for the variable with the given name
      Parameters:
      variableName - the name of the variable the expression will return
      Returns:
      an expression object which will return the variable value
    • variableExpression

      public static org.apache.camel.Expression variableExpression(org.apache.camel.Expression variableName, boolean mandatory)
      Returns an expression for the variable with the given name
      Parameters:
      variableName - the name of the variable the expression will return
      mandatory - whether the variable is mandatory and if not present an exception is thrown
      Returns:
      an expression object which will return the variable value
    • variableExpression

      public static <T> org.apache.camel.Expression variableExpression(String variableName, Class<T> type)
      Returns an expression for the variable with the given name converted to the given type
      Parameters:
      variableName - the name of the variable the expression will return
      type - the type to convert to
      Returns:
      an expression object which will return the variable value
    • variableExpression

      public static org.apache.camel.Expression variableExpression(String variableName, String typeName)
      Returns an expression for the variable with the given name converted to the given type
      Parameters:
      variableName - the name of the variable the expression will return
      typeName - the type to convert to as a FQN class name
      Returns:
      an expression object which will return the header value
    • variableExpression

      public static org.apache.camel.Expression variableExpression(org.apache.camel.Expression variableName, org.apache.camel.Expression typeName)
      Returns an expression for the variable with the given name converted to the given type
      Parameters:
      variableName - the name of the variable the expression will return
      typeName - the type to convert to as a FQN class name
      Returns:
      an expression object which will return the header value
    • headersExpression

      public static org.apache.camel.Expression headersExpression()
      Returns an expression for the inbound message headers
      Returns:
      an expression object which will return the inbound headers
    • variablesExpression

      public static org.apache.camel.Expression variablesExpression()
      Returns an expression for the Exchange variables
      Returns:
      an expression object which will return the variables
    • exchangePatternExpression

      public static org.apache.camel.Expression exchangePatternExpression()
      Returns an expression for the exchange pattern
      Returns:
      an expression object which will return the exchange pattern
      See Also:
      • Exchange.getPattern()
    • exchangeExceptionExpression

      public static org.apache.camel.Expression exchangeExceptionExpression()
      Returns an expression for an exception set on the exchange
      Returns:
      an expression object which will return the exception set on the exchange
      See Also:
      • Exchange.getException()
    • exchangeExceptionExpression

      public static org.apache.camel.Expression exchangeExceptionExpression(Class<Exception> type)
      Returns an expression for an exception set on the exchange

      Is used to get the caused exception that typically have been wrapped in some sort of Camel wrapper exception

      Parameters:
      type - the exception type
      Returns:
      an expression object which will return the exception set on the exchange
      See Also:
      • Exchange.getException(Class)
    • typeConverterExpression

      public static org.apache.camel.Expression typeConverterExpression()
      Returns an expression for the type converter
      Returns:
      an expression object which will return the type converter
    • registryExpression

      public static org.apache.camel.Expression registryExpression()
      Returns an expression for the Registry
      Returns:
      an expression object which will return the registry
    • refExpression

      public static org.apache.camel.Expression refExpression(String ref)
      Returns an expression for lookup a bean in the Registry
      Returns:
      an expression object which will return the bean
    • refExpression

      public static org.apache.camel.Expression refExpression(org.apache.camel.Expression ref)
      Returns an expression for lookup a bean in the Registry
      Returns:
      an expression object which will return the bean
    • camelContextExpression

      public static org.apache.camel.Expression camelContextExpression()
      Returns an expression for the CamelContext
      Returns:
      an expression object which will return the camel context
    • camelContextNameExpression

      public static org.apache.camel.Expression camelContextNameExpression()
      Returns an expression for the CamelContext name
      Returns:
      an expression object which will return the camel context name
    • exchangeExceptionMessageExpression

      public static org.apache.camel.Expression exchangeExceptionMessageExpression()
      Returns an expression for an exception message set on the exchange
      Returns:
      an expression object which will return the exception message set on the exchange
    • exchangeExceptionStackTraceExpression

      public static org.apache.camel.Expression exchangeExceptionStackTraceExpression()
      Returns an expression for an exception stacktrace set on the exchange
      Returns:
      an expression object which will return the exception stacktrace set on the exchange
    • exchangePropertyExpression

      public static org.apache.camel.Expression exchangePropertyExpression(String propertyName)
      Returns an expression for the property value of exchange with the given name
      Parameters:
      propertyName - the name of the property the expression will return
      Returns:
      an expression object which will return the property value
    • exchangePropertyExpression

      public static org.apache.camel.Expression exchangePropertyExpression(String propertyName, boolean mandatory)
      Returns an expression for the property value of exchange with the given name
      Parameters:
      propertyName - the name of the property the expression will return
      mandatory - whether the property is mandatory and if not present an exception is thrown
      Returns:
      an expression object which will return the property value
    • exchangePropertyExpression

      public static org.apache.camel.Expression exchangePropertyExpression(org.apache.camel.Expression propertyName)
      Returns an expression for the property value of exchange with the given name
      Parameters:
      propertyName - the name of the property the expression will return
      Returns:
      an expression object which will return the property value
    • exchangePropertyExpression

      public static org.apache.camel.Expression exchangePropertyExpression(org.apache.camel.Expression propertyName, boolean mandatory)
      Returns an expression for the property value of exchange with the given name
      Parameters:
      propertyName - the name of the property the expression will return
      mandatory - whether the property is mandatory and if not present an exception is thrown
      Returns:
      an expression object which will return the property value
    • exchangePropertiesExpression

      public static org.apache.camel.Expression exchangePropertiesExpression()
      Returns an expression for the exchange properties of exchange
      Returns:
      an expression object which will return the exchange properties
    • camelContextPropertiesExpression

      public static org.apache.camel.Expression camelContextPropertiesExpression()
      Returns an expression for the properties of the camel context
      Returns:
      an expression object which will return the properties
    • camelContextPropertyExpression

      public static org.apache.camel.Expression camelContextPropertyExpression(String propertyName)
      Returns an expression for the property value of the camel context with the given name
      Parameters:
      propertyName - the name of the property the expression will return
      Returns:
      an expression object which will return the property value
    • camelContextPropertyExpression

      public static org.apache.camel.Expression camelContextPropertyExpression(org.apache.camel.Expression propertyName)
      Returns an expression for the property value of the camel context with the given name
      Parameters:
      propertyName - the name of the property the expression will return
      Returns:
      an expression object which will return the property value
    • systemPropertyExpression

      public static org.apache.camel.Expression systemPropertyExpression(String propertyName)
      Returns an expression for a system property value with the given name
      Parameters:
      propertyName - the name of the system property the expression will return
      Returns:
      an expression object which will return the system property value
    • systemPropertyExpression

      public static org.apache.camel.Expression systemPropertyExpression(String propertyName, String defaultValue)
      Returns an expression for a system property value with the given name
      Parameters:
      propertyName - the name of the system property the expression will return
      defaultValue - default value to return if no system property exists
      Returns:
      an expression object which will return the system property value
    • systemPropertyExpression

      public static org.apache.camel.Expression systemPropertyExpression(org.apache.camel.Expression exprName, org.apache.camel.Expression defaultValue)
      Returns an expression for a system property value with the given name
      Parameters:
      exprName - the name of the system property the expression will return
      defaultValue - default value to return if no system property exists
      Returns:
      an expression object which will return the system property value
    • systemEnvironmentExpression

      public static org.apache.camel.Expression systemEnvironmentExpression(String propertyName)
      Returns an expression for a system environment value with the given name
      Parameters:
      propertyName - the name of the system environment the expression will return
      Returns:
      an expression object which will return the system property value
    • systemEnvironmentExpression

      public static org.apache.camel.Expression systemEnvironmentExpression(String propertyName, String defaultValue)
      Returns an expression for a system environment value with the given name
      Parameters:
      propertyName - the name of the system environment the expression will return
      defaultValue - default value to return if no system environment exists
      Returns:
      an expression object which will return the system environment value
    • systemEnvironmentExpression

      public static org.apache.camel.Expression systemEnvironmentExpression(org.apache.camel.Expression propertyName, org.apache.camel.Expression defaultValue)
      Returns an expression for a system environment value with the given name
      Parameters:
      propertyName - the name of the system environment the expression will return
      defaultValue - default value to return if no system environment exists
      Returns:
      an expression object which will return the system environment value
    • constantExpression

      public static org.apache.camel.Expression constantExpression(Object value)
      Returns an expression for the constant value
      Parameters:
      value - the value the expression will return
      Returns:
      an expression object which will return the constant value
    • languageExpression

      public static org.apache.camel.Expression languageExpression(String languageName, org.apache.camel.spi.Language language, String expression)
      Returns an expression for evaluating the expression/predicate using the given language
      Parameters:
      languageName - the language name
      language - the language
      expression - the expression or predicate
      Returns:
      an expression object which will evaluate the expression/predicate using the given language
    • languageExpression

      public static org.apache.camel.Expression languageExpression(String language, String expression)
      Returns an expression for evaluating the expression/predicate using the given language
      Parameters:
      expression - the expression or predicate
      Returns:
      an expression object which will evaluate the expression/predicate using the given language
    • singleInputLanguageExpression

      public static org.apache.camel.Expression singleInputLanguageExpression(String language, String expression, String source)
      Returns an expression for evaluating the expression/predicate using the given language
      Parameters:
      expression - the expression or predicate
      source - Source to use, instead of message body. You can prefix with variable:, header:, or property: to specify kind of source. Otherwise, the source is assumed to be a variable. Use empty or null to use default source, which is the message body.
      Returns:
      an expression object which will evaluate the expression/predicate using the given language
    • bodyExpression

      public static org.apache.camel.Expression bodyExpression()
      Returns the expression for the exchanges inbound message body
    • originalBodyExpression

      public static org.apache.camel.Expression originalBodyExpression()
      Returns the expression for the original incoming message body
    • bodyExpression

      public static org.apache.camel.Expression bodyExpression(Function<Object,Object> function)
      Returns a functional expression for the exchanges inbound message body
    • bodyExpression

      public static org.apache.camel.Expression bodyExpression(BiFunction<Object,Map<String,Object>,Object> function)
      Returns a functional expression for the exchanges inbound message body and headers
    • bodyExpression

      public static <T> org.apache.camel.Expression bodyExpression(Class<T> bodyType, Function<T,Object> function)
      Returns a functional expression for the exchanges inbound message body converted to a desired type
    • bodyExpression

      public static <T> org.apache.camel.Expression bodyExpression(Class<T> bodyType, BiFunction<T,Map<String,Object>,Object> function)
      Returns a functional expression for the exchanges inbound message body converted to a desired type and headers
    • bodyExpression

      public static <T> org.apache.camel.Expression bodyExpression(Class<T> type)
      Returns the expression for the exchanges inbound message body converted to the given type
    • bodyExpression

      public static org.apache.camel.Expression bodyExpression(String name)
      Returns the expression for the exchanges inbound message body converted to the given type
    • bodyExpression

      public static org.apache.camel.Expression bodyExpression(org.apache.camel.Expression name)
      Returns the expression for the exchanges inbound message body converted to the given type
    • singleInputExpression

      public static org.apache.camel.Expression singleInputExpression(String source)
      Creates a source Expression for languages that can accept input from other sources than the message body.
      Parameters:
      source - Source to use, instead of message body. You can prefix with variable:, header:, or property: to specify kind of source. Otherwise, the source is assumed to be a variable. Use empty or null to use default source, which is the message body.
      Returns:
      a variable expression if variableName is not empty, a header expression if headerName is not empty, otherwise a property expression if propertyName is not empty or finally a body expression.
    • threadIdExpression

      public static org.apache.camel.Expression threadIdExpression()
      Returns the expression for the current thread id
    • threadNameExpression

      public static org.apache.camel.Expression threadNameExpression()
      Returns the expression for the current thread name
    • hostnameExpression

      public static org.apache.camel.Expression hostnameExpression()
      Returns the expression for the local hostname
    • stepIdExpression

      public static org.apache.camel.Expression stepIdExpression()
      Returns the expression for the current step id (if any)
    • mandatoryBodyExpression

      public static <T> org.apache.camel.Expression mandatoryBodyExpression(Class<T> type)
      Returns the expression for the exchanges inbound message body converted to the given type.

      Does not allow null bodies.

    • mandatoryBodyExpression

      public static <T> org.apache.camel.Expression mandatoryBodyExpression(Class<T> type, boolean nullBodyAllowed)
      Returns the expression for the exchanges inbound message body converted to the given type
      Parameters:
      type - the type
      nullBodyAllowed - whether null bodies is allowed and if so a null is returned, otherwise an exception is thrown
    • bodyTypeExpression

      public static org.apache.camel.Expression bodyTypeExpression()
      Returns the expression for the exchanges inbound message body type
    • exchangeExpression

      public static org.apache.camel.Expression exchangeExpression()
      Returns the expression for the exchange
    • exchangeExpression

      public static org.apache.camel.Expression exchangeExpression(Function<org.apache.camel.Exchange,Object> function)
      Returns a functional expression for the exchange
    • messageExpression

      public static org.apache.camel.Expression messageExpression()
      Returns the expression for the IN message
    • messageExpression

      public static org.apache.camel.Expression messageExpression(String name)
      Returns the expression for the message converted to the given type
    • messageExpression

      public static org.apache.camel.Expression messageExpression(org.apache.camel.Expression name)
      Returns the expression for the message converted to the given type
    • messageExpression

      public static org.apache.camel.Expression messageExpression(Function<org.apache.camel.Message,Object> function)
      Returns a functional expression for the IN message
    • inMessageExpression

      public static org.apache.camel.Expression inMessageExpression()
      Returns the expression for the IN message
    • inMessageExpression

      public static org.apache.camel.Expression inMessageExpression(Function<org.apache.camel.Message,Object> function)
      Returns a functional expression for the IN message
    • convertToExpression

      public static org.apache.camel.Expression convertToExpression(org.apache.camel.Expression expression, Class<?> type)
      Returns an expression which converts the given expression to the given type
    • convertToExpression

      public static org.apache.camel.Expression convertToExpression(org.apache.camel.Expression expression, org.apache.camel.Expression type)
      Returns an expression which converts the given expression to the given type the type expression is evaluated to
    • tokenizeExpression

      public static org.apache.camel.Expression tokenizeExpression(org.apache.camel.Expression expression, String token)
      Returns a tokenize expression which will tokenize the string with the given token
    • tokenizeExpression

      public static org.apache.camel.Expression tokenizeExpression(org.apache.camel.Expression expression, org.apache.camel.Expression token)
      Returns a tokenize expression which will tokenize the string with the given token
    • skipFirstExpression

      public static org.apache.camel.Expression skipFirstExpression(org.apache.camel.Expression expression)
      Returns an expression that skips the first element
    • regexTokenizeExpression

      public static org.apache.camel.Expression regexTokenizeExpression(org.apache.camel.Expression expression, String regexTokenizer)
      Returns a tokenize expression which will tokenize the string with the given regex
    • groupXmlIteratorExpression

      public static org.apache.camel.Expression groupXmlIteratorExpression(org.apache.camel.Expression expression, String group)
    • groupIteratorExpression

      public static org.apache.camel.Expression groupIteratorExpression(org.apache.camel.Expression expression, String token, String group, boolean skipFirst)
    • joinExpression

      public static org.apache.camel.Expression joinExpression(org.apache.camel.Expression expression, String separator, String prefix)
    • sortExpression

      public static org.apache.camel.Expression sortExpression(org.apache.camel.Expression expression, Comparator comparator)
      Returns a sort expression which will sort the expression with the given comparator.

      The expression is evaluated as a List object to allow sorting.

    • regexReplaceAll

      public static org.apache.camel.Expression regexReplaceAll(org.apache.camel.Expression expression, String regex, String replacement)
      Transforms the expression into a String then performs the regex replaceAll to transform the String and return the result
    • regexReplaceAll

      public static org.apache.camel.Expression regexReplaceAll(org.apache.camel.Expression expression, String regex, org.apache.camel.Expression replacementExpression)
      Transforms the expression into a String then performs the regex replaceAll to transform the String and return the result
    • append

      public static org.apache.camel.Expression append(org.apache.camel.Expression left, org.apache.camel.Expression right)
      Appends the String evaluations of the two expressions together
    • prepend

      public static org.apache.camel.Expression prepend(org.apache.camel.Expression left, org.apache.camel.Expression right)
      Prepends the String evaluations of the two expressions together
    • concatExpression

      public static org.apache.camel.Expression concatExpression(Collection<org.apache.camel.Expression> expressions)
      Returns an expression which returns the string concatenation value of the various expressions
      Parameters:
      expressions - the expression to be concatenated dynamically
      Returns:
      an expression which when evaluated will return the concatenated values
    • concatExpression

      public static org.apache.camel.Expression concatExpression(Collection<org.apache.camel.Expression> expressions, String description)
      Returns an expression which returns the string concatenation value of the various expressions
      Parameters:
      expressions - the expression to be concatenated dynamically
      description - the text description of the expression
      Returns:
      an expression which when evaluated will return the concatenated values
    • messageIdExpression

      public static org.apache.camel.Expression messageIdExpression()
      Returns an Expression for the inbound message id
    • messageTimestampExpression

      public static org.apache.camel.Expression messageTimestampExpression()
      Returns an Expression for the inbound message timestamp
    • exchangeIdExpression

      public static org.apache.camel.Expression exchangeIdExpression()
      Returns an Expression for the exchange id
    • routeIdExpression

      public static org.apache.camel.Expression routeIdExpression()
      Returns an Expression for the route id
    • routeGroupExpression

      public static org.apache.camel.Expression routeGroupExpression()
      Returns an Expression for the route group
    • simpleExpression

      public static org.apache.camel.Expression simpleExpression(String expression)
    • beanExpression

      public static org.apache.camel.Expression beanExpression(String expression)
    • beanExpression

      public static org.apache.camel.Expression beanExpression(Object bean, String method)
    • beanExpression

      public static org.apache.camel.Expression beanExpression(org.apache.camel.Expression expression, String method)
    • propertiesComponentExpression

      public static org.apache.camel.Expression propertiesComponentExpression(String key, String defaultValue)
    • propertiesComponentExist

      public static org.apache.camel.Expression propertiesComponentExist(String key, boolean negate)
    • tokenizePairExpression

      public static org.apache.camel.Expression tokenizePairExpression(String startToken, String endToken, boolean includeTokens)
      Returns an TokenPairExpressionIterator expression
    • tokenizePairExpression

      public static org.apache.camel.Expression tokenizePairExpression(org.apache.camel.Expression source, String startToken, String endToken, boolean includeTokens)
      Returns an TokenPairExpressionIterator expression
    • tokenizeXMLExpression

      public static org.apache.camel.Expression tokenizeXMLExpression(String tagName, String inheritNamespaceTagName)
      Returns an TokenXMLExpressionIterator expression
    • tokenizeXMLExpression

      public static org.apache.camel.Expression tokenizeXMLExpression(org.apache.camel.Expression source, String tagName, String inheritNamespaceTagName)
    • tokenizeXMLAwareExpression

      public static org.apache.camel.Expression tokenizeXMLAwareExpression(String path, char mode)
    • tokenizeXMLAwareExpression

      public static org.apache.camel.Expression tokenizeXMLAwareExpression(String path, char mode, int group)
    • tokenizeXMLAwareExpression

      public static org.apache.camel.Expression tokenizeXMLAwareExpression(String path, char mode, int group, Namespaces namespaces)
    • bodyOneLine

      public static org.apache.camel.Expression bodyOneLine()
      Returns the expression for the message body as a one-line string
    • prettyExpression

      public static org.apache.camel.Expression prettyExpression(org.apache.camel.Expression expression)
      Returns the expression as pretty formatted string
    • prettyBodyExpression

      public static org.apache.camel.Expression prettyBodyExpression()
      Returns the expression for the message body as pretty formatted string