Connecting Apama Applications to External Components > Using Standard Adapters > Using the Apama Web Services Client Adapter > Mapping Web Service message parameters > JUEL mapping expressions reference for Web Client Services adapter
JUEL mapping expressions reference for Web Client Services adapter
In JUEL mapping expressions, you can use certain string methods in the parts of the mapping expressions that evaluate to string types. The table below describes the string methods you can use. These methods use the same-named java.lang.String methods. The mapping expressions are evaluated first to obtain a result string and then any specified string method is applied. You use these functions in the following way:
${some_expression.substring(5)}
In the previous format, some_expression is an expression that evaluates to a string. In the following examples, f1 is a field of type string:
${apamaEvent['f1'].toString().contains('in')}
${jms.body.textmessage.toString().startsWith('sample')}
String method
Description
equalsIgnoreCase('str')
Returns a boolean value that indicates whether the result string is equal to the specified string, ignoring case.
contains('str')
Returns a boolean value that indicates whether the result string contains the specified string.
matches('regex')
Returns a boolean value that indicates whether the result string matches the specified Java regular expression.
startsWith('str')
Returns a boolean value that indicates whether the result string starts with the specified string.
endsWith('str')
Returns a boolean value that indicates whether the result string ends with the specified string.
toLowerCase()
Converts the result string to lowercase and returns it.
toUpperCase()
Converts the result string to uppercase and returns it.
concat('str')
Appends the result string with the specified string and returns this result.
replaceAll('regex','regexReplacement')
In the result string, for each substring that matches regex, this method replaces the matching substring with regexReplacement. The string with replacement values is returned.
The regexReplacement string may contain backreferences to matched regular expression subsequences using the \ and $ characters, as described in the Oracle API documentation for java.util.regex.Matcher.replaceAll(). If a literal $ or \ character is required in regexReplacement be sure to escape it with a backslash, for example: "\$" or "\\".
substring(startIndex,endIndex)
Returns a new string, which is a substring of the result string. The returned substring includes the character at startIndex and subsequent characters up to but not including the character at endIndex.
substring(startIndex)
Returns a new string, which is a substring of the result string. The returned string includes the character at startIndex and subsequent characters including the last character in the string.
trim()
Returns a copy of the result string with leading and trailing whitespace removed.
Copyright © 2013-2015 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.