Package org.apache.camel.support.builder
Class ExpressionBuilder
java.lang.Object
org.apache.camel.support.builder.ExpressionBuilder
A helper class for working with expressions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.camel.Expressionappend(org.apache.camel.Expression left, org.apache.camel.Expression right) Appends the String evaluations of the two expressions togetherstatic org.apache.camel.ExpressionbeanExpression(Class<?> bean, String method) static org.apache.camel.ExpressionbeanExpression(Object bean, String method) static org.apache.camel.ExpressionbeanExpression(String expression) static org.apache.camel.ExpressionbeanExpression(org.apache.camel.Expression expression, String method) static org.apache.camel.ExpressionReturns the expression for the exchanges inbound message bodystatic <T> org.apache.camel.ExpressionbodyExpression(Class<T> type) Returns the expression for the exchanges inbound message body converted to the given typestatic <T> org.apache.camel.ExpressionbodyExpression(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 headersstatic <T> org.apache.camel.ExpressionbodyExpression(Class<T> bodyType, Function<T, Object> function) Returns a functional expression for the exchanges inbound message body converted to a desired typestatic org.apache.camel.ExpressionbodyExpression(String name) Returns the expression for the exchanges inbound message body converted to the given typestatic org.apache.camel.ExpressionbodyExpression(BiFunction<Object, Map<String, Object>, Object> function) Returns a functional expression for the exchanges inbound message body and headersstatic org.apache.camel.ExpressionbodyExpression(Function<Object, Object> function) Returns a functional expression for the exchanges inbound message bodystatic org.apache.camel.ExpressionbodyExpression(org.apache.camel.Expression name) Returns the expression for the exchanges inbound message body converted to the given typestatic org.apache.camel.ExpressionReturns the expression for the message body as a one-line stringstatic org.apache.camel.ExpressionReturns the expression for the exchanges inbound message body typestatic org.apache.camel.ExpressionReturns an expression for theCamelContextstatic org.apache.camel.ExpressionReturns an expression for theCamelContextnamestatic org.apache.camel.ExpressionReturns an expression for the properties of the camel contextstatic org.apache.camel.ExpressioncamelContextPropertyExpression(String propertyName) Returns an expression for the property value of the camel context with the given namestatic org.apache.camel.ExpressioncamelContextPropertyExpression(org.apache.camel.Expression propertyName) Returns an expression for the property value of the camel context with the given namestatic org.apache.camel.ExpressionconcatExpression(Collection<org.apache.camel.Expression> expressions) Returns an expression which returns the string concatenation value of the various expressionsstatic org.apache.camel.ExpressionconcatExpression(Collection<org.apache.camel.Expression> expressions, String description) Returns an expression which returns the string concatenation value of the various expressionsstatic org.apache.camel.ExpressionconstantExpression(Object value) Returns an expression for the constant valuestatic org.apache.camel.ExpressionconvertToExpression(org.apache.camel.Expression expression, Class<?> type) Returns an expression which converts the given expression to the given typestatic org.apache.camel.ExpressionconvertToExpression(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 tostatic org.apache.camel.ExpressioncustomExpression(org.apache.camel.Expression expression, Function<Object, Object> function) static org.apache.camel.ExpressionReturns an expression for an exception set on the exchangestatic org.apache.camel.ExpressionReturns an expression for an exception set on the exchangestatic org.apache.camel.ExpressionReturns an expression for an exception message set on the exchangestatic org.apache.camel.ExpressionReturns an expression for an exception stacktrace set on the exchangestatic org.apache.camel.ExpressionReturns the expression for the exchangestatic org.apache.camel.ExpressionexchangeExpression(Function<org.apache.camel.Exchange, Object> function) Returns a functional expression for the exchangestatic org.apache.camel.ExpressionReturns an Expression for the exchange idstatic org.apache.camel.ExpressionReturns an expression for the exchange patternstatic org.apache.camel.ExpressionReturns an expression for the exchange properties of exchangestatic org.apache.camel.ExpressionexchangePropertyExpression(String propertyName) Returns an expression for the property value of exchange with the given namestatic org.apache.camel.ExpressionexchangePropertyExpression(String propertyName, boolean mandatory) Returns an expression for the property value of exchange with the given namestatic org.apache.camel.ExpressionexchangePropertyExpression(org.apache.camel.Expression propertyName) Returns an expression for the property value of exchange with the given namestatic org.apache.camel.ExpressionexchangePropertyExpression(org.apache.camel.Expression propertyName, boolean mandatory) Returns an expression for the property value of exchange with the given namestatic org.apache.camel.ExpressionReturns an Expression for the original route id where this exchange was created.static org.apache.camel.ExpressiongroupIteratorExpression(org.apache.camel.Expression expression, String token, String group, boolean skipFirst) static org.apache.camel.ExpressiongroupXmlIteratorExpression(org.apache.camel.Expression expression, String group) static org.apache.camel.ExpressionheaderExpression(String headerName) Returns an expression for the header value with the given namestatic org.apache.camel.ExpressionheaderExpression(String headerName, boolean mandatory) Returns an expression for the header value with the given namestatic <T> org.apache.camel.ExpressionheaderExpression(String headerName, Class<T> type) Returns an expression for the header value with the given name converted to the given typestatic org.apache.camel.ExpressionheaderExpression(String headerName, String typeName) Returns an expression for the header value with the given name converted to the given typestatic org.apache.camel.ExpressionheaderExpression(org.apache.camel.Expression headerName) Returns an expression for the header value with the given namestatic org.apache.camel.ExpressionheaderExpression(org.apache.camel.Expression headerName, boolean mandatory) Returns an expression for the header value with the given namestatic org.apache.camel.ExpressionheaderExpression(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 typestatic org.apache.camel.ExpressionReturns an expression for the inbound message headersstatic org.apache.camel.ExpressionReturns an expression for the size of the message headersstatic org.apache.camel.ExpressionReturns the expression for the local hostnamestatic org.apache.camel.ExpressionReturns the expression for the IN messagestatic org.apache.camel.ExpressioninMessageExpression(Function<org.apache.camel.Message, Object> function) Returns a functional expression for the IN messagestatic org.apache.camel.ExpressionjoinExpression(org.apache.camel.Expression expression, String separator, String prefix) static org.apache.camel.ExpressionlanguageExpression(String language, String expression) Returns an expression for evaluating the expression/predicate using the given languagestatic org.apache.camel.ExpressionlanguageExpression(String languageName, org.apache.camel.spi.Language language, String expression) Returns an expression for evaluating the expression/predicate using the given languagestatic org.apache.camel.ExpressionlanguageExpression(org.apache.camel.Expression expression, String language, String value, Class<?> resultType) Returns an expression for evaluating the expression/predicate using the given languagestatic org.apache.camel.ExpressionDumps the exchange for logging purpose (usesExchangeFormatterto format the output).static <T> org.apache.camel.ExpressionmandatoryBodyExpression(Class<T> type) Returns the expression for the exchanges inbound message body converted to the given type.static <T> org.apache.camel.ExpressionmandatoryBodyExpression(Class<T> type, boolean nullBodyAllowed) Returns the expression for the exchanges inbound message body converted to the given typestatic org.apache.camel.ExpressionReturns the expression for the IN messagestatic org.apache.camel.ExpressionmessageExpression(String name) Returns the expression for the message converted to the given typestatic org.apache.camel.ExpressionmessageExpression(Function<org.apache.camel.Message, Object> function) Returns a functional expression for the IN messagestatic org.apache.camel.ExpressionmessageExpression(org.apache.camel.Expression name) Returns the expression for the message converted to the given typestatic org.apache.camel.ExpressionReturns an Expression for the inbound message idstatic org.apache.camel.ExpressionReturns an Expression for the inbound message timestampstatic org.apache.camel.ExpressionReturns the expression for the original incoming message bodystatic org.apache.camel.Expressionprepend(org.apache.camel.Expression left, org.apache.camel.Expression right) Prepends the String evaluations of the two expressions togetherstatic org.apache.camel.ExpressionReturns the expression for the message body as pretty formatted stringstatic org.apache.camel.ExpressionprettyExpression(org.apache.camel.Expression expression) Returns the expression as pretty formatted stringstatic org.apache.camel.ExpressionpropertiesComponentExist(String key, boolean negate) static org.apache.camel.ExpressionpropertiesComponentExpression(String key, String defaultValue) static org.apache.camel.ExpressionrefExpression(String ref) Returns an expression for lookup a bean in theRegistrystatic org.apache.camel.ExpressionrefExpression(org.apache.camel.Expression ref) Returns an expression for lookup a bean in theRegistrystatic org.apache.camel.ExpressionregexReplaceAll(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 resultstatic org.apache.camel.ExpressionregexReplaceAll(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 resultstatic org.apache.camel.ExpressionregexTokenizeExpression(org.apache.camel.Expression expression, String regexTokenizer) Returns a tokenize expression which will tokenize the string with the given regexstatic org.apache.camel.ExpressionReturns an expression for theRegistrystatic org.apache.camel.ExpressionreplaceAll(org.apache.camel.Expression expression, String from, String to) Replaces string values in the given expression.static org.apache.camel.ExpressionReturns an Expression for the route groupstatic org.apache.camel.ExpressionReturns an Expression for the route idstatic org.apache.camel.ExpressionsimpleExpression(String expression) static org.apache.camel.ExpressionsingleInputExpression(String source) Creates a sourceExpressionfor languages that can accept input from other sources than the message body.static org.apache.camel.ExpressionsingleInputLanguageExpression(String language, String expression, String source) Returns an expression for evaluating the expression/predicate using the given languagestatic org.apache.camel.ExpressionskipFirstExpression(org.apache.camel.Expression expression) Returns an expression that skips the first elementstatic org.apache.camel.ExpressionsortExpression(org.apache.camel.Expression expression, Comparator comparator) Returns a sort expression which will sort the expression with the given comparator.static org.apache.camel.ExpressionReturns the expression for the current step id (if any)static org.apache.camel.Expressionsubstring(org.apache.camel.Expression expression, int head, int tail) Substring string values in the given expression.static org.apache.camel.ExpressionsystemEnvironmentExpression(String propertyName) Returns an expression for a system environment value with the given namestatic org.apache.camel.ExpressionsystemEnvironmentExpression(String propertyName, String defaultValue) Returns an expression for a system environment value with the given namestatic org.apache.camel.ExpressionsystemEnvironmentExpression(org.apache.camel.Expression propertyName, org.apache.camel.Expression defaultValue) Returns an expression for a system environment value with the given namestatic org.apache.camel.ExpressionsystemPropertyExpression(String propertyName) Returns an expression for a system property value with the given namestatic org.apache.camel.ExpressionsystemPropertyExpression(String propertyName, String defaultValue) Returns an expression for a system property value with the given namestatic org.apache.camel.ExpressionsystemPropertyExpression(org.apache.camel.Expression exprName, org.apache.camel.Expression defaultValue) Returns an expression for a system property value with the given namestatic org.apache.camel.ExpressionReturns the expression for the current thread idstatic org.apache.camel.ExpressionReturns the expression for the current thread namestatic org.apache.camel.ExpressiontokenizeExpression(org.apache.camel.Expression expression, String token) Returns a tokenize expression which will tokenize the string with the given tokenstatic org.apache.camel.ExpressiontokenizeExpression(org.apache.camel.Expression expression, org.apache.camel.Expression token) Returns a tokenize expression which will tokenize the string with the given tokenstatic org.apache.camel.ExpressiontokenizePairExpression(String startToken, String endToken, boolean includeTokens) Returns anTokenPairExpressionIteratorexpressionstatic org.apache.camel.ExpressiontokenizePairExpression(org.apache.camel.Expression source, String startToken, String endToken, boolean includeTokens) Returns anTokenPairExpressionIteratorexpressionstatic org.apache.camel.ExpressiontokenizeXMLAwareExpression(String path, char mode) static org.apache.camel.ExpressiontokenizeXMLAwareExpression(String path, char mode, int group) static org.apache.camel.ExpressiontokenizeXMLAwareExpression(String path, char mode, int group, Namespaces namespaces) static org.apache.camel.ExpressiontokenizeXMLExpression(String tagName, String inheritNamespaceTagName) Returns anTokenXMLExpressionIteratorexpressionstatic org.apache.camel.ExpressiontokenizeXMLExpression(org.apache.camel.Expression source, String tagName, String inheritNamespaceTagName) static org.apache.camel.ExpressionReturns an expression for the type converterstatic org.apache.camel.ExpressionvariableExpression(String variableName) Returns an expression for the variable with the given namestatic org.apache.camel.ExpressionvariableExpression(String variableName, boolean mandatory) Returns an expression for the variable with the given namestatic <T> org.apache.camel.ExpressionvariableExpression(String variableName, Class<T> type) Returns an expression for the variable with the given name converted to the given typestatic org.apache.camel.ExpressionvariableExpression(String variableName, String typeName) Returns an expression for the variable with the given name converted to the given typestatic org.apache.camel.ExpressionvariableExpression(org.apache.camel.Expression variableName) Returns an expression for the variable with the given namestatic org.apache.camel.ExpressionvariableExpression(org.apache.camel.Expression variableName, boolean mandatory) Returns an expression for the variable with the given namestatic org.apache.camel.ExpressionvariableExpression(org.apache.camel.Expression variableName, org.apache.camel.Expression typeName) Returns an expression for the variable with the given name converted to the given typestatic org.apache.camel.ExpressionReturns an expression for theExchangevariablesstatic org.apache.camel.ExpressionReturns an expression for the number ofExchangevariables
-
Constructor Details
-
ExpressionBuilder
public ExpressionBuilder()
-
-
Method Details
-
headerExpression
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
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 returnmandatory- 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 returnmandatory- whether the header is mandatory and if not present an exception is thrown- Returns:
- an expression object which will return the header value
-
headerExpression
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 returntype- the type to convert to- Returns:
- an expression object which will return the header value
-
headerExpression
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 returntypeName- 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 returntypeName- the type to convert to as a FQN class name- Returns:
- an expression object which will return the header value
-
variableExpression
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 returnmandatory- 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 returnmandatory- 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 returntype- the type to convert to- Returns:
- an expression object which will return the variable value
-
variableExpression
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 returntypeName- 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 returntypeName- 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
-
headersSizeExpression
public static org.apache.camel.Expression headersSizeExpression()Returns an expression for the size of the message headers -
variablesExpression
public static org.apache.camel.Expression variablesExpression()Returns an expression for theExchangevariables- Returns:
- an expression object which will return the variables
-
variablesSizeExpression
public static org.apache.camel.Expression variablesSizeExpression()Returns an expression for the number ofExchangevariables -
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:
-
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:
-
exchangeExceptionExpression
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:
-
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 theRegistry- Returns:
- an expression object which will return the registry
-
refExpression
Returns an expression for lookup a bean in theRegistry- 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 theRegistry- Returns:
- an expression object which will return the bean
-
camelContextExpression
public static org.apache.camel.Expression camelContextExpression()Returns an expression for theCamelContext- Returns:
- an expression object which will return the camel context
-
camelContextNameExpression
public static org.apache.camel.Expression camelContextNameExpression()Returns an expression for theCamelContextname- 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
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 returnmandatory- 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 returnmandatory- 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
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
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 returndefaultValue- 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 returndefaultValue- default value to return if no system property exists- Returns:
- an expression object which will return the system property value
-
systemEnvironmentExpression
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 returndefaultValue- 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 returndefaultValue- default value to return if no system environment exists- Returns:
- an expression object which will return the system environment value
-
constantExpression
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 namelanguage- the languageexpression- the expression or predicate- Returns:
- an expression object which will evaluate the expression/predicate using the given language
-
languageExpression
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
-
languageExpression
public static org.apache.camel.Expression languageExpression(org.apache.camel.Expression expression, String language, String value, Class<?> resultType) Returns an expression for evaluating the expression/predicate using the given language- Parameters:
expression- the expression providing the inputlanguage- the languagevalue- the value to use for evaluation- 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 predicatesource- 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
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
Returns the expression for the exchanges inbound message body converted to the given type -
bodyExpression
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
Creates a sourceExpressionfor 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
variableNameis not empty, a header expression ifheaderNameis not empty, otherwise a property expression ifpropertyNameis 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
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 typenullBodyAllowed- 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 -
logExchange
public static org.apache.camel.Expression logExchange()Dumps the exchange for logging purpose (usesExchangeFormatterto format the output). -
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
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
-
joinExpression
-
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 aListobject to allow sorting. -
substring
public static org.apache.camel.Expression substring(org.apache.camel.Expression expression, int head, int tail) Substring string values in the given expression. -
replaceAll
public static org.apache.camel.Expression replaceAll(org.apache.camel.Expression expression, String from, String to) Replaces string values in the given expression. -
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 dynamicallydescription- 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 -
fromRouteIdExpression
public static org.apache.camel.Expression fromRouteIdExpression()Returns an Expression for the original route id where this exchange was created. -
routeGroupExpression
public static org.apache.camel.Expression routeGroupExpression()Returns an Expression for the route group -
simpleExpression
-
beanExpression
-
beanExpression
-
beanExpression
public static org.apache.camel.Expression beanExpression(org.apache.camel.Expression expression, String method) -
beanExpression
-
propertiesComponentExpression
-
propertiesComponentExist
-
tokenizePairExpression
public static org.apache.camel.Expression tokenizePairExpression(String startToken, String endToken, boolean includeTokens) Returns anTokenPairExpressionIteratorexpression -
tokenizePairExpression
public static org.apache.camel.Expression tokenizePairExpression(org.apache.camel.Expression source, String startToken, String endToken, boolean includeTokens) Returns anTokenPairExpressionIteratorexpression -
tokenizeXMLExpression
public static org.apache.camel.Expression tokenizeXMLExpression(String tagName, String inheritNamespaceTagName) Returns anTokenXMLExpressionIteratorexpression -
tokenizeXMLExpression
-
tokenizeXMLAwareExpression
-
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) -
customExpression
-
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
-