public final class ExpressionBuilder extends Object
Modifier and Type | Method and Description |
---|---|
static Expression |
append(Expression left,
Expression right)
Appends the String evaluations of the two expressions together
|
static Expression |
attachmentObjectsExpression()
Returns an expression for the inbound message attachments
|
static Expression |
attachmentObjectValuesExpression()
Returns an expression for the inbound message attachments
|
static Expression |
attachmentsExpression()
Returns an expression for the inbound message attachments
|
static Expression |
attachmentValuesExpression()
Returns an expression for the inbound message attachments
|
static Expression |
beanExpression(Class<?> beanType,
String methodName) |
static Expression |
beanExpression(Object bean,
String methodName) |
static Expression |
beanExpression(String expression) |
static Expression |
beanExpression(String beanRef,
String methodName) |
static Expression |
bodyExpression()
Returns the expression for the exchanges inbound message body
|
static Expression |
bodyExpression(BiFunction<Object,Map<String,Object>,Object> function)
Returns a functional expression for the exchanges inbound message body and headers
|
static <T> Expression |
bodyExpression(Class<T> type)
Returns the expression for the exchanges inbound message body converted
to the given type
|
static <T> 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> 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 Expression |
bodyExpression(Function<Object,Object> function)
Returns a functional expression for the exchanges inbound message body
|
static Expression |
bodyExpression(String name)
Returns the expression for the exchanges inbound message body converted
to the given type
|
static Expression |
bodyOgnlExpression(String ognl)
Returns the expression for the exchanges inbound message body invoking methods defined
in a simple OGNL notation
|
static Expression |
bodyOgnlExpression(String name,
String ognl)
Returns the expression for the exchanges inbound message body converted
to the given type and invoking methods on the converted body defined in a simple OGNL notation
|
static Expression |
bodyTypeExpression()
Returns the expression for the exchanges inbound message body type
|
static Expression |
cacheExpression(Expression expression)
Returns an expression that caches the evaluation of another expression
and returns the cached value, to avoid re-evaluating the expression.
|
static Expression |
camelContextExpression()
Returns an expression for the
CamelContext |
static Expression |
camelContextNameExpression()
Returns an expression for the
CamelContext name |
static Expression |
camelContextOgnlExpression(String ognl)
Returns the expression for the exchanges camelContext invoking methods defined
in a simple OGNL notation
|
static Expression |
camelContextPropertiesExpression()
Returns an expression for the properties of the camel context
|
static Expression |
camelContextPropertyExpression(String propertyName)
Returns an expression for the property value of the camel context with the given name
|
static Expression |
collateExpression(String expression,
int group)
Returns an iterator to collate (iterate) the given expression
|
static Expression |
concatExpression(Collection<Expression> expressions)
Returns an expression which returns the string concatenation value of the various
expressions
|
static Expression |
concatExpression(Collection<Expression> expressions,
String desription)
Returns an expression which returns the string concatenation value of the various
expressions
|
static Expression |
constantExpression(Object value)
Returns an expression for the constant value
|
static Expression |
convertToExpression(Expression expression,
Class<?> type)
Returns an expression which converts the given expression to the given type
|
static Expression |
convertToExpression(Expression expression,
Expression type)
Returns an expression which converts the given expression to the given type the type
expression is evaluated to
|
static Expression |
dateExpression(String command) |
static Expression |
dateExpression(String command,
String pattern) |
static Expression |
dateExpression(String commandWithOffsets,
String timezone,
String pattern) |
static Expression |
exchangeExceptionExpression()
Returns an expression for an exception set on the exchange
|
static 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
|
static Expression |
exchangeExceptionMessageExpression()
Returns an expression for an exception message set on the exchange
|
static Expression |
exchangeExceptionOgnlExpression(String ognl)
Returns the expression for the exchanges exception invoking methods defined
in a simple OGNL notation
|
static Expression |
exchangeExceptionStackTraceExpression()
Returns an expression for an exception stacktrace set on the exchange
|
static Expression |
exchangeExpression()
Returns the expression for the exchange
|
static Expression |
exchangeExpression(Function<Exchange,Object> function)
Returns a functional expression for the exchange
|
static Expression |
exchangeIdExpression()
Returns an Expression for the exchange id
|
static Expression |
exchangeOgnlExpression(String ognl)
Returns the expression for the exchange invoking methods defined
in a simple OGNL notation
|
static Expression |
exchangePatternExpression()
Returns an expression for the exchange pattern
|
static Expression |
exchangePropertiesExpression()
Returns an expression for the exchange properties of exchange
|
static Expression |
exchangePropertyExpression(String propertyName)
Returns an expression for the property value of exchange with the given name
|
static Expression |
faultBodyExpression()
Returns the expression for the fault messages body
|
static <T> Expression |
faultBodyExpression(Class<T> type)
Returns the expression for the exchanges fault message body converted
to the given type
|
static Expression |
fileAbsoluteExpression() |
static Expression |
fileAbsolutePathExpression() |
static Expression |
fileExtensionExpression() |
static Expression |
fileExtensionSingleExpression() |
static Expression |
fileLastModifiedExpression() |
static Expression |
fileNameExpression() |
static Expression |
fileNameNoExtensionExpression() |
static Expression |
fileNameNoExtensionSingleExpression() |
static Expression |
fileOnlyNameExpression() |
static Expression |
fileOnlyNameNoExtensionExpression() |
static Expression |
fileOnlyNameNoExtensionSingleExpression() |
static Expression |
fileParentExpression() |
static Expression |
filePathExpression() |
static Expression |
fileSizeExpression() |
static Expression |
groupIteratorExpression(Expression expression,
String token,
String group,
boolean skipFirst) |
static Expression |
groupXmlIteratorExpression(Expression expression,
String group) |
static 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.
|
static <T> 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.
|
static 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.
|
static Expression |
headersExpression()
Returns an expression for the inbound message headers
|
static Expression |
headersOgnlExpression(String ognl)
Returns the expression for the exchanges inbound message header invoking methods defined
in a simple OGNL notation
|
static Expression |
inMessageExpression()
Returns the expression for the IN message
|
static Expression |
inMessageExpression(Function<Message,Object> function)
Returns a functional expression for the IN message
|
static Expression |
languageExpression(String language,
String expression)
Returns an expression for evaluating the expression/predicate using the given language
|
static <T> Expression |
mandatoryBodyExpression(Class<T> type)
Returns the expression for the exchanges inbound message body converted
to the given type.
|
static <T> Expression |
mandatoryBodyExpression(Class<T> type,
boolean nullBodyAllowed)
Returns the expression for the exchanges inbound message body converted
to the given type
|
static Expression |
mandatoryBodyExpression(String name)
Returns the expression for the exchanges inbound message body converted
to the given type
|
static Expression |
mandatoryBodyOgnlExpression(String name,
String ognl)
Returns the expression for the exchanges inbound message body converted
to the given type and invoking methods on the converted body defined in a simple OGNL notation
|
static Expression |
messageExpression()
Returns the expression for the IN message
|
static Expression |
messageExpression(Function<Message,Object> function)
Returns a functional expression for the IN message
|
static Expression |
messageHistoryExpression(boolean detailed)
Returns the message history (including exchange details or not)
|
static Expression |
messageIdExpression()
Returns an Expression for the inbound message id
|
static Expression |
nullExpression()
Returns the expression for the
null value |
static Expression |
ognlExpression(Expression exp,
String ognl)
Returns the expression for invoking a method (support OGNL syntax) on the given expression
|
static Expression |
outBodyExpression()
Returns the expression for the out messages body
|
static <T> Expression |
outBodyExpression(Class<T> type)
Returns the expression for the exchanges outbound message body converted
to the given type
|
static Expression |
outHeaderExpression(String headerName)
Returns an expression for the out header value with the given name
Will fallback and look in properties if not found in headers.
|
static Expression |
outHeadersExpression()
Returns an expression for the outbound message headers
|
static Expression |
outMessageExpression()
Returns the expression for the OUT message
|
static Expression |
outMessageExpression(Function<Message,Object> function)
Returns a functional expression for the OUT message
|
static Expression |
parseSimpleOrFallbackToConstantExpression(String str,
CamelContext camelContext)
Returns Simple expression or fallback to Constant expression if expression str is not Simple expression.
|
static Expression |
prepend(Expression left,
Expression right)
Prepends the String evaluations of the two expressions together
|
static Expression |
propertiesComponentExpression(String key,
String locations,
String defaultValue) |
static Expression |
propertiesExpression()
Deprecated.
use
exchangeExceptionExpression() instead |
static Expression |
propertyExpression(String propertyName)
Deprecated.
use
exchangePropertyExpression(String) instead |
static Expression |
propertyOgnlExpression(String ognl)
Returns an expression for the property value of exchange with the given name invoking methods defined
in a simple OGNL notation
|
static Expression |
randomExpression(int max)
Returns a random number between 0 and max (exclusive)
|
static Expression |
randomExpression(int min,
int max)
Returns a random number between min and max (exclusive)
|
static Expression |
randomExpression(String min,
String max)
Returns a random number between min and max (exclusive)
|
static Expression |
refExpression(String ref)
Returns an expression for lookup a bean in the
Registry |
static Expression |
regexReplaceAll(Expression expression,
String regex,
Expression replacementExpression)
Transforms the expression into a String then performs the regex
replaceAll to transform the String and return the result
|
static Expression |
regexReplaceAll(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 Expression |
regexTokenizeExpression(Expression expression,
String regexTokenizer)
Returns a tokenize expression which will tokenize the string with the
given regex
|
static Expression |
registryExpression()
Returns an expression for the
Registry |
static Expression |
routeIdExpression()
Returns an Expression for the route id
|
static Expression |
simpleExpression(String expression) |
static Expression |
skipExpression(String expression,
int number)
Returns an iterator to skip (iterate) the given expression
|
static Expression |
skipFirstExpression(Expression expression)
Returns an expression that skips the first element
|
static Expression |
skipIteratorExpression(Expression expression,
int skip) |
static Expression |
sortExpression(Expression expression,
Comparator comparator)
Returns a sort expression which will sort the expression with the given comparator.
|
static Expression |
systemEnvironmentExpression(String propertyName)
Returns an expression for a system environment value with the given name
|
static Expression |
systemEnvironmentExpression(String propertyName,
String defaultValue)
Returns an expression for a system environment value with the given name
|
static Expression |
systemPropertyExpression(String propertyName)
Returns an expression for a system property value with the given name
|
static Expression |
systemPropertyExpression(String propertyName,
String defaultValue)
Returns an expression for a system property value with the given name
|
static Expression |
threadNameExpression()
Returns the expression for the current thread name
|
static Expression |
toExpression(String uri)
Deprecated.
not in use, and not available in XML DSL
|
static Expression |
tokenizeExpression(Expression expression,
String token)
Returns a tokenize expression which will tokenize the string with the
given token
|
static Expression |
tokenizePairExpression(String startToken,
String endToken,
boolean includeTokens)
Returns an
TokenPairExpressionIterator expression |
static Expression |
tokenizeXMLAwareExpression(String path,
char mode) |
static Expression |
tokenizeXMLAwareExpression(String path,
char mode,
int group) |
static Expression |
tokenizeXMLExpression(String tagName,
String inheritNamespaceTagName)
Returns an
TokenXMLExpressionIterator expression |
static Expression |
typeConverterExpression()
Returns an expression for the type converter
|
static Expression |
typeExpression(String name)
Returns an expression for a type value
|
public static Expression attachmentObjectsExpression()
public static Expression attachmentObjectValuesExpression()
public static Expression attachmentsExpression()
public static Expression attachmentValuesExpression()
public static Expression headerExpression(String headerName)
headerName
- the name of the header the expression will returnpublic static <T> Expression headerExpression(String headerName, Class<T> type)
headerName
- the name of the header the expression will returntype
- the type to convert topublic static Expression headerExpression(String headerName, String typeName)
headerName
- the name of the header the expression will returntypeName
- the type to convert to as a FQN class namepublic static Expression headersOgnlExpression(String ognl)
ognl
- methods to invoke on the header in a simple OGNL syntaxpublic static Expression headersExpression()
public static Expression outHeaderExpression(String headerName)
headerName
- the name of the header the expression will returnpublic static Expression outHeadersExpression()
public static Expression exchangePatternExpression()
Exchange.getPattern()
public static Expression exchangeExceptionExpression()
Exchange.getException()
public static Expression exchangeExceptionExpression(Class<Exception> type)
type
- the exception typeExchange.getException(Class)
public static Expression exchangeExceptionOgnlExpression(String ognl)
ognl
- methods to invoke on the body in a simple OGNL syntaxpublic static Expression typeConverterExpression()
public static Expression registryExpression()
Registry
public static Expression refExpression(String ref)
Registry
public static Expression camelContextExpression()
CamelContext
public static Expression camelContextNameExpression()
CamelContext
namepublic static Expression exchangeExceptionMessageExpression()
public static Expression exchangeExceptionStackTraceExpression()
@Deprecated public static Expression propertyExpression(String propertyName)
exchangePropertyExpression(String)
insteadpropertyName
- the name of the property the expression will returnpublic static Expression exchangePropertyExpression(String propertyName)
propertyName
- the name of the property the expression will returnpublic static Expression propertyOgnlExpression(String ognl)
ognl
- methods to invoke on the property in a simple OGNL syntax@Deprecated public static Expression propertiesExpression()
exchangeExceptionExpression()
insteadpublic static Expression exchangePropertiesExpression()
public static Expression camelContextPropertiesExpression()
public static Expression camelContextPropertyExpression(String propertyName)
propertyName
- the name of the property the expression will returnpublic static Expression systemPropertyExpression(String propertyName)
propertyName
- the name of the system property the expression will returnpublic static Expression systemPropertyExpression(String propertyName, String defaultValue)
propertyName
- the name of the system property the expression will returndefaultValue
- default value to return if no system property existspublic static Expression systemEnvironmentExpression(String propertyName)
propertyName
- the name of the system environment the expression will returnpublic static Expression systemEnvironmentExpression(String propertyName, String defaultValue)
propertyName
- the name of the system environment the expression will returndefaultValue
- default value to return if no system environment existspublic static Expression constantExpression(Object value)
value
- the value the expression will returnpublic static Expression languageExpression(String language, String expression)
expression
- the expression or predicatepublic static Expression typeExpression(String name)
name
- the type namepublic static Expression cacheExpression(Expression expression)
expression
- the target expression to cachepublic static Expression bodyExpression()
public static Expression bodyExpression(Function<Object,Object> function)
public static Expression bodyExpression(BiFunction<Object,Map<String,Object>,Object> function)
public static <T> Expression bodyExpression(Class<T> bodyType, Function<T,Object> function)
public static <T> Expression bodyExpression(Class<T> bodyType, BiFunction<T,Map<String,Object>,Object> function)
public static Expression bodyOgnlExpression(String ognl)
ognl
- methods to invoke on the body in a simple OGNL syntaxpublic static Expression ognlExpression(Expression exp, String ognl)
exp
- the expression to evaluate and invoke the method on its resultognl
- methods to invoke on the evaluated expression in a simple OGNL syntaxpublic static Expression camelContextOgnlExpression(String ognl)
ognl
- methods to invoke on the context in a simple OGNL syntaxpublic static Expression exchangeOgnlExpression(String ognl)
ognl
- methods to invoke on the exchange in a simple OGNL syntaxpublic static <T> Expression bodyExpression(Class<T> type)
public static Expression bodyExpression(String name)
public static Expression bodyOgnlExpression(String name, String ognl)
public static Expression mandatoryBodyExpression(String name)
public static Expression mandatoryBodyOgnlExpression(String name, String ognl)
public static Expression threadNameExpression()
public static Expression nullExpression()
null
valuepublic static <T> Expression mandatoryBodyExpression(Class<T> type)
public static <T> Expression mandatoryBodyExpression(Class<T> type, boolean nullBodyAllowed)
type
- the typenullBodyAllowed
- whether null bodies is allowed and if so a null is returned,
otherwise an exception is thrownpublic static Expression bodyTypeExpression()
public static Expression outBodyExpression()
public static <T> Expression outBodyExpression(Class<T> type)
public static Expression faultBodyExpression()
public static <T> Expression faultBodyExpression(Class<T> type)
public static Expression exchangeExpression()
public static Expression exchangeExpression(Function<Exchange,Object> function)
public static Expression messageExpression()
public static Expression messageExpression(Function<Message,Object> function)
public static Expression inMessageExpression()
public static Expression inMessageExpression(Function<Message,Object> function)
public static Expression outMessageExpression()
public static Expression outMessageExpression(Function<Message,Object> function)
public static Expression convertToExpression(Expression expression, Class<?> type)
public static Expression convertToExpression(Expression expression, Expression type)
public static Expression tokenizeExpression(Expression expression, String token)
public static Expression skipFirstExpression(Expression expression)
public static Expression tokenizePairExpression(String startToken, String endToken, boolean includeTokens)
TokenPairExpressionIterator
expressionpublic static Expression tokenizeXMLExpression(String tagName, String inheritNamespaceTagName)
TokenXMLExpressionIterator
expressionpublic static Expression tokenizeXMLAwareExpression(String path, char mode)
public static Expression tokenizeXMLAwareExpression(String path, char mode, int group)
public static Expression regexTokenizeExpression(Expression expression, String regexTokenizer)
public static Expression groupXmlIteratorExpression(Expression expression, String group)
public static Expression groupIteratorExpression(Expression expression, String token, String group, boolean skipFirst)
public static Expression skipIteratorExpression(Expression expression, int skip)
public static Expression sortExpression(Expression expression, Comparator comparator)
List
object to allow sorting.public static Expression regexReplaceAll(Expression expression, String regex, String replacement)
public static Expression regexReplaceAll(Expression expression, String regex, Expression replacementExpression)
public static Expression append(Expression left, Expression right)
public static Expression prepend(Expression left, Expression right)
public static Expression concatExpression(Collection<Expression> expressions)
expressions
- the expression to be concatenated dynamicallypublic static Expression concatExpression(Collection<Expression> expressions, String desription)
expressions
- the expression to be concatenated dynamicallydesription
- the text description of the expressionpublic static Expression messageIdExpression()
public static Expression exchangeIdExpression()
public static Expression routeIdExpression()
public static Expression dateExpression(String command)
public static Expression dateExpression(String command, String pattern)
public static Expression dateExpression(String commandWithOffsets, String timezone, String pattern)
public static Expression simpleExpression(String expression)
public static Expression beanExpression(String expression)
public static Expression beanExpression(Class<?> beanType, String methodName)
public static Expression beanExpression(Object bean, String methodName)
public static Expression beanExpression(String beanRef, String methodName)
@Deprecated public static Expression toExpression(String uri)
uri
- endpoint uri to send the exchange topublic static Expression fileNameExpression()
public static Expression fileOnlyNameExpression()
public static Expression fileNameNoExtensionExpression()
public static Expression fileNameNoExtensionSingleExpression()
public static Expression fileOnlyNameNoExtensionExpression()
public static Expression fileOnlyNameNoExtensionSingleExpression()
public static Expression fileExtensionExpression()
public static Expression fileExtensionSingleExpression()
public static Expression fileParentExpression()
public static Expression filePathExpression()
public static Expression fileAbsolutePathExpression()
public static Expression fileAbsoluteExpression()
public static Expression fileSizeExpression()
public static Expression fileLastModifiedExpression()
public static Expression parseSimpleOrFallbackToConstantExpression(String str, CamelContext camelContext)
public static Expression propertiesComponentExpression(String key, String locations, String defaultValue)
public static Expression randomExpression(int max)
public static Expression randomExpression(int min, int max)
public static Expression randomExpression(String min, String max)
public static Expression skipExpression(String expression, int number)
public static Expression collateExpression(String expression, int group)
public static Expression messageHistoryExpression(boolean detailed)
Apache Camel