You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2026/09/17 19:15:55 UTC
(camel) branch feature/CAMEL-24802-simple-escape created (now 8b11358a3898)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a change to branch feature/CAMEL-24802-simple-escape
in repository https://gitbox.apache.org/repos/asf/camel.git
at 8b11358a3898 CAMEL-24802: camel-core - simple: add escape function for html/xml/json/js/sql/url special characters
This branch includes the following new commits:
new 8b11358a3898 CAMEL-24802: camel-core - simple: add escape function for html/xml/json/js/sql/url special characters
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(camel) 01/01: CAMEL-24802: camel-core - simple: add escape function for html/xml/json/js/sql/url special characters
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch feature/CAMEL-24802-simple-escape
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 8b11358a38988629fa8e1a8cbe11802bd9701c43
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Sep 17 21:15:23 2026 +0200
CAMEL-24802: camel-core - simple: add escape function for html/xml/json/js/sql/url special characters
Co-Authored-By: Claude Opus 5 (1M context) <no...@anthropic.com>
Signed-off-by: Claus Ibsen <cl...@gmail.com>
---
.../camel/catalog/docs/simple-functions.adoc | 22 ++
.../org/apache/camel/catalog/languages/simple.json | 193 ++++++++---------
.../camel/catalog/simple/camel-simple-validator.js | 1 +
.../org/apache/camel/language/simple/simple.json | 193 ++++++++---------
.../modules/languages/pages/simple-functions.adoc | 22 ++
.../camel/language/simple/SimpleConstants.java | 13 ++
.../language/simple/StringExpressionBuilder.java | 43 ++++
.../simple/functions/StringFunctionFactory.java | 29 ++-
.../functions/StringFunctionFactoryTest.java | 81 +++++++
.../java/org/apache/camel/util/EscapeHelper.java | 237 +++++++++++++++++++++
.../java/org/apache/camel/util/SimpleUtils.java | 1 +
.../org/apache/camel/util/EscapeHelperTest.java | 108 ++++++++++
12 files changed, 750 insertions(+), 193 deletions(-)
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/simple-functions.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/simple-functions.adoc
index 046c176a5a17..1aff8e88c534 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/simple-functions.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/simple-functions.adoc
@@ -513,6 +513,8 @@ The string functions is various functions to work with values that are String an
|`capitalize()` | `String` | Capitalizes the message body as a String value (upper case every words)
|`capitalize(exp)` | `String` | Capitalizes the expression as a String value (upper case every words)
|`concat(exp,exp,separator)` | `String` | Performs a string concat using two expressions (message body as default) with optional separator.
+|`escape(kind)` | `String` | Escapes special characters in the message body so it can be safely embedded in HTML, XML, JSON, JavaScript, SQL, or a URL. The kind is one of `html`, `xml`, `json`, `js`, `sql`, or `url`.
+|`escape(kind,exp)` | `String` | Escapes special characters in the expression so it can be safely embedded in HTML, XML, JSON, JavaScript, SQL, or a URL. The kind is one of `html`, `xml`, `json`, `js`, `sql`, or `url`.
|`join(separator,prefix,exp)` | `String` | The join function iterates the message body (by default) and joins the data into a `String`. The separator is by default a comma. The prefix is optional. The join uses the message body as source by default. It is possible to refer to another source (simple language) such as a header via the exp parameter. For example `join('&','id=','$\{header.ids}')`
|`lowercase()` | `String` | Lowercases the message body
|`lowercase(exp)` | `String` | Lowercases the expression
@@ -556,6 +558,26 @@ For example if the message body contains a list of [A, B, C] then `${join()}` wo
To use semicolon as separator you would use `${join(;)}`. The `prefix` argument can be used to prefix each value, so for example
`${join(&,id=)}` would return `id=A&id=B&id=C`.
+The `escape` function escapes special characters so a value can be safely embedded in another format,
+instead of chaining multiple `replace` calls or using a custom bean. The first argument is the kind of escaping:
+
+[width="100%",cols="10%,45%,45%",options="header",]
+|====
+|Kind |Escaping |Example
+|`html` | `&` `<` `>` `"` `'` are replaced with HTML entities | `${escape(html, 'Tom & Jerry')}` returns `Tom & Jerry`
+|`xml` | `&` `<` `>` `"` `'` are replaced with the five predefined XML entities | `${escape(xml, ${header.title})}`
+|`json` | quotes, backslashes and control characters are backslash-escaped for use inside a JSON string (surrounding quotes are not added) | `${escape(json, ${body})}`
+|`js` | as `json`, and also single quotes and `</` so the value can be used inside a JavaScript string literal | `${escape(js, ${header.msg})}`
+|`sql` | single quotes are doubled for use inside an SQL string literal | `${escape(sql, ${header.name})}`
+|`url` | percent-encoding (RFC 3986) for use as a URL query parameter or path segment; a space becomes `%20` | `${escape(url, 'Camel in Action')}` returns `Camel%20in%20Action`
+|====
+
+Without a second argument the function operates on the message body, so if the body is `Monday & Tuesday`
+then `${escape(html)}` returns `Monday & Tuesday`. The kind is case-insensitive, and `javascript` can be used instead of `js`.
+
+TIP: Prefer parameterized queries over `escape(sql)`; the SQL kind is meant as a last resort for
+components where parameters cannot be used.
+
The `lowercase` and `uppercase` functions are as the name implies used for lower and uppercasing.
So `${lowercase('Hello World')}` returns `hello world` and `${uppercase('Hello World')}` returns `HELLO WORLD`.
Without arguments, they operate on the message body: if the body is `HELLO` then `${lowercase()}` returns `hello`.
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/simple.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/simple.json
index 6da75471d8fb..b807033f3f3d 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/simple.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/simple.json
@@ -81,102 +81,103 @@
"distinct(val...)": { "index": 53, "kind": "function", "displayName": "Distinct Values", "group": "collection", "label": "collection", "required": false, "javaType": "Set", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a set of all the values with duplicates removed", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "Object", "required": false, "defaultValue": "body", "description": "Valu [...]
"empty(type)": { "index": 54, "kind": "function", "displayName": "Create Empty Object", "group": "collection", "label": "collection", "required": false, "javaType": "Object", "prefix": "${", "deprecated": true, "deprecationNote": "", "autowired": false, "secret": false, "description": "Creates a new empty object (decided by type). Use `string` to create an empty String. Use `list` to create an empty `java.util.ArrayList`. Use `map` to create an empty `java.util.LinkedHashMap`. Use `s [...]
"env.name": { "index": 55, "kind": "function", "displayName": "OS Environment Variable", "group": "other", "label": "other", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The OS environment variable with the given name", "ognl": false, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The environment variable name" } ], "exampl [...]
- "exchange": { "index": 56, "kind": "function", "displayName": "Exchange", "group": "core", "label": "core", "required": false, "javaType": "org.apache.camel.Exchange", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The current exchange", "ognl": true, "suffix": "}" },
- "exchangeId": { "index": 57, "kind": "function", "displayName": "Exchange Id", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exchange id", "ognl": false, "suffix": "}", "examples": [ "${exchangeId} -> ID-myhost-1234-1234567890-0-1" ] },
- "exchangeProperty.name": { "index": 58, "kind": "function", "displayName": "Exchange Property", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exchange property with the given name", "ognl": true, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The exchange property name" } ], "examples": [...]
- "exception": { "index": 59, "kind": "function", "displayName": "Exception", "group": "core", "label": "core", "required": false, "javaType": "java.lang.Exception", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exception object on the exchange (also from caught exceptions), is null if no exception present.", "ognl": true, "suffix": "}" },
- "exception.message": { "index": 60, "kind": "function", "displayName": "Exception Message", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exception message (also from caught exceptions), is null if no exception present.", "ognl": false, "suffix": "}", "examples": [ "${exception.message} -> Connection refused" ] },
- "exception.stackTrace": { "index": 61, "kind": "function", "displayName": "Exception Stacktrace", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exception stacktrace (also from caught exceptions), is null if no exception present.", "ognl": false, "suffix": "}" },
- "filter(exp,fun)": { "index": 62, "kind": "function", "displayName": "Filter Elements", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a List containing the values that satisfy the predicate function (returning true)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultVa [...]
- "forEach(exp,fun)": { "index": 63, "kind": "function", "displayName": "For Each call Function", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a List containing the values returned by the function when applied to each value from the input expression", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Objec [...]
- "floor(exp)": { "index": 64, "kind": "function", "displayName": "Floor Number", "group": "number", "label": "number", "required": false, "javaType": "Integer", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the message body (or expression) to a floating number and return the floor value (rounded down to nearest integer).", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "requir [...]
- "fromRouteId": { "index": 65, "kind": "function", "displayName": "From Route Id", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The original route id where this exchange was created.", "ognl": false, "suffix": "}", "examples": [ "${fromRouteId} -> myRoute" ] },
- "function(name,exp)": { "index": 66, "kind": "function", "displayName": "Invoke Custom Function", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Invokes a custom function with the given name using the message body (or expression) as input parameter.", "ognl": false, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": t [...]
- "hash(exp,algorithm)": { "index": 67, "kind": "function", "displayName": "Compute Hash Value", "group": "other", "label": "other", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a hashed value (string in hex decimal) of the message body\/expression using JDK MessageDigest. The algorithm can be SHA-256 (default) or SHA3-256.", "ognl": false, "suffix": "}", "params": [ { " [...]
- "header.name": { "index": 68, "kind": "function", "displayName": "Header", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message header with the given name", "ognl": true, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The header name" } ], "examples": [ "${header.ContentType} -> applica [...]
- "headerAs(key,type)": { "index": 69, "kind": "function", "displayName": "Header As", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the message header to the given type (classname).", "ognl": false, "suffix": "}", "params": [ { "name": "key", "javaType": "String", "required": true, "description": "The header name" }, { "name": "type", " [...]
- "headers": { "index": 70, "kind": "function", "displayName": "Headers", "group": "core", "label": "core", "required": false, "javaType": "java.util.Map", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns all the message headers in a Map", "ognl": false, "suffix": "}", "examples": [ "${headers} -> {ContentType=application\/json, CamelFileName=data.txt}" ] },
- "hostName": { "index": 71, "kind": "function", "displayName": "Host Name", "group": "other", "label": "other", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the local hostname (may be empty if not possible to resolve).", "ognl": false, "suffix": "}", "examples": [ "${hostName} -> myserver.local" ] },
- "htmlClean(exp)": { "index": 72, "kind": "function", "displayName": "Html Clean", "group": "html", "label": "html", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Cleans the HTML to remove unsafe links and JavaScripts from the message body (or expression)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", [...]
- "htmlDecode(exp)": { "index": 73, "kind": "function", "displayName": "Html Decode", "group": "html", "label": "html", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Decodes the HTML as plain text (removing all HTML tags) that is also suitable as input for AI and LLMs", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultVal [...]
- "htmlParse(exp)": { "index": 74, "kind": "function", "displayName": "Html Parse", "group": "html", "label": "html", "required": false, "javaType": "org.jsoup.nodes.Document", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Parses the HTML as a JSoup object from the message body (or expression)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "d [...]
- "id": { "index": 75, "kind": "function", "displayName": "Id", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message id", "ognl": false, "suffix": "}" },
- "iif(predicate,trueExp,falseExp)": { "index": 76, "kind": "function", "displayName": "If Then Else", "group": "condition", "label": "condition", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Evaluates the predicate and returns the value of trueExp or falseExp. This function is similar to the ternary operator in Java.", "ognl": false, "suffix": "}", "params": [ { "name": "predic [...]
- "isAlpha(exp)": { "index": 77, "kind": "function", "displayName": "Is Alphabetic Value", "group": "condition", "label": "condition", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether the message body (or expression) is alphabetic value (A..Z). For more advanced checks use the `regex` operator.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object [...]
- "isAlphaNumeric(exp)": { "index": 78, "kind": "function", "displayName": "Is Alphabetic-Numeric Value", "group": "condition", "label": "condition", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether the message body (or expression) is alphanumeric value (A..Z0-9). For more advanced checks use the `regex` operator.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", [...]
- "isEmpty(exp)": { "index": 79, "kind": "function", "displayName": "Is Empty", "group": "condition", "label": "condition", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether the message body (or expression) is null or empty (list\/map types are tested if they have 0 elements).", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": fals [...]
- "isNumeric(exp)": { "index": 80, "kind": "function", "displayName": "Is Numeric Value", "group": "condition", "label": "condition", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether the message body (or expression) is numeric value (0..9). For more advanced checks use the `regex` operator.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", " [...]
- "jq(input,exp)": { "index": 81, "kind": "function", "displayName": "JQ", "group": "json", "label": "json", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "When working with JSon data, then this allows using the JQ language, for example, to extract data from the message body (in JSon format). This requires having camel-jq JAR on the classpath. For input (optional), you can choose [...]
- "jsonpath(input,exp)": { "index": 82, "kind": "function", "displayName": "JSonPath", "group": "json", "label": "json", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "When working with JSon data, then this allows using the JSonPath language, for example, to extract data from the message body (in JSon format). This requires having camel-jsonpath JAR on the classpath. For input (op [...]
- "join(separator,prefix,exp)": { "index": 83, "kind": "function", "displayName": "Join", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The join function iterates the message body\/expression and joins the data into a string. The separator is by default a comma. The prefix is optional. The join uses the message body as source by default. It i [...]
- "length(exp)": { "index": 84, "kind": "function", "displayName": "Length", "group": "core", "label": "core", "required": false, "javaType": "int", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The payload length (number of bytes) of the message body (or expression).", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expressi [...]
- "list(val...)": { "index": 85, "kind": "function", "displayName": "Create List of values", "group": "collection", "label": "collection", "required": false, "javaType": "java.util.ArrayList", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The list function creates an ArrayList with the given set of values.", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "Object", "required": true, "description": [...]
- "listAdd(source,exp)": { "index": 86, "kind": "function", "displayName": "List Add", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Adds the result of the expression to the message body (or expression) which is a list", "ognl": false, "suffix": "}", "params": [ { "name": "source", "javaType": "Object", "required": false, "defaultValue" [...]
- "listRemove(source,exp)": { "index": 87, "kind": "function", "displayName": "List Remove", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Removes the result of the expression from the message body (or expression) which is a list", "ognl": false, "suffix": "}", "params": [ { "name": "source", "javaType": "Object", "required": false, "de [...]
- "load(file)": { "index": 88, "kind": "function", "displayName": "Load", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Loads the content of the resource from classpath (cannot load from file-system to avoid dangerous situations).", "ognl": false, "suffix": "}", "params": [ { "name": "file", "javaType": "String", "required": true, "description": [...]
- "lowercase(exp)": { "index": 89, "kind": "function", "displayName": "Lowercase", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Lowercases the message body (or expression)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expression. When omitted [...]
- "mandatoryBodyAs(type)": { "index": 90, "kind": "function", "displayName": "Mandatory Body As", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the message body to the given type (classname). If the body is null then the function will fail with an exception", "ognl": true, "suffix": "}", "params": [ { "name": "type", "javaType": "String" [...]
- "map(key1,value1,...)": { "index": 91, "kind": "function", "displayName": "Create Map of pairs", "group": "collection", "label": "collection", "required": false, "javaType": "java.util.LinkedHashMap", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The map function creates a LinkedHashMap with the given set of pairs.", "ognl": false, "suffix": "}", "params": [ { "name": "key1", "javaType": "Object", "required": true, "d [...]
- "mapAdd(source,key,exp)": { "index": 92, "kind": "function", "displayName": "Map Add", "group": "collection", "label": "collection", "required": false, "javaType": "Map", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Adds the result of the expression to the message body (or expression) which is a map", "ognl": false, "suffix": "}", "params": [ { "name": "source", "javaType": "Object", "required": false, "defaultValue" [...]
- "mapRemove(source,key)": { "index": 93, "kind": "function", "displayName": "Map Remove", "group": "collection", "label": "collection", "required": false, "javaType": "Map", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Removes the result of the expression from the message body (or expression) which is a map", "ognl": false, "suffix": "}", "params": [ { "name": "source", "javaType": "Object", "required": false, "defaul [...]
- "max(val...)": { "index": 94, "kind": "function", "displayName": "Maximum Number", "group": "number", "label": "number", "required": false, "javaType": "long", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the maximum number from all the values (integral numbers only).", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "long", "required": false, "defaultValue": "body", "description": "Val [...]
- "messageAs(type)": { "index": 95, "kind": "function", "displayName": "Message As", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the message to the given type (classname).", "ognl": true, "suffix": "}", "params": [ { "name": "type", "javaType": "String", "required": true, "description": "The target type classname" } ] },
- "messageHistory(boolean)": { "index": 96, "kind": "function", "displayName": "Print Message History", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message history of the current exchange (how it has been routed). This is similar to the route stack-trace message history the error handler logs in case of an unhandled exception. The boolean c [...]
- "messageTimestamp": { "index": 97, "kind": "function", "displayName": "Message Timestamp", "group": "core", "label": "core", "required": false, "javaType": "long", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message timestamp (millis since epoc) that this message originates from. Some systems like JMS, Kafka, AWS have a timestamp on the event\/message that Camel received. This method returns the timestamp if a t [...]
- "min(val...)": { "index": 98, "kind": "function", "displayName": "Minimum Number", "group": "number", "label": "number", "required": false, "javaType": "long", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the minimum number from all the values (integral numbers only).", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "long", "required": false, "defaultValue": "body", "description": "Val [...]
- "newEmpty(type)": { "index": 99, "kind": "function", "displayName": "Create Empty Object", "group": "collection", "label": "collection", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Creates a new empty object (decided by type). Use `string` to create an empty String. Use `list` to create an empty `java.util.ArrayList`. Use `map` to create an empty `java.util.LinkedHashMap`. Us [...]
- "normalizeWhitespace(exp)": { "index": 100, "kind": "function", "displayName": "Normalize Whitespace", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Normalizes the whitespace in the message body (or expression) by cleaning up excess whitespaces.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": f [...]
- "not": { "index": 101, "kind": "function", "displayName": "Not", "group": "condition", "label": "condition", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Evaluates the predicate and returns the opposite.", "ognl": false, "suffix": "}" },
- "null": { "index": 102, "kind": "function", "displayName": "Null", "group": "other", "label": "other", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a null value", "ognl": false, "suffix": "}", "examples": [ "${null} -> null" ] },
- "originalBody": { "index": 103, "kind": "function", "displayName": "Original Body", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The original incoming body (only available if allowUseOriginalMessage=true).", "ognl": false, "suffix": "}" },
- "pad(exp,width,separator)": { "index": 104, "kind": "function", "displayName": "Pad String", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Pads the expression with extra padding if necessary, according the the total width. The separator is by default a space. If the width is negative then padding to the right, otherwise to the left.", "ognl [...]
- "pretty(exp)": { "index": 105, "kind": "function", "displayName": "Pretty Print", "group": "xml", "label": "json,xml", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the expression to a String, and attempts to pretty print if JSon or XML, otherwise the expression is returned as the String value.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "O [...]
- "prettyBody": { "index": 106, "kind": "function", "displayName": "Pretty Body", "group": "xml", "label": "json,xml", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the body to a String, and attempts to pretty print if JSon or XML; otherwise the body is returned as the String value.", "ognl": false, "suffix": "}" },
- "sort(exp,reverse)": { "index": 107, "kind": "function", "displayName": "Sort", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sorts the message body or expression in natural order", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expression [...]
- "toPrettyJson(exp)": { "index": 108, "kind": "function", "displayName": "To Pretty JSon", "group": "json", "label": "json", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the expression to JSon String representation.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expressio [...]
- "toPrettyJsonBody": { "index": 109, "kind": "function", "displayName": "To Pretty JSon Body", "group": "json", "label": "json", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the body to JSon String representation.", "ognl": false, "suffix": "}" },
- "toJson(exp)": { "index": 110, "kind": "function", "displayName": "To JSon", "group": "json", "label": "json", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the expression to JSon String representation.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expression. When omitt [...]
- "toJsonBody": { "index": 111, "kind": "function", "displayName": "To JSon Body", "group": "json", "label": "json", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the body to JSon String representation.", "ognl": false, "suffix": "}" },
- "properties:key:default": { "index": 112, "kind": "function", "displayName": "Property Placeholder", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Lookup a property placeholder with the given key. If the key does not exist nor has a value, then an optional default value can be specified.", "ognl": false, "suffix": "}", "params": [ { "name": "ke [...]
- "propertiesExist:key": { "index": 113, "kind": "function", "displayName": "Property Placeholder Exists", "group": "core", "label": "core", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Checks whether a property placeholder with the given key exists or not. The result can be negated by prefixing the key with !", "ognl": false, "suffix": "}", "params": [ { "name": "key", "javaTy [...]
- "quote(exp)": { "index": 114, "kind": "function", "displayName": "Quote", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the message body (or expression) as a double quoted string", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expressio [...]
- "random(min,max)": { "index": 115, "kind": "function", "displayName": "Random", "group": "number", "label": "number", "required": false, "javaType": "int", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a random number between min and max (exclusive)", "ognl": false, "suffix": "}", "params": [ { "name": "min", "javaType": "int", "required": true, "description": "The minimum value (inclusive)" }, { "name": "max" [...]
- "range(min,max)": { "index": 116, "kind": "function", "displayName": "Range", "group": "number", "label": "number", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a list of increasing integers between the given interval (exclusive)", "ognl": false, "suffix": "}", "params": [ { "name": "min", "javaType": "int", "required": true, "description": "The start value (inclusive)" [...]
- "ref:name": { "index": 117, "kind": "function", "displayName": "Bean By Id", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "To look up a bean from the Registry with the given name.", "ognl": false, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The bean name in the registry" } ], "examples": [...]
- "replace(from,to,exp)": { "index": 118, "kind": "function", "displayName": "Replace String Values", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Replace all the string values in the message body\/expression. To make it easier to replace single and double quotes, then you can use XML escaped values `\\"` as double quote, `\\'` as [...]
- "reverse(val...)": { "index": 119, "kind": "function", "displayName": "Reverse Values", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a list of all the values, but in reverse order", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "Object", "required": false, "defaultValue": "body", "description": "Value [...]
- "routeGroup": { "index": 120, "kind": "function", "displayName": "Route Group", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The route group of the current route the Exchange is being routed. Not all routes have a group assigned, so this may be null.", "ognl": false, "suffix": "}" },
- "routeId": { "index": 121, "kind": "function", "displayName": "Route Id", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The route id of the current route the Exchange is being routed", "ognl": false, "suffix": "}", "examples": [ "${routeId} -> myRoute" ] },
- "safeQuote(exp)": { "index": 122, "kind": "function", "displayName": "Safe Quote", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the message body (or expression) safely quoted if needed", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The ex [...]
- "setVariable(key,exp)": { "index": 123, "kind": "function", "displayName": "Set Variable", "group": "attachment", "label": "attachment", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets an attachment with payload from the message body\/expression.", "ognl": false, "suffix": "}" },
- "setHeader(name,type,exp)": { "index": 124, "kind": "function", "displayName": "Set Header", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets a message header with the given expression (optional converting to the given type)", "ognl": false, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "T [...]
- "setVariable(name,type,exp)": { "index": 125, "kind": "function", "displayName": "Set Variable", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets a variable with the given expression (optional converting to the given type)", "ognl": false, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The [...]
- "shuffle(val...)": { "index": 126, "kind": "function", "displayName": "Shuffle Values", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a list of all the values shuffled in random order", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "Object", "required": false, "defaultValue": "body", "description": "Va [...]
- "simpleJsonpath(input,exp)": { "index": 127, "kind": "function", "displayName": "Simple JSonPath", "group": "json", "label": "json", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "When working with JSon data, then this allows using the Simple JSonPath language, for example, to extract data from the message body (in JSon format). For input (optional), you can choose `header:key`, [...]
- "size(exp)": { "index": 128, "kind": "function", "displayName": "Size", "group": "collection", "label": "collection", "required": false, "javaType": "int", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the number of elements in collection or array based payloads. If the value is null then 0 is returned, otherwise 1.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": [...]
- "skip(num)": { "index": 129, "kind": "function", "displayName": "Skip First Items from the Message Body", "group": "collection", "label": "collection", "required": false, "javaType": "java.util.Iterator", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The skip function iterates the message body and skips the first number of items. This can be used with the Splitter EIP to split a message body and skip the first N numbe [...]
- "split(exp,separator)": { "index": 130, "kind": "function", "displayName": "Split String Values", "group": "collection", "label": "collection", "required": false, "javaType": "String[]", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Splits the message body\/expression as a String value using the separator into a String array", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": [...]
- "stepId": { "index": 131, "kind": "function", "displayName": "Step Id", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the id of the current step the Exchange is being routed.", "ognl": false, "suffix": "}" },
- "substring(head,tail)": { "index": 132, "kind": "function", "displayName": "Substring", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a substring of the message body\/expression. If only one positive number, then the returned string is clipped from the beginning. If only one negative number, then the returned string is clipped from [...]
- "substringAfter(exp,before)": { "index": 133, "kind": "function", "displayName": "Substring After", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a substring of the message body\/expression that comes after. Returns null if nothing comes after.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "requi [...]
- "substringBefore(exp,before)": { "index": 134, "kind": "function", "displayName": "Substring Before", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a substring of the message body\/expression that comes before. Returns null if nothing comes before.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "r [...]
- "substringBetween(exp,after,before)": { "index": 135, "kind": "function", "displayName": "Substring Between", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a substring of the message body\/expression that are between after and before. Returns null if nothing comes between.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", [...]
- "sum(val...)": { "index": 136, "kind": "function", "displayName": "Calculate Sum Number", "group": "number", "label": "number", "required": false, "javaType": "long", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sums together all the values as integral numbers. This function can also be used to subtract by using negative numbers.", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "long", "requir [...]
- "sys.name": { "index": 137, "kind": "function", "displayName": "JVM System Property", "group": "other", "label": "other", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The JVM system property with the given name", "ognl": false, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The system property name" } ], "examples": [ "${sy [...]
- "threadId": { "index": 138, "kind": "function", "displayName": "Thread Id", "group": "other", "label": "other", "required": false, "javaType": "long", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the id of the current thread. Can be used for logging.", "ognl": false, "suffix": "}" },
- "threadName": { "index": 139, "kind": "function", "displayName": "Thread Name", "group": "other", "label": "other", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the name of the current thread. Can be used for logging.", "ognl": false, "suffix": "}" },
- "throwException(type,msg)": { "index": 140, "kind": "function", "displayName": "Throw Exception", "group": "core", "label": "core", "required": false, "javaType": "java.lang.Exception", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Deliberately throws an error. Uses IllegalArgumentException by default if no type is specified (use fully qualified classname).", "ognl": false, "suffix": "}", "params": [ { "name": "type", [...]
- "trim(exp)": { "index": 141, "kind": "function", "displayName": "Trim", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The trim function trims the message body (or expression) by removing all leading and trailing white spaces.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue" [...]
- "type:name.field": { "index": 142, "kind": "function", "displayName": "Java Field Value", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "To refer to a type or field by its classname. To refer to a field, you can append .FIELD_NAME. For example, you can refer to the constant field from Exchange as: `org.apache.camel.Exchange.FILE_NAME`", "ognl": [...]
- "kindOfType(exp)": { "index": 143, "kind": "function", "displayName": "Kind of Type", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "What kind of type is the value (null,number,string,boolean,array,object)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": [...]
- "unquote(exp)": { "index": 144, "kind": "function", "displayName": "Unquote", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the message body (or expression) with any leading\/ending quotes removed", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "descriptio [...]
- "uppercase(exp)": { "index": 145, "kind": "function", "displayName": "Uppercase", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Uppercases the message body (or expression)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expression. When omitted [...]
- "uuid(type)": { "index": 146, "kind": "function", "displayName": "Generate UUID", "group": "other", "label": "other", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a UUID using the Camel `UuidGenerator`. You can choose between `default`, `classic`, `short` and `simple` as the type. If no type is given, the default is used. It is also possible to use a custom `UuidGenera [...]
- "val(exp)": { "index": 147, "kind": "function", "displayName": "Value", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the expression as a constant value", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": true, "description": "The constant value expression" } ], "examples": [ "${val(42)} -> 42" [...]
- "variable.name": { "index": 148, "kind": "function", "displayName": "Variable", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The variable with the given name", "ognl": true, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The variable name" } ], "examples": [ "${variable.myVar} -> variable v [...]
- "variableAs(key,type)": { "index": 149, "kind": "function", "displayName": "Variable As", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the variable to the given type (classname).", "ognl": false, "suffix": "}", "params": [ { "name": "key", "javaType": "String", "required": true, "description": "The variable name" }, { "name": "type", [...]
- "variables": { "index": 150, "kind": "function", "displayName": "Variables", "group": "core", "label": "core", "required": false, "javaType": "java.util.Map", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns all the variables from the current Exchange in a Map", "ognl": false, "suffix": "}", "examples": [ "${variables} -> {myVar=value1, count=5}" ] },
- "xpath(input,exp)": { "index": 151, "kind": "function", "displayName": "XPath", "group": "xml", "label": "xml", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "When working with XML data, then this allows using the XPath language, for example, to extract data from the message body (in XML format). This requires having camel-xpath JAR on the classpath. For input (optional), you ca [...]
+ "escape(kind,exp)": { "index": 56, "kind": "function", "displayName": "Escape Special Characters", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Escapes special characters in the message body (or expression) so the value can be safely embedded in HTML, XML, JSON, JavaScript, SQL, or a URL. The kind is one of: html, xml, json, js, sql, url." [...]
+ "exchange": { "index": 57, "kind": "function", "displayName": "Exchange", "group": "core", "label": "core", "required": false, "javaType": "org.apache.camel.Exchange", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The current exchange", "ognl": true, "suffix": "}" },
+ "exchangeId": { "index": 58, "kind": "function", "displayName": "Exchange Id", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exchange id", "ognl": false, "suffix": "}", "examples": [ "${exchangeId} -> ID-myhost-1234-1234567890-0-1" ] },
+ "exchangeProperty.name": { "index": 59, "kind": "function", "displayName": "Exchange Property", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exchange property with the given name", "ognl": true, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The exchange property name" } ], "examples": [...]
+ "exception": { "index": 60, "kind": "function", "displayName": "Exception", "group": "core", "label": "core", "required": false, "javaType": "java.lang.Exception", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exception object on the exchange (also from caught exceptions), is null if no exception present.", "ognl": true, "suffix": "}" },
+ "exception.message": { "index": 61, "kind": "function", "displayName": "Exception Message", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exception message (also from caught exceptions), is null if no exception present.", "ognl": false, "suffix": "}", "examples": [ "${exception.message} -> Connection refused" ] },
+ "exception.stackTrace": { "index": 62, "kind": "function", "displayName": "Exception Stacktrace", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exception stacktrace (also from caught exceptions), is null if no exception present.", "ognl": false, "suffix": "}" },
+ "filter(exp,fun)": { "index": 63, "kind": "function", "displayName": "Filter Elements", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a List containing the values that satisfy the predicate function (returning true)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultVa [...]
+ "forEach(exp,fun)": { "index": 64, "kind": "function", "displayName": "For Each call Function", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a List containing the values returned by the function when applied to each value from the input expression", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Objec [...]
+ "floor(exp)": { "index": 65, "kind": "function", "displayName": "Floor Number", "group": "number", "label": "number", "required": false, "javaType": "Integer", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the message body (or expression) to a floating number and return the floor value (rounded down to nearest integer).", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "requir [...]
+ "fromRouteId": { "index": 66, "kind": "function", "displayName": "From Route Id", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The original route id where this exchange was created.", "ognl": false, "suffix": "}", "examples": [ "${fromRouteId} -> myRoute" ] },
+ "function(name,exp)": { "index": 67, "kind": "function", "displayName": "Invoke Custom Function", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Invokes a custom function with the given name using the message body (or expression) as input parameter.", "ognl": false, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": t [...]
+ "hash(exp,algorithm)": { "index": 68, "kind": "function", "displayName": "Compute Hash Value", "group": "other", "label": "other", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a hashed value (string in hex decimal) of the message body\/expression using JDK MessageDigest. The algorithm can be SHA-256 (default) or SHA3-256.", "ognl": false, "suffix": "}", "params": [ { " [...]
+ "header.name": { "index": 69, "kind": "function", "displayName": "Header", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message header with the given name", "ognl": true, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The header name" } ], "examples": [ "${header.ContentType} -> applica [...]
+ "headerAs(key,type)": { "index": 70, "kind": "function", "displayName": "Header As", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the message header to the given type (classname).", "ognl": false, "suffix": "}", "params": [ { "name": "key", "javaType": "String", "required": true, "description": "The header name" }, { "name": "type", " [...]
+ "headers": { "index": 71, "kind": "function", "displayName": "Headers", "group": "core", "label": "core", "required": false, "javaType": "java.util.Map", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns all the message headers in a Map", "ognl": false, "suffix": "}", "examples": [ "${headers} -> {ContentType=application\/json, CamelFileName=data.txt}" ] },
+ "hostName": { "index": 72, "kind": "function", "displayName": "Host Name", "group": "other", "label": "other", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the local hostname (may be empty if not possible to resolve).", "ognl": false, "suffix": "}", "examples": [ "${hostName} -> myserver.local" ] },
+ "htmlClean(exp)": { "index": 73, "kind": "function", "displayName": "Html Clean", "group": "html", "label": "html", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Cleans the HTML to remove unsafe links and JavaScripts from the message body (or expression)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", [...]
+ "htmlDecode(exp)": { "index": 74, "kind": "function", "displayName": "Html Decode", "group": "html", "label": "html", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Decodes the HTML as plain text (removing all HTML tags) that is also suitable as input for AI and LLMs", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultVal [...]
+ "htmlParse(exp)": { "index": 75, "kind": "function", "displayName": "Html Parse", "group": "html", "label": "html", "required": false, "javaType": "org.jsoup.nodes.Document", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Parses the HTML as a JSoup object from the message body (or expression)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "d [...]
+ "id": { "index": 76, "kind": "function", "displayName": "Id", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message id", "ognl": false, "suffix": "}" },
+ "iif(predicate,trueExp,falseExp)": { "index": 77, "kind": "function", "displayName": "If Then Else", "group": "condition", "label": "condition", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Evaluates the predicate and returns the value of trueExp or falseExp. This function is similar to the ternary operator in Java.", "ognl": false, "suffix": "}", "params": [ { "name": "predic [...]
+ "isAlpha(exp)": { "index": 78, "kind": "function", "displayName": "Is Alphabetic Value", "group": "condition", "label": "condition", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether the message body (or expression) is alphabetic value (A..Z). For more advanced checks use the `regex` operator.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object [...]
+ "isAlphaNumeric(exp)": { "index": 79, "kind": "function", "displayName": "Is Alphabetic-Numeric Value", "group": "condition", "label": "condition", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether the message body (or expression) is alphanumeric value (A..Z0-9). For more advanced checks use the `regex` operator.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", [...]
+ "isEmpty(exp)": { "index": 80, "kind": "function", "displayName": "Is Empty", "group": "condition", "label": "condition", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether the message body (or expression) is null or empty (list\/map types are tested if they have 0 elements).", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": fals [...]
+ "isNumeric(exp)": { "index": 81, "kind": "function", "displayName": "Is Numeric Value", "group": "condition", "label": "condition", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether the message body (or expression) is numeric value (0..9). For more advanced checks use the `regex` operator.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", " [...]
+ "jq(input,exp)": { "index": 82, "kind": "function", "displayName": "JQ", "group": "json", "label": "json", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "When working with JSon data, then this allows using the JQ language, for example, to extract data from the message body (in JSon format). This requires having camel-jq JAR on the classpath. For input (optional), you can choose [...]
+ "jsonpath(input,exp)": { "index": 83, "kind": "function", "displayName": "JSonPath", "group": "json", "label": "json", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "When working with JSon data, then this allows using the JSonPath language, for example, to extract data from the message body (in JSon format). This requires having camel-jsonpath JAR on the classpath. For input (op [...]
+ "join(separator,prefix,exp)": { "index": 84, "kind": "function", "displayName": "Join", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The join function iterates the message body\/expression and joins the data into a string. The separator is by default a comma. The prefix is optional. The join uses the message body as source by default. It i [...]
+ "length(exp)": { "index": 85, "kind": "function", "displayName": "Length", "group": "core", "label": "core", "required": false, "javaType": "int", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The payload length (number of bytes) of the message body (or expression).", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expressi [...]
+ "list(val...)": { "index": 86, "kind": "function", "displayName": "Create List of values", "group": "collection", "label": "collection", "required": false, "javaType": "java.util.ArrayList", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The list function creates an ArrayList with the given set of values.", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "Object", "required": true, "description": [...]
+ "listAdd(source,exp)": { "index": 87, "kind": "function", "displayName": "List Add", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Adds the result of the expression to the message body (or expression) which is a list", "ognl": false, "suffix": "}", "params": [ { "name": "source", "javaType": "Object", "required": false, "defaultValue" [...]
+ "listRemove(source,exp)": { "index": 88, "kind": "function", "displayName": "List Remove", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Removes the result of the expression from the message body (or expression) which is a list", "ognl": false, "suffix": "}", "params": [ { "name": "source", "javaType": "Object", "required": false, "de [...]
+ "load(file)": { "index": 89, "kind": "function", "displayName": "Load", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Loads the content of the resource from classpath (cannot load from file-system to avoid dangerous situations).", "ognl": false, "suffix": "}", "params": [ { "name": "file", "javaType": "String", "required": true, "description": [...]
+ "lowercase(exp)": { "index": 90, "kind": "function", "displayName": "Lowercase", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Lowercases the message body (or expression)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expression. When omitted [...]
+ "mandatoryBodyAs(type)": { "index": 91, "kind": "function", "displayName": "Mandatory Body As", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the message body to the given type (classname). If the body is null then the function will fail with an exception", "ognl": true, "suffix": "}", "params": [ { "name": "type", "javaType": "String" [...]
+ "map(key1,value1,...)": { "index": 92, "kind": "function", "displayName": "Create Map of pairs", "group": "collection", "label": "collection", "required": false, "javaType": "java.util.LinkedHashMap", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The map function creates a LinkedHashMap with the given set of pairs.", "ognl": false, "suffix": "}", "params": [ { "name": "key1", "javaType": "Object", "required": true, "d [...]
+ "mapAdd(source,key,exp)": { "index": 93, "kind": "function", "displayName": "Map Add", "group": "collection", "label": "collection", "required": false, "javaType": "Map", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Adds the result of the expression to the message body (or expression) which is a map", "ognl": false, "suffix": "}", "params": [ { "name": "source", "javaType": "Object", "required": false, "defaultValue" [...]
+ "mapRemove(source,key)": { "index": 94, "kind": "function", "displayName": "Map Remove", "group": "collection", "label": "collection", "required": false, "javaType": "Map", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Removes the result of the expression from the message body (or expression) which is a map", "ognl": false, "suffix": "}", "params": [ { "name": "source", "javaType": "Object", "required": false, "defaul [...]
+ "max(val...)": { "index": 95, "kind": "function", "displayName": "Maximum Number", "group": "number", "label": "number", "required": false, "javaType": "long", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the maximum number from all the values (integral numbers only).", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "long", "required": false, "defaultValue": "body", "description": "Val [...]
+ "messageAs(type)": { "index": 96, "kind": "function", "displayName": "Message As", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the message to the given type (classname).", "ognl": true, "suffix": "}", "params": [ { "name": "type", "javaType": "String", "required": true, "description": "The target type classname" } ] },
+ "messageHistory(boolean)": { "index": 97, "kind": "function", "displayName": "Print Message History", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message history of the current exchange (how it has been routed). This is similar to the route stack-trace message history the error handler logs in case of an unhandled exception. The boolean c [...]
+ "messageTimestamp": { "index": 98, "kind": "function", "displayName": "Message Timestamp", "group": "core", "label": "core", "required": false, "javaType": "long", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message timestamp (millis since epoc) that this message originates from. Some systems like JMS, Kafka, AWS have a timestamp on the event\/message that Camel received. This method returns the timestamp if a t [...]
+ "min(val...)": { "index": 99, "kind": "function", "displayName": "Minimum Number", "group": "number", "label": "number", "required": false, "javaType": "long", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the minimum number from all the values (integral numbers only).", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "long", "required": false, "defaultValue": "body", "description": "Val [...]
+ "newEmpty(type)": { "index": 100, "kind": "function", "displayName": "Create Empty Object", "group": "collection", "label": "collection", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Creates a new empty object (decided by type). Use `string` to create an empty String. Use `list` to create an empty `java.util.ArrayList`. Use `map` to create an empty `java.util.LinkedHashMap`. U [...]
+ "normalizeWhitespace(exp)": { "index": 101, "kind": "function", "displayName": "Normalize Whitespace", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Normalizes the whitespace in the message body (or expression) by cleaning up excess whitespaces.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": f [...]
+ "not": { "index": 102, "kind": "function", "displayName": "Not", "group": "condition", "label": "condition", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Evaluates the predicate and returns the opposite.", "ognl": false, "suffix": "}" },
+ "null": { "index": 103, "kind": "function", "displayName": "Null", "group": "other", "label": "other", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a null value", "ognl": false, "suffix": "}", "examples": [ "${null} -> null" ] },
+ "originalBody": { "index": 104, "kind": "function", "displayName": "Original Body", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The original incoming body (only available if allowUseOriginalMessage=true).", "ognl": false, "suffix": "}" },
+ "pad(exp,width,separator)": { "index": 105, "kind": "function", "displayName": "Pad String", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Pads the expression with extra padding if necessary, according the the total width. The separator is by default a space. If the width is negative then padding to the right, otherwise to the left.", "ognl [...]
+ "pretty(exp)": { "index": 106, "kind": "function", "displayName": "Pretty Print", "group": "xml", "label": "json,xml", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the expression to a String, and attempts to pretty print if JSon or XML, otherwise the expression is returned as the String value.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "O [...]
+ "prettyBody": { "index": 107, "kind": "function", "displayName": "Pretty Body", "group": "xml", "label": "json,xml", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the body to a String, and attempts to pretty print if JSon or XML; otherwise the body is returned as the String value.", "ognl": false, "suffix": "}" },
+ "sort(exp,reverse)": { "index": 108, "kind": "function", "displayName": "Sort", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sorts the message body or expression in natural order", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expression [...]
+ "toPrettyJson(exp)": { "index": 109, "kind": "function", "displayName": "To Pretty JSon", "group": "json", "label": "json", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the expression to JSon String representation.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expressio [...]
+ "toPrettyJsonBody": { "index": 110, "kind": "function", "displayName": "To Pretty JSon Body", "group": "json", "label": "json", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the body to JSon String representation.", "ognl": false, "suffix": "}" },
+ "toJson(exp)": { "index": 111, "kind": "function", "displayName": "To JSon", "group": "json", "label": "json", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the expression to JSon String representation.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expression. When omitt [...]
+ "toJsonBody": { "index": 112, "kind": "function", "displayName": "To JSon Body", "group": "json", "label": "json", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the body to JSon String representation.", "ognl": false, "suffix": "}" },
+ "properties:key:default": { "index": 113, "kind": "function", "displayName": "Property Placeholder", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Lookup a property placeholder with the given key. If the key does not exist nor has a value, then an optional default value can be specified.", "ognl": false, "suffix": "}", "params": [ { "name": "ke [...]
+ "propertiesExist:key": { "index": 114, "kind": "function", "displayName": "Property Placeholder Exists", "group": "core", "label": "core", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Checks whether a property placeholder with the given key exists or not. The result can be negated by prefixing the key with !", "ognl": false, "suffix": "}", "params": [ { "name": "key", "javaTy [...]
+ "quote(exp)": { "index": 115, "kind": "function", "displayName": "Quote", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the message body (or expression) as a double quoted string", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expressio [...]
+ "random(min,max)": { "index": 116, "kind": "function", "displayName": "Random", "group": "number", "label": "number", "required": false, "javaType": "int", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a random number between min and max (exclusive)", "ognl": false, "suffix": "}", "params": [ { "name": "min", "javaType": "int", "required": true, "description": "The minimum value (inclusive)" }, { "name": "max" [...]
+ "range(min,max)": { "index": 117, "kind": "function", "displayName": "Range", "group": "number", "label": "number", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a list of increasing integers between the given interval (exclusive)", "ognl": false, "suffix": "}", "params": [ { "name": "min", "javaType": "int", "required": true, "description": "The start value (inclusive)" [...]
+ "ref:name": { "index": 118, "kind": "function", "displayName": "Bean By Id", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "To look up a bean from the Registry with the given name.", "ognl": false, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The bean name in the registry" } ], "examples": [...]
+ "replace(from,to,exp)": { "index": 119, "kind": "function", "displayName": "Replace String Values", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Replace all the string values in the message body\/expression. To make it easier to replace single and double quotes, then you can use XML escaped values `\\"` as double quote, `\\'` as [...]
+ "reverse(val...)": { "index": 120, "kind": "function", "displayName": "Reverse Values", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a list of all the values, but in reverse order", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "Object", "required": false, "defaultValue": "body", "description": "Value [...]
+ "routeGroup": { "index": 121, "kind": "function", "displayName": "Route Group", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The route group of the current route the Exchange is being routed. Not all routes have a group assigned, so this may be null.", "ognl": false, "suffix": "}" },
+ "routeId": { "index": 122, "kind": "function", "displayName": "Route Id", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The route id of the current route the Exchange is being routed", "ognl": false, "suffix": "}", "examples": [ "${routeId} -> myRoute" ] },
+ "safeQuote(exp)": { "index": 123, "kind": "function", "displayName": "Safe Quote", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the message body (or expression) safely quoted if needed", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The ex [...]
+ "setVariable(key,exp)": { "index": 124, "kind": "function", "displayName": "Set Variable", "group": "attachment", "label": "attachment", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets an attachment with payload from the message body\/expression.", "ognl": false, "suffix": "}" },
+ "setHeader(name,type,exp)": { "index": 125, "kind": "function", "displayName": "Set Header", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets a message header with the given expression (optional converting to the given type)", "ognl": false, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "T [...]
+ "setVariable(name,type,exp)": { "index": 126, "kind": "function", "displayName": "Set Variable", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets a variable with the given expression (optional converting to the given type)", "ognl": false, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The [...]
+ "shuffle(val...)": { "index": 127, "kind": "function", "displayName": "Shuffle Values", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a list of all the values shuffled in random order", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "Object", "required": false, "defaultValue": "body", "description": "Va [...]
+ "simpleJsonpath(input,exp)": { "index": 128, "kind": "function", "displayName": "Simple JSonPath", "group": "json", "label": "json", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "When working with JSon data, then this allows using the Simple JSonPath language, for example, to extract data from the message body (in JSon format). For input (optional), you can choose `header:key`, [...]
+ "size(exp)": { "index": 129, "kind": "function", "displayName": "Size", "group": "collection", "label": "collection", "required": false, "javaType": "int", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the number of elements in collection or array based payloads. If the value is null then 0 is returned, otherwise 1.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": [...]
+ "skip(num)": { "index": 130, "kind": "function", "displayName": "Skip First Items from the Message Body", "group": "collection", "label": "collection", "required": false, "javaType": "java.util.Iterator", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The skip function iterates the message body and skips the first number of items. This can be used with the Splitter EIP to split a message body and skip the first N numbe [...]
+ "split(exp,separator)": { "index": 131, "kind": "function", "displayName": "Split String Values", "group": "collection", "label": "collection", "required": false, "javaType": "String[]", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Splits the message body\/expression as a String value using the separator into a String array", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": [...]
+ "stepId": { "index": 132, "kind": "function", "displayName": "Step Id", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the id of the current step the Exchange is being routed.", "ognl": false, "suffix": "}" },
+ "substring(head,tail)": { "index": 133, "kind": "function", "displayName": "Substring", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a substring of the message body\/expression. If only one positive number, then the returned string is clipped from the beginning. If only one negative number, then the returned string is clipped from [...]
+ "substringAfter(exp,before)": { "index": 134, "kind": "function", "displayName": "Substring After", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a substring of the message body\/expression that comes after. Returns null if nothing comes after.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "requi [...]
+ "substringBefore(exp,before)": { "index": 135, "kind": "function", "displayName": "Substring Before", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a substring of the message body\/expression that comes before. Returns null if nothing comes before.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "r [...]
+ "substringBetween(exp,after,before)": { "index": 136, "kind": "function", "displayName": "Substring Between", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a substring of the message body\/expression that are between after and before. Returns null if nothing comes between.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", [...]
+ "sum(val...)": { "index": 137, "kind": "function", "displayName": "Calculate Sum Number", "group": "number", "label": "number", "required": false, "javaType": "long", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sums together all the values as integral numbers. This function can also be used to subtract by using negative numbers.", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "long", "requir [...]
+ "sys.name": { "index": 138, "kind": "function", "displayName": "JVM System Property", "group": "other", "label": "other", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The JVM system property with the given name", "ognl": false, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The system property name" } ], "examples": [ "${sy [...]
+ "threadId": { "index": 139, "kind": "function", "displayName": "Thread Id", "group": "other", "label": "other", "required": false, "javaType": "long", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the id of the current thread. Can be used for logging.", "ognl": false, "suffix": "}" },
+ "threadName": { "index": 140, "kind": "function", "displayName": "Thread Name", "group": "other", "label": "other", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the name of the current thread. Can be used for logging.", "ognl": false, "suffix": "}" },
+ "throwException(type,msg)": { "index": 141, "kind": "function", "displayName": "Throw Exception", "group": "core", "label": "core", "required": false, "javaType": "java.lang.Exception", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Deliberately throws an error. Uses IllegalArgumentException by default if no type is specified (use fully qualified classname).", "ognl": false, "suffix": "}", "params": [ { "name": "type", [...]
+ "trim(exp)": { "index": 142, "kind": "function", "displayName": "Trim", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The trim function trims the message body (or expression) by removing all leading and trailing white spaces.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue" [...]
+ "type:name.field": { "index": 143, "kind": "function", "displayName": "Java Field Value", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "To refer to a type or field by its classname. To refer to a field, you can append .FIELD_NAME. For example, you can refer to the constant field from Exchange as: `org.apache.camel.Exchange.FILE_NAME`", "ognl": [...]
+ "kindOfType(exp)": { "index": 144, "kind": "function", "displayName": "Kind of Type", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "What kind of type is the value (null,number,string,boolean,array,object)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": [...]
+ "unquote(exp)": { "index": 145, "kind": "function", "displayName": "Unquote", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the message body (or expression) with any leading\/ending quotes removed", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "descriptio [...]
+ "uppercase(exp)": { "index": 146, "kind": "function", "displayName": "Uppercase", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Uppercases the message body (or expression)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expression. When omitted [...]
+ "uuid(type)": { "index": 147, "kind": "function", "displayName": "Generate UUID", "group": "other", "label": "other", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a UUID using the Camel `UuidGenerator`. You can choose between `default`, `classic`, `short` and `simple` as the type. If no type is given, the default is used. It is also possible to use a custom `UuidGenera [...]
+ "val(exp)": { "index": 148, "kind": "function", "displayName": "Value", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the expression as a constant value", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": true, "description": "The constant value expression" } ], "examples": [ "${val(42)} -> 42" [...]
+ "variable.name": { "index": 149, "kind": "function", "displayName": "Variable", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The variable with the given name", "ognl": true, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The variable name" } ], "examples": [ "${variable.myVar} -> variable v [...]
+ "variableAs(key,type)": { "index": 150, "kind": "function", "displayName": "Variable As", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the variable to the given type (classname).", "ognl": false, "suffix": "}", "params": [ { "name": "key", "javaType": "String", "required": true, "description": "The variable name" }, { "name": "type", [...]
+ "variables": { "index": 151, "kind": "function", "displayName": "Variables", "group": "core", "label": "core", "required": false, "javaType": "java.util.Map", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns all the variables from the current Exchange in a Map", "ognl": false, "suffix": "}", "examples": [ "${variables} -> {myVar=value1, count=5}" ] },
+ "xpath(input,exp)": { "index": 152, "kind": "function", "displayName": "XPath", "group": "xml", "label": "xml", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "When working with XML data, then this allows using the XPath language, for example, to extract data from the message body (in XML format). This requires having camel-xpath JAR on the classpath. For input (optional), you ca [...]
},
"operators": {
"==": { "index": 0, "kind": "operator", "displayName": "Eq", "label": "binary", "required": false, "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tests equality between left and right operand values. Camel will coerce the right operand type to match the left.", "operatorKind": "binary", "operatorSyntax": "LHS == RHS", "precedence": 10, "examples": [ "${header.foo} == 'bar'", "${header.count} == 5" ] },
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/simple/camel-simple-validator.js b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/simple/camel-simple-validator.js
index 1afe01bfc64b..fedf540459e7 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/simple/camel-simple-validator.js
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/simple/camel-simple-validator.js
@@ -62,6 +62,7 @@ const FUNCTIONS = {
'distinct': true,
'empty': true,
'env': true,
+ 'escape': true,
'exchange': true,
'exchangeId': true,
'exchangeProperty': true,
diff --git a/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/simple/simple.json b/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/simple/simple.json
index 6da75471d8fb..b807033f3f3d 100644
--- a/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/simple/simple.json
+++ b/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/simple/simple.json
@@ -81,102 +81,103 @@
"distinct(val...)": { "index": 53, "kind": "function", "displayName": "Distinct Values", "group": "collection", "label": "collection", "required": false, "javaType": "Set", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a set of all the values with duplicates removed", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "Object", "required": false, "defaultValue": "body", "description": "Valu [...]
"empty(type)": { "index": 54, "kind": "function", "displayName": "Create Empty Object", "group": "collection", "label": "collection", "required": false, "javaType": "Object", "prefix": "${", "deprecated": true, "deprecationNote": "", "autowired": false, "secret": false, "description": "Creates a new empty object (decided by type). Use `string` to create an empty String. Use `list` to create an empty `java.util.ArrayList`. Use `map` to create an empty `java.util.LinkedHashMap`. Use `s [...]
"env.name": { "index": 55, "kind": "function", "displayName": "OS Environment Variable", "group": "other", "label": "other", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The OS environment variable with the given name", "ognl": false, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The environment variable name" } ], "exampl [...]
- "exchange": { "index": 56, "kind": "function", "displayName": "Exchange", "group": "core", "label": "core", "required": false, "javaType": "org.apache.camel.Exchange", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The current exchange", "ognl": true, "suffix": "}" },
- "exchangeId": { "index": 57, "kind": "function", "displayName": "Exchange Id", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exchange id", "ognl": false, "suffix": "}", "examples": [ "${exchangeId} -> ID-myhost-1234-1234567890-0-1" ] },
- "exchangeProperty.name": { "index": 58, "kind": "function", "displayName": "Exchange Property", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exchange property with the given name", "ognl": true, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The exchange property name" } ], "examples": [...]
- "exception": { "index": 59, "kind": "function", "displayName": "Exception", "group": "core", "label": "core", "required": false, "javaType": "java.lang.Exception", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exception object on the exchange (also from caught exceptions), is null if no exception present.", "ognl": true, "suffix": "}" },
- "exception.message": { "index": 60, "kind": "function", "displayName": "Exception Message", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exception message (also from caught exceptions), is null if no exception present.", "ognl": false, "suffix": "}", "examples": [ "${exception.message} -> Connection refused" ] },
- "exception.stackTrace": { "index": 61, "kind": "function", "displayName": "Exception Stacktrace", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exception stacktrace (also from caught exceptions), is null if no exception present.", "ognl": false, "suffix": "}" },
- "filter(exp,fun)": { "index": 62, "kind": "function", "displayName": "Filter Elements", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a List containing the values that satisfy the predicate function (returning true)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultVa [...]
- "forEach(exp,fun)": { "index": 63, "kind": "function", "displayName": "For Each call Function", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a List containing the values returned by the function when applied to each value from the input expression", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Objec [...]
- "floor(exp)": { "index": 64, "kind": "function", "displayName": "Floor Number", "group": "number", "label": "number", "required": false, "javaType": "Integer", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the message body (or expression) to a floating number and return the floor value (rounded down to nearest integer).", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "requir [...]
- "fromRouteId": { "index": 65, "kind": "function", "displayName": "From Route Id", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The original route id where this exchange was created.", "ognl": false, "suffix": "}", "examples": [ "${fromRouteId} -> myRoute" ] },
- "function(name,exp)": { "index": 66, "kind": "function", "displayName": "Invoke Custom Function", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Invokes a custom function with the given name using the message body (or expression) as input parameter.", "ognl": false, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": t [...]
- "hash(exp,algorithm)": { "index": 67, "kind": "function", "displayName": "Compute Hash Value", "group": "other", "label": "other", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a hashed value (string in hex decimal) of the message body\/expression using JDK MessageDigest. The algorithm can be SHA-256 (default) or SHA3-256.", "ognl": false, "suffix": "}", "params": [ { " [...]
- "header.name": { "index": 68, "kind": "function", "displayName": "Header", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message header with the given name", "ognl": true, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The header name" } ], "examples": [ "${header.ContentType} -> applica [...]
- "headerAs(key,type)": { "index": 69, "kind": "function", "displayName": "Header As", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the message header to the given type (classname).", "ognl": false, "suffix": "}", "params": [ { "name": "key", "javaType": "String", "required": true, "description": "The header name" }, { "name": "type", " [...]
- "headers": { "index": 70, "kind": "function", "displayName": "Headers", "group": "core", "label": "core", "required": false, "javaType": "java.util.Map", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns all the message headers in a Map", "ognl": false, "suffix": "}", "examples": [ "${headers} -> {ContentType=application\/json, CamelFileName=data.txt}" ] },
- "hostName": { "index": 71, "kind": "function", "displayName": "Host Name", "group": "other", "label": "other", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the local hostname (may be empty if not possible to resolve).", "ognl": false, "suffix": "}", "examples": [ "${hostName} -> myserver.local" ] },
- "htmlClean(exp)": { "index": 72, "kind": "function", "displayName": "Html Clean", "group": "html", "label": "html", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Cleans the HTML to remove unsafe links and JavaScripts from the message body (or expression)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", [...]
- "htmlDecode(exp)": { "index": 73, "kind": "function", "displayName": "Html Decode", "group": "html", "label": "html", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Decodes the HTML as plain text (removing all HTML tags) that is also suitable as input for AI and LLMs", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultVal [...]
- "htmlParse(exp)": { "index": 74, "kind": "function", "displayName": "Html Parse", "group": "html", "label": "html", "required": false, "javaType": "org.jsoup.nodes.Document", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Parses the HTML as a JSoup object from the message body (or expression)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "d [...]
- "id": { "index": 75, "kind": "function", "displayName": "Id", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message id", "ognl": false, "suffix": "}" },
- "iif(predicate,trueExp,falseExp)": { "index": 76, "kind": "function", "displayName": "If Then Else", "group": "condition", "label": "condition", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Evaluates the predicate and returns the value of trueExp or falseExp. This function is similar to the ternary operator in Java.", "ognl": false, "suffix": "}", "params": [ { "name": "predic [...]
- "isAlpha(exp)": { "index": 77, "kind": "function", "displayName": "Is Alphabetic Value", "group": "condition", "label": "condition", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether the message body (or expression) is alphabetic value (A..Z). For more advanced checks use the `regex` operator.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object [...]
- "isAlphaNumeric(exp)": { "index": 78, "kind": "function", "displayName": "Is Alphabetic-Numeric Value", "group": "condition", "label": "condition", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether the message body (or expression) is alphanumeric value (A..Z0-9). For more advanced checks use the `regex` operator.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", [...]
- "isEmpty(exp)": { "index": 79, "kind": "function", "displayName": "Is Empty", "group": "condition", "label": "condition", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether the message body (or expression) is null or empty (list\/map types are tested if they have 0 elements).", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": fals [...]
- "isNumeric(exp)": { "index": 80, "kind": "function", "displayName": "Is Numeric Value", "group": "condition", "label": "condition", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether the message body (or expression) is numeric value (0..9). For more advanced checks use the `regex` operator.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", " [...]
- "jq(input,exp)": { "index": 81, "kind": "function", "displayName": "JQ", "group": "json", "label": "json", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "When working with JSon data, then this allows using the JQ language, for example, to extract data from the message body (in JSon format). This requires having camel-jq JAR on the classpath. For input (optional), you can choose [...]
- "jsonpath(input,exp)": { "index": 82, "kind": "function", "displayName": "JSonPath", "group": "json", "label": "json", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "When working with JSon data, then this allows using the JSonPath language, for example, to extract data from the message body (in JSon format). This requires having camel-jsonpath JAR on the classpath. For input (op [...]
- "join(separator,prefix,exp)": { "index": 83, "kind": "function", "displayName": "Join", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The join function iterates the message body\/expression and joins the data into a string. The separator is by default a comma. The prefix is optional. The join uses the message body as source by default. It i [...]
- "length(exp)": { "index": 84, "kind": "function", "displayName": "Length", "group": "core", "label": "core", "required": false, "javaType": "int", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The payload length (number of bytes) of the message body (or expression).", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expressi [...]
- "list(val...)": { "index": 85, "kind": "function", "displayName": "Create List of values", "group": "collection", "label": "collection", "required": false, "javaType": "java.util.ArrayList", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The list function creates an ArrayList with the given set of values.", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "Object", "required": true, "description": [...]
- "listAdd(source,exp)": { "index": 86, "kind": "function", "displayName": "List Add", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Adds the result of the expression to the message body (or expression) which is a list", "ognl": false, "suffix": "}", "params": [ { "name": "source", "javaType": "Object", "required": false, "defaultValue" [...]
- "listRemove(source,exp)": { "index": 87, "kind": "function", "displayName": "List Remove", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Removes the result of the expression from the message body (or expression) which is a list", "ognl": false, "suffix": "}", "params": [ { "name": "source", "javaType": "Object", "required": false, "de [...]
- "load(file)": { "index": 88, "kind": "function", "displayName": "Load", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Loads the content of the resource from classpath (cannot load from file-system to avoid dangerous situations).", "ognl": false, "suffix": "}", "params": [ { "name": "file", "javaType": "String", "required": true, "description": [...]
- "lowercase(exp)": { "index": 89, "kind": "function", "displayName": "Lowercase", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Lowercases the message body (or expression)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expression. When omitted [...]
- "mandatoryBodyAs(type)": { "index": 90, "kind": "function", "displayName": "Mandatory Body As", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the message body to the given type (classname). If the body is null then the function will fail with an exception", "ognl": true, "suffix": "}", "params": [ { "name": "type", "javaType": "String" [...]
- "map(key1,value1,...)": { "index": 91, "kind": "function", "displayName": "Create Map of pairs", "group": "collection", "label": "collection", "required": false, "javaType": "java.util.LinkedHashMap", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The map function creates a LinkedHashMap with the given set of pairs.", "ognl": false, "suffix": "}", "params": [ { "name": "key1", "javaType": "Object", "required": true, "d [...]
- "mapAdd(source,key,exp)": { "index": 92, "kind": "function", "displayName": "Map Add", "group": "collection", "label": "collection", "required": false, "javaType": "Map", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Adds the result of the expression to the message body (or expression) which is a map", "ognl": false, "suffix": "}", "params": [ { "name": "source", "javaType": "Object", "required": false, "defaultValue" [...]
- "mapRemove(source,key)": { "index": 93, "kind": "function", "displayName": "Map Remove", "group": "collection", "label": "collection", "required": false, "javaType": "Map", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Removes the result of the expression from the message body (or expression) which is a map", "ognl": false, "suffix": "}", "params": [ { "name": "source", "javaType": "Object", "required": false, "defaul [...]
- "max(val...)": { "index": 94, "kind": "function", "displayName": "Maximum Number", "group": "number", "label": "number", "required": false, "javaType": "long", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the maximum number from all the values (integral numbers only).", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "long", "required": false, "defaultValue": "body", "description": "Val [...]
- "messageAs(type)": { "index": 95, "kind": "function", "displayName": "Message As", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the message to the given type (classname).", "ognl": true, "suffix": "}", "params": [ { "name": "type", "javaType": "String", "required": true, "description": "The target type classname" } ] },
- "messageHistory(boolean)": { "index": 96, "kind": "function", "displayName": "Print Message History", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message history of the current exchange (how it has been routed). This is similar to the route stack-trace message history the error handler logs in case of an unhandled exception. The boolean c [...]
- "messageTimestamp": { "index": 97, "kind": "function", "displayName": "Message Timestamp", "group": "core", "label": "core", "required": false, "javaType": "long", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message timestamp (millis since epoc) that this message originates from. Some systems like JMS, Kafka, AWS have a timestamp on the event\/message that Camel received. This method returns the timestamp if a t [...]
- "min(val...)": { "index": 98, "kind": "function", "displayName": "Minimum Number", "group": "number", "label": "number", "required": false, "javaType": "long", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the minimum number from all the values (integral numbers only).", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "long", "required": false, "defaultValue": "body", "description": "Val [...]
- "newEmpty(type)": { "index": 99, "kind": "function", "displayName": "Create Empty Object", "group": "collection", "label": "collection", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Creates a new empty object (decided by type). Use `string` to create an empty String. Use `list` to create an empty `java.util.ArrayList`. Use `map` to create an empty `java.util.LinkedHashMap`. Us [...]
- "normalizeWhitespace(exp)": { "index": 100, "kind": "function", "displayName": "Normalize Whitespace", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Normalizes the whitespace in the message body (or expression) by cleaning up excess whitespaces.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": f [...]
- "not": { "index": 101, "kind": "function", "displayName": "Not", "group": "condition", "label": "condition", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Evaluates the predicate and returns the opposite.", "ognl": false, "suffix": "}" },
- "null": { "index": 102, "kind": "function", "displayName": "Null", "group": "other", "label": "other", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a null value", "ognl": false, "suffix": "}", "examples": [ "${null} -> null" ] },
- "originalBody": { "index": 103, "kind": "function", "displayName": "Original Body", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The original incoming body (only available if allowUseOriginalMessage=true).", "ognl": false, "suffix": "}" },
- "pad(exp,width,separator)": { "index": 104, "kind": "function", "displayName": "Pad String", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Pads the expression with extra padding if necessary, according the the total width. The separator is by default a space. If the width is negative then padding to the right, otherwise to the left.", "ognl [...]
- "pretty(exp)": { "index": 105, "kind": "function", "displayName": "Pretty Print", "group": "xml", "label": "json,xml", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the expression to a String, and attempts to pretty print if JSon or XML, otherwise the expression is returned as the String value.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "O [...]
- "prettyBody": { "index": 106, "kind": "function", "displayName": "Pretty Body", "group": "xml", "label": "json,xml", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the body to a String, and attempts to pretty print if JSon or XML; otherwise the body is returned as the String value.", "ognl": false, "suffix": "}" },
- "sort(exp,reverse)": { "index": 107, "kind": "function", "displayName": "Sort", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sorts the message body or expression in natural order", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expression [...]
- "toPrettyJson(exp)": { "index": 108, "kind": "function", "displayName": "To Pretty JSon", "group": "json", "label": "json", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the expression to JSon String representation.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expressio [...]
- "toPrettyJsonBody": { "index": 109, "kind": "function", "displayName": "To Pretty JSon Body", "group": "json", "label": "json", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the body to JSon String representation.", "ognl": false, "suffix": "}" },
- "toJson(exp)": { "index": 110, "kind": "function", "displayName": "To JSon", "group": "json", "label": "json", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the expression to JSon String representation.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expression. When omitt [...]
- "toJsonBody": { "index": 111, "kind": "function", "displayName": "To JSon Body", "group": "json", "label": "json", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the body to JSon String representation.", "ognl": false, "suffix": "}" },
- "properties:key:default": { "index": 112, "kind": "function", "displayName": "Property Placeholder", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Lookup a property placeholder with the given key. If the key does not exist nor has a value, then an optional default value can be specified.", "ognl": false, "suffix": "}", "params": [ { "name": "ke [...]
- "propertiesExist:key": { "index": 113, "kind": "function", "displayName": "Property Placeholder Exists", "group": "core", "label": "core", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Checks whether a property placeholder with the given key exists or not. The result can be negated by prefixing the key with !", "ognl": false, "suffix": "}", "params": [ { "name": "key", "javaTy [...]
- "quote(exp)": { "index": 114, "kind": "function", "displayName": "Quote", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the message body (or expression) as a double quoted string", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expressio [...]
- "random(min,max)": { "index": 115, "kind": "function", "displayName": "Random", "group": "number", "label": "number", "required": false, "javaType": "int", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a random number between min and max (exclusive)", "ognl": false, "suffix": "}", "params": [ { "name": "min", "javaType": "int", "required": true, "description": "The minimum value (inclusive)" }, { "name": "max" [...]
- "range(min,max)": { "index": 116, "kind": "function", "displayName": "Range", "group": "number", "label": "number", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a list of increasing integers between the given interval (exclusive)", "ognl": false, "suffix": "}", "params": [ { "name": "min", "javaType": "int", "required": true, "description": "The start value (inclusive)" [...]
- "ref:name": { "index": 117, "kind": "function", "displayName": "Bean By Id", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "To look up a bean from the Registry with the given name.", "ognl": false, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The bean name in the registry" } ], "examples": [...]
- "replace(from,to,exp)": { "index": 118, "kind": "function", "displayName": "Replace String Values", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Replace all the string values in the message body\/expression. To make it easier to replace single and double quotes, then you can use XML escaped values `\\"` as double quote, `\\'` as [...]
- "reverse(val...)": { "index": 119, "kind": "function", "displayName": "Reverse Values", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a list of all the values, but in reverse order", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "Object", "required": false, "defaultValue": "body", "description": "Value [...]
- "routeGroup": { "index": 120, "kind": "function", "displayName": "Route Group", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The route group of the current route the Exchange is being routed. Not all routes have a group assigned, so this may be null.", "ognl": false, "suffix": "}" },
- "routeId": { "index": 121, "kind": "function", "displayName": "Route Id", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The route id of the current route the Exchange is being routed", "ognl": false, "suffix": "}", "examples": [ "${routeId} -> myRoute" ] },
- "safeQuote(exp)": { "index": 122, "kind": "function", "displayName": "Safe Quote", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the message body (or expression) safely quoted if needed", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The ex [...]
- "setVariable(key,exp)": { "index": 123, "kind": "function", "displayName": "Set Variable", "group": "attachment", "label": "attachment", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets an attachment with payload from the message body\/expression.", "ognl": false, "suffix": "}" },
- "setHeader(name,type,exp)": { "index": 124, "kind": "function", "displayName": "Set Header", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets a message header with the given expression (optional converting to the given type)", "ognl": false, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "T [...]
- "setVariable(name,type,exp)": { "index": 125, "kind": "function", "displayName": "Set Variable", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets a variable with the given expression (optional converting to the given type)", "ognl": false, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The [...]
- "shuffle(val...)": { "index": 126, "kind": "function", "displayName": "Shuffle Values", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a list of all the values shuffled in random order", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "Object", "required": false, "defaultValue": "body", "description": "Va [...]
- "simpleJsonpath(input,exp)": { "index": 127, "kind": "function", "displayName": "Simple JSonPath", "group": "json", "label": "json", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "When working with JSon data, then this allows using the Simple JSonPath language, for example, to extract data from the message body (in JSon format). For input (optional), you can choose `header:key`, [...]
- "size(exp)": { "index": 128, "kind": "function", "displayName": "Size", "group": "collection", "label": "collection", "required": false, "javaType": "int", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the number of elements in collection or array based payloads. If the value is null then 0 is returned, otherwise 1.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": [...]
- "skip(num)": { "index": 129, "kind": "function", "displayName": "Skip First Items from the Message Body", "group": "collection", "label": "collection", "required": false, "javaType": "java.util.Iterator", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The skip function iterates the message body and skips the first number of items. This can be used with the Splitter EIP to split a message body and skip the first N numbe [...]
- "split(exp,separator)": { "index": 130, "kind": "function", "displayName": "Split String Values", "group": "collection", "label": "collection", "required": false, "javaType": "String[]", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Splits the message body\/expression as a String value using the separator into a String array", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": [...]
- "stepId": { "index": 131, "kind": "function", "displayName": "Step Id", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the id of the current step the Exchange is being routed.", "ognl": false, "suffix": "}" },
- "substring(head,tail)": { "index": 132, "kind": "function", "displayName": "Substring", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a substring of the message body\/expression. If only one positive number, then the returned string is clipped from the beginning. If only one negative number, then the returned string is clipped from [...]
- "substringAfter(exp,before)": { "index": 133, "kind": "function", "displayName": "Substring After", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a substring of the message body\/expression that comes after. Returns null if nothing comes after.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "requi [...]
- "substringBefore(exp,before)": { "index": 134, "kind": "function", "displayName": "Substring Before", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a substring of the message body\/expression that comes before. Returns null if nothing comes before.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "r [...]
- "substringBetween(exp,after,before)": { "index": 135, "kind": "function", "displayName": "Substring Between", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a substring of the message body\/expression that are between after and before. Returns null if nothing comes between.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", [...]
- "sum(val...)": { "index": 136, "kind": "function", "displayName": "Calculate Sum Number", "group": "number", "label": "number", "required": false, "javaType": "long", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sums together all the values as integral numbers. This function can also be used to subtract by using negative numbers.", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "long", "requir [...]
- "sys.name": { "index": 137, "kind": "function", "displayName": "JVM System Property", "group": "other", "label": "other", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The JVM system property with the given name", "ognl": false, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The system property name" } ], "examples": [ "${sy [...]
- "threadId": { "index": 138, "kind": "function", "displayName": "Thread Id", "group": "other", "label": "other", "required": false, "javaType": "long", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the id of the current thread. Can be used for logging.", "ognl": false, "suffix": "}" },
- "threadName": { "index": 139, "kind": "function", "displayName": "Thread Name", "group": "other", "label": "other", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the name of the current thread. Can be used for logging.", "ognl": false, "suffix": "}" },
- "throwException(type,msg)": { "index": 140, "kind": "function", "displayName": "Throw Exception", "group": "core", "label": "core", "required": false, "javaType": "java.lang.Exception", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Deliberately throws an error. Uses IllegalArgumentException by default if no type is specified (use fully qualified classname).", "ognl": false, "suffix": "}", "params": [ { "name": "type", [...]
- "trim(exp)": { "index": 141, "kind": "function", "displayName": "Trim", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The trim function trims the message body (or expression) by removing all leading and trailing white spaces.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue" [...]
- "type:name.field": { "index": 142, "kind": "function", "displayName": "Java Field Value", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "To refer to a type or field by its classname. To refer to a field, you can append .FIELD_NAME. For example, you can refer to the constant field from Exchange as: `org.apache.camel.Exchange.FILE_NAME`", "ognl": [...]
- "kindOfType(exp)": { "index": 143, "kind": "function", "displayName": "Kind of Type", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "What kind of type is the value (null,number,string,boolean,array,object)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": [...]
- "unquote(exp)": { "index": 144, "kind": "function", "displayName": "Unquote", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the message body (or expression) with any leading\/ending quotes removed", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "descriptio [...]
- "uppercase(exp)": { "index": 145, "kind": "function", "displayName": "Uppercase", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Uppercases the message body (or expression)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expression. When omitted [...]
- "uuid(type)": { "index": 146, "kind": "function", "displayName": "Generate UUID", "group": "other", "label": "other", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a UUID using the Camel `UuidGenerator`. You can choose between `default`, `classic`, `short` and `simple` as the type. If no type is given, the default is used. It is also possible to use a custom `UuidGenera [...]
- "val(exp)": { "index": 147, "kind": "function", "displayName": "Value", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the expression as a constant value", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": true, "description": "The constant value expression" } ], "examples": [ "${val(42)} -> 42" [...]
- "variable.name": { "index": 148, "kind": "function", "displayName": "Variable", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The variable with the given name", "ognl": true, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The variable name" } ], "examples": [ "${variable.myVar} -> variable v [...]
- "variableAs(key,type)": { "index": 149, "kind": "function", "displayName": "Variable As", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the variable to the given type (classname).", "ognl": false, "suffix": "}", "params": [ { "name": "key", "javaType": "String", "required": true, "description": "The variable name" }, { "name": "type", [...]
- "variables": { "index": 150, "kind": "function", "displayName": "Variables", "group": "core", "label": "core", "required": false, "javaType": "java.util.Map", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns all the variables from the current Exchange in a Map", "ognl": false, "suffix": "}", "examples": [ "${variables} -> {myVar=value1, count=5}" ] },
- "xpath(input,exp)": { "index": 151, "kind": "function", "displayName": "XPath", "group": "xml", "label": "xml", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "When working with XML data, then this allows using the XPath language, for example, to extract data from the message body (in XML format). This requires having camel-xpath JAR on the classpath. For input (optional), you ca [...]
+ "escape(kind,exp)": { "index": 56, "kind": "function", "displayName": "Escape Special Characters", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Escapes special characters in the message body (or expression) so the value can be safely embedded in HTML, XML, JSON, JavaScript, SQL, or a URL. The kind is one of: html, xml, json, js, sql, url." [...]
+ "exchange": { "index": 57, "kind": "function", "displayName": "Exchange", "group": "core", "label": "core", "required": false, "javaType": "org.apache.camel.Exchange", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The current exchange", "ognl": true, "suffix": "}" },
+ "exchangeId": { "index": 58, "kind": "function", "displayName": "Exchange Id", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exchange id", "ognl": false, "suffix": "}", "examples": [ "${exchangeId} -> ID-myhost-1234-1234567890-0-1" ] },
+ "exchangeProperty.name": { "index": 59, "kind": "function", "displayName": "Exchange Property", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exchange property with the given name", "ognl": true, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The exchange property name" } ], "examples": [...]
+ "exception": { "index": 60, "kind": "function", "displayName": "Exception", "group": "core", "label": "core", "required": false, "javaType": "java.lang.Exception", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exception object on the exchange (also from caught exceptions), is null if no exception present.", "ognl": true, "suffix": "}" },
+ "exception.message": { "index": 61, "kind": "function", "displayName": "Exception Message", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exception message (also from caught exceptions), is null if no exception present.", "ognl": false, "suffix": "}", "examples": [ "${exception.message} -> Connection refused" ] },
+ "exception.stackTrace": { "index": 62, "kind": "function", "displayName": "Exception Stacktrace", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exception stacktrace (also from caught exceptions), is null if no exception present.", "ognl": false, "suffix": "}" },
+ "filter(exp,fun)": { "index": 63, "kind": "function", "displayName": "Filter Elements", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a List containing the values that satisfy the predicate function (returning true)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultVa [...]
+ "forEach(exp,fun)": { "index": 64, "kind": "function", "displayName": "For Each call Function", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a List containing the values returned by the function when applied to each value from the input expression", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Objec [...]
+ "floor(exp)": { "index": 65, "kind": "function", "displayName": "Floor Number", "group": "number", "label": "number", "required": false, "javaType": "Integer", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the message body (or expression) to a floating number and return the floor value (rounded down to nearest integer).", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "requir [...]
+ "fromRouteId": { "index": 66, "kind": "function", "displayName": "From Route Id", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The original route id where this exchange was created.", "ognl": false, "suffix": "}", "examples": [ "${fromRouteId} -> myRoute" ] },
+ "function(name,exp)": { "index": 67, "kind": "function", "displayName": "Invoke Custom Function", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Invokes a custom function with the given name using the message body (or expression) as input parameter.", "ognl": false, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": t [...]
+ "hash(exp,algorithm)": { "index": 68, "kind": "function", "displayName": "Compute Hash Value", "group": "other", "label": "other", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a hashed value (string in hex decimal) of the message body\/expression using JDK MessageDigest. The algorithm can be SHA-256 (default) or SHA3-256.", "ognl": false, "suffix": "}", "params": [ { " [...]
+ "header.name": { "index": 69, "kind": "function", "displayName": "Header", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message header with the given name", "ognl": true, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The header name" } ], "examples": [ "${header.ContentType} -> applica [...]
+ "headerAs(key,type)": { "index": 70, "kind": "function", "displayName": "Header As", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the message header to the given type (classname).", "ognl": false, "suffix": "}", "params": [ { "name": "key", "javaType": "String", "required": true, "description": "The header name" }, { "name": "type", " [...]
+ "headers": { "index": 71, "kind": "function", "displayName": "Headers", "group": "core", "label": "core", "required": false, "javaType": "java.util.Map", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns all the message headers in a Map", "ognl": false, "suffix": "}", "examples": [ "${headers} -> {ContentType=application\/json, CamelFileName=data.txt}" ] },
+ "hostName": { "index": 72, "kind": "function", "displayName": "Host Name", "group": "other", "label": "other", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the local hostname (may be empty if not possible to resolve).", "ognl": false, "suffix": "}", "examples": [ "${hostName} -> myserver.local" ] },
+ "htmlClean(exp)": { "index": 73, "kind": "function", "displayName": "Html Clean", "group": "html", "label": "html", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Cleans the HTML to remove unsafe links and JavaScripts from the message body (or expression)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", [...]
+ "htmlDecode(exp)": { "index": 74, "kind": "function", "displayName": "Html Decode", "group": "html", "label": "html", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Decodes the HTML as plain text (removing all HTML tags) that is also suitable as input for AI and LLMs", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultVal [...]
+ "htmlParse(exp)": { "index": 75, "kind": "function", "displayName": "Html Parse", "group": "html", "label": "html", "required": false, "javaType": "org.jsoup.nodes.Document", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Parses the HTML as a JSoup object from the message body (or expression)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "d [...]
+ "id": { "index": 76, "kind": "function", "displayName": "Id", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message id", "ognl": false, "suffix": "}" },
+ "iif(predicate,trueExp,falseExp)": { "index": 77, "kind": "function", "displayName": "If Then Else", "group": "condition", "label": "condition", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Evaluates the predicate and returns the value of trueExp or falseExp. This function is similar to the ternary operator in Java.", "ognl": false, "suffix": "}", "params": [ { "name": "predic [...]
+ "isAlpha(exp)": { "index": 78, "kind": "function", "displayName": "Is Alphabetic Value", "group": "condition", "label": "condition", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether the message body (or expression) is alphabetic value (A..Z). For more advanced checks use the `regex` operator.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object [...]
+ "isAlphaNumeric(exp)": { "index": 79, "kind": "function", "displayName": "Is Alphabetic-Numeric Value", "group": "condition", "label": "condition", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether the message body (or expression) is alphanumeric value (A..Z0-9). For more advanced checks use the `regex` operator.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", [...]
+ "isEmpty(exp)": { "index": 80, "kind": "function", "displayName": "Is Empty", "group": "condition", "label": "condition", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether the message body (or expression) is null or empty (list\/map types are tested if they have 0 elements).", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": fals [...]
+ "isNumeric(exp)": { "index": 81, "kind": "function", "displayName": "Is Numeric Value", "group": "condition", "label": "condition", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether the message body (or expression) is numeric value (0..9). For more advanced checks use the `regex` operator.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", " [...]
+ "jq(input,exp)": { "index": 82, "kind": "function", "displayName": "JQ", "group": "json", "label": "json", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "When working with JSon data, then this allows using the JQ language, for example, to extract data from the message body (in JSon format). This requires having camel-jq JAR on the classpath. For input (optional), you can choose [...]
+ "jsonpath(input,exp)": { "index": 83, "kind": "function", "displayName": "JSonPath", "group": "json", "label": "json", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "When working with JSon data, then this allows using the JSonPath language, for example, to extract data from the message body (in JSon format). This requires having camel-jsonpath JAR on the classpath. For input (op [...]
+ "join(separator,prefix,exp)": { "index": 84, "kind": "function", "displayName": "Join", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The join function iterates the message body\/expression and joins the data into a string. The separator is by default a comma. The prefix is optional. The join uses the message body as source by default. It i [...]
+ "length(exp)": { "index": 85, "kind": "function", "displayName": "Length", "group": "core", "label": "core", "required": false, "javaType": "int", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The payload length (number of bytes) of the message body (or expression).", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expressi [...]
+ "list(val...)": { "index": 86, "kind": "function", "displayName": "Create List of values", "group": "collection", "label": "collection", "required": false, "javaType": "java.util.ArrayList", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The list function creates an ArrayList with the given set of values.", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "Object", "required": true, "description": [...]
+ "listAdd(source,exp)": { "index": 87, "kind": "function", "displayName": "List Add", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Adds the result of the expression to the message body (or expression) which is a list", "ognl": false, "suffix": "}", "params": [ { "name": "source", "javaType": "Object", "required": false, "defaultValue" [...]
+ "listRemove(source,exp)": { "index": 88, "kind": "function", "displayName": "List Remove", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Removes the result of the expression from the message body (or expression) which is a list", "ognl": false, "suffix": "}", "params": [ { "name": "source", "javaType": "Object", "required": false, "de [...]
+ "load(file)": { "index": 89, "kind": "function", "displayName": "Load", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Loads the content of the resource from classpath (cannot load from file-system to avoid dangerous situations).", "ognl": false, "suffix": "}", "params": [ { "name": "file", "javaType": "String", "required": true, "description": [...]
+ "lowercase(exp)": { "index": 90, "kind": "function", "displayName": "Lowercase", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Lowercases the message body (or expression)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expression. When omitted [...]
+ "mandatoryBodyAs(type)": { "index": 91, "kind": "function", "displayName": "Mandatory Body As", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the message body to the given type (classname). If the body is null then the function will fail with an exception", "ognl": true, "suffix": "}", "params": [ { "name": "type", "javaType": "String" [...]
+ "map(key1,value1,...)": { "index": 92, "kind": "function", "displayName": "Create Map of pairs", "group": "collection", "label": "collection", "required": false, "javaType": "java.util.LinkedHashMap", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The map function creates a LinkedHashMap with the given set of pairs.", "ognl": false, "suffix": "}", "params": [ { "name": "key1", "javaType": "Object", "required": true, "d [...]
+ "mapAdd(source,key,exp)": { "index": 93, "kind": "function", "displayName": "Map Add", "group": "collection", "label": "collection", "required": false, "javaType": "Map", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Adds the result of the expression to the message body (or expression) which is a map", "ognl": false, "suffix": "}", "params": [ { "name": "source", "javaType": "Object", "required": false, "defaultValue" [...]
+ "mapRemove(source,key)": { "index": 94, "kind": "function", "displayName": "Map Remove", "group": "collection", "label": "collection", "required": false, "javaType": "Map", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Removes the result of the expression from the message body (or expression) which is a map", "ognl": false, "suffix": "}", "params": [ { "name": "source", "javaType": "Object", "required": false, "defaul [...]
+ "max(val...)": { "index": 95, "kind": "function", "displayName": "Maximum Number", "group": "number", "label": "number", "required": false, "javaType": "long", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the maximum number from all the values (integral numbers only).", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "long", "required": false, "defaultValue": "body", "description": "Val [...]
+ "messageAs(type)": { "index": 96, "kind": "function", "displayName": "Message As", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the message to the given type (classname).", "ognl": true, "suffix": "}", "params": [ { "name": "type", "javaType": "String", "required": true, "description": "The target type classname" } ] },
+ "messageHistory(boolean)": { "index": 97, "kind": "function", "displayName": "Print Message History", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message history of the current exchange (how it has been routed). This is similar to the route stack-trace message history the error handler logs in case of an unhandled exception. The boolean c [...]
+ "messageTimestamp": { "index": 98, "kind": "function", "displayName": "Message Timestamp", "group": "core", "label": "core", "required": false, "javaType": "long", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message timestamp (millis since epoc) that this message originates from. Some systems like JMS, Kafka, AWS have a timestamp on the event\/message that Camel received. This method returns the timestamp if a t [...]
+ "min(val...)": { "index": 99, "kind": "function", "displayName": "Minimum Number", "group": "number", "label": "number", "required": false, "javaType": "long", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the minimum number from all the values (integral numbers only).", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "long", "required": false, "defaultValue": "body", "description": "Val [...]
+ "newEmpty(type)": { "index": 100, "kind": "function", "displayName": "Create Empty Object", "group": "collection", "label": "collection", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Creates a new empty object (decided by type). Use `string` to create an empty String. Use `list` to create an empty `java.util.ArrayList`. Use `map` to create an empty `java.util.LinkedHashMap`. U [...]
+ "normalizeWhitespace(exp)": { "index": 101, "kind": "function", "displayName": "Normalize Whitespace", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Normalizes the whitespace in the message body (or expression) by cleaning up excess whitespaces.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": f [...]
+ "not": { "index": 102, "kind": "function", "displayName": "Not", "group": "condition", "label": "condition", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Evaluates the predicate and returns the opposite.", "ognl": false, "suffix": "}" },
+ "null": { "index": 103, "kind": "function", "displayName": "Null", "group": "other", "label": "other", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a null value", "ognl": false, "suffix": "}", "examples": [ "${null} -> null" ] },
+ "originalBody": { "index": 104, "kind": "function", "displayName": "Original Body", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The original incoming body (only available if allowUseOriginalMessage=true).", "ognl": false, "suffix": "}" },
+ "pad(exp,width,separator)": { "index": 105, "kind": "function", "displayName": "Pad String", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Pads the expression with extra padding if necessary, according the the total width. The separator is by default a space. If the width is negative then padding to the right, otherwise to the left.", "ognl [...]
+ "pretty(exp)": { "index": 106, "kind": "function", "displayName": "Pretty Print", "group": "xml", "label": "json,xml", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the expression to a String, and attempts to pretty print if JSon or XML, otherwise the expression is returned as the String value.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "O [...]
+ "prettyBody": { "index": 107, "kind": "function", "displayName": "Pretty Body", "group": "xml", "label": "json,xml", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the body to a String, and attempts to pretty print if JSon or XML; otherwise the body is returned as the String value.", "ognl": false, "suffix": "}" },
+ "sort(exp,reverse)": { "index": 108, "kind": "function", "displayName": "Sort", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sorts the message body or expression in natural order", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expression [...]
+ "toPrettyJson(exp)": { "index": 109, "kind": "function", "displayName": "To Pretty JSon", "group": "json", "label": "json", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the expression to JSon String representation.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expressio [...]
+ "toPrettyJsonBody": { "index": 110, "kind": "function", "displayName": "To Pretty JSon Body", "group": "json", "label": "json", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the body to JSon String representation.", "ognl": false, "suffix": "}" },
+ "toJson(exp)": { "index": 111, "kind": "function", "displayName": "To JSon", "group": "json", "label": "json", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the expression to JSon String representation.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expression. When omitt [...]
+ "toJsonBody": { "index": 112, "kind": "function", "displayName": "To JSon Body", "group": "json", "label": "json", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the body to JSon String representation.", "ognl": false, "suffix": "}" },
+ "properties:key:default": { "index": 113, "kind": "function", "displayName": "Property Placeholder", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Lookup a property placeholder with the given key. If the key does not exist nor has a value, then an optional default value can be specified.", "ognl": false, "suffix": "}", "params": [ { "name": "ke [...]
+ "propertiesExist:key": { "index": 114, "kind": "function", "displayName": "Property Placeholder Exists", "group": "core", "label": "core", "required": false, "javaType": "boolean", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Checks whether a property placeholder with the given key exists or not. The result can be negated by prefixing the key with !", "ognl": false, "suffix": "}", "params": [ { "name": "key", "javaTy [...]
+ "quote(exp)": { "index": 115, "kind": "function", "displayName": "Quote", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the message body (or expression) as a double quoted string", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expressio [...]
+ "random(min,max)": { "index": 116, "kind": "function", "displayName": "Random", "group": "number", "label": "number", "required": false, "javaType": "int", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a random number between min and max (exclusive)", "ognl": false, "suffix": "}", "params": [ { "name": "min", "javaType": "int", "required": true, "description": "The minimum value (inclusive)" }, { "name": "max" [...]
+ "range(min,max)": { "index": 117, "kind": "function", "displayName": "Range", "group": "number", "label": "number", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a list of increasing integers between the given interval (exclusive)", "ognl": false, "suffix": "}", "params": [ { "name": "min", "javaType": "int", "required": true, "description": "The start value (inclusive)" [...]
+ "ref:name": { "index": 118, "kind": "function", "displayName": "Bean By Id", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "To look up a bean from the Registry with the given name.", "ognl": false, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The bean name in the registry" } ], "examples": [...]
+ "replace(from,to,exp)": { "index": 119, "kind": "function", "displayName": "Replace String Values", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Replace all the string values in the message body\/expression. To make it easier to replace single and double quotes, then you can use XML escaped values `\\"` as double quote, `\\'` as [...]
+ "reverse(val...)": { "index": 120, "kind": "function", "displayName": "Reverse Values", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a list of all the values, but in reverse order", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "Object", "required": false, "defaultValue": "body", "description": "Value [...]
+ "routeGroup": { "index": 121, "kind": "function", "displayName": "Route Group", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The route group of the current route the Exchange is being routed. Not all routes have a group assigned, so this may be null.", "ognl": false, "suffix": "}" },
+ "routeId": { "index": 122, "kind": "function", "displayName": "Route Id", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The route id of the current route the Exchange is being routed", "ognl": false, "suffix": "}", "examples": [ "${routeId} -> myRoute" ] },
+ "safeQuote(exp)": { "index": 123, "kind": "function", "displayName": "Safe Quote", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the message body (or expression) safely quoted if needed", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The ex [...]
+ "setVariable(key,exp)": { "index": 124, "kind": "function", "displayName": "Set Variable", "group": "attachment", "label": "attachment", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets an attachment with payload from the message body\/expression.", "ognl": false, "suffix": "}" },
+ "setHeader(name,type,exp)": { "index": 125, "kind": "function", "displayName": "Set Header", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets a message header with the given expression (optional converting to the given type)", "ognl": false, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "T [...]
+ "setVariable(name,type,exp)": { "index": 126, "kind": "function", "displayName": "Set Variable", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets a variable with the given expression (optional converting to the given type)", "ognl": false, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The [...]
+ "shuffle(val...)": { "index": 127, "kind": "function", "displayName": "Shuffle Values", "group": "collection", "label": "collection", "required": false, "javaType": "List", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a list of all the values shuffled in random order", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "Object", "required": false, "defaultValue": "body", "description": "Va [...]
+ "simpleJsonpath(input,exp)": { "index": 128, "kind": "function", "displayName": "Simple JSonPath", "group": "json", "label": "json", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "When working with JSon data, then this allows using the Simple JSonPath language, for example, to extract data from the message body (in JSon format). For input (optional), you can choose `header:key`, [...]
+ "size(exp)": { "index": 129, "kind": "function", "displayName": "Size", "group": "collection", "label": "collection", "required": false, "javaType": "int", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the number of elements in collection or array based payloads. If the value is null then 0 is returned, otherwise 1.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": [...]
+ "skip(num)": { "index": 130, "kind": "function", "displayName": "Skip First Items from the Message Body", "group": "collection", "label": "collection", "required": false, "javaType": "java.util.Iterator", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The skip function iterates the message body and skips the first number of items. This can be used with the Splitter EIP to split a message body and skip the first N numbe [...]
+ "split(exp,separator)": { "index": 131, "kind": "function", "displayName": "Split String Values", "group": "collection", "label": "collection", "required": false, "javaType": "String[]", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Splits the message body\/expression as a String value using the separator into a String array", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": [...]
+ "stepId": { "index": 132, "kind": "function", "displayName": "Step Id", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the id of the current step the Exchange is being routed.", "ognl": false, "suffix": "}" },
+ "substring(head,tail)": { "index": 133, "kind": "function", "displayName": "Substring", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a substring of the message body\/expression. If only one positive number, then the returned string is clipped from the beginning. If only one negative number, then the returned string is clipped from [...]
+ "substringAfter(exp,before)": { "index": 134, "kind": "function", "displayName": "Substring After", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a substring of the message body\/expression that comes after. Returns null if nothing comes after.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "requi [...]
+ "substringBefore(exp,before)": { "index": 135, "kind": "function", "displayName": "Substring Before", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a substring of the message body\/expression that comes before. Returns null if nothing comes before.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "r [...]
+ "substringBetween(exp,after,before)": { "index": 136, "kind": "function", "displayName": "Substring Between", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a substring of the message body\/expression that are between after and before. Returns null if nothing comes between.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", [...]
+ "sum(val...)": { "index": 137, "kind": "function", "displayName": "Calculate Sum Number", "group": "number", "label": "number", "required": false, "javaType": "long", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sums together all the values as integral numbers. This function can also be used to subtract by using negative numbers.", "ognl": false, "suffix": "}", "params": [ { "name": "val", "javaType": "long", "requir [...]
+ "sys.name": { "index": 138, "kind": "function", "displayName": "JVM System Property", "group": "other", "label": "other", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The JVM system property with the given name", "ognl": false, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The system property name" } ], "examples": [ "${sy [...]
+ "threadId": { "index": 139, "kind": "function", "displayName": "Thread Id", "group": "other", "label": "other", "required": false, "javaType": "long", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the id of the current thread. Can be used for logging.", "ognl": false, "suffix": "}" },
+ "threadName": { "index": 140, "kind": "function", "displayName": "Thread Name", "group": "other", "label": "other", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the name of the current thread. Can be used for logging.", "ognl": false, "suffix": "}" },
+ "throwException(type,msg)": { "index": 141, "kind": "function", "displayName": "Throw Exception", "group": "core", "label": "core", "required": false, "javaType": "java.lang.Exception", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Deliberately throws an error. Uses IllegalArgumentException by default if no type is specified (use fully qualified classname).", "ognl": false, "suffix": "}", "params": [ { "name": "type", [...]
+ "trim(exp)": { "index": 142, "kind": "function", "displayName": "Trim", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The trim function trims the message body (or expression) by removing all leading and trailing white spaces.", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue" [...]
+ "type:name.field": { "index": 143, "kind": "function", "displayName": "Java Field Value", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "To refer to a type or field by its classname. To refer to a field, you can append .FIELD_NAME. For example, you can refer to the constant field from Exchange as: `org.apache.camel.Exchange.FILE_NAME`", "ognl": [...]
+ "kindOfType(exp)": { "index": 144, "kind": "function", "displayName": "Kind of Type", "group": "core", "label": "core", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "What kind of type is the value (null,number,string,boolean,array,object)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": [...]
+ "unquote(exp)": { "index": 145, "kind": "function", "displayName": "Unquote", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the message body (or expression) with any leading\/ending quotes removed", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "descriptio [...]
+ "uppercase(exp)": { "index": 146, "kind": "function", "displayName": "Uppercase", "group": "string", "label": "string", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Uppercases the message body (or expression)", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": false, "defaultValue": "body", "description": "The expression. When omitted [...]
+ "uuid(type)": { "index": 147, "kind": "function", "displayName": "Generate UUID", "group": "other", "label": "other", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns a UUID using the Camel `UuidGenerator`. You can choose between `default`, `classic`, `short` and `simple` as the type. If no type is given, the default is used. It is also possible to use a custom `UuidGenera [...]
+ "val(exp)": { "index": 148, "kind": "function", "displayName": "Value", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns the expression as a constant value", "ognl": false, "suffix": "}", "params": [ { "name": "exp", "javaType": "Object", "required": true, "description": "The constant value expression" } ], "examples": [ "${val(42)} -> 42" [...]
+ "variable.name": { "index": 149, "kind": "function", "displayName": "Variable", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The variable with the given name", "ognl": true, "suffix": "}", "params": [ { "name": "name", "javaType": "String", "required": true, "description": "The variable name" } ], "examples": [ "${variable.myVar} -> variable v [...]
+ "variableAs(key,type)": { "index": 150, "kind": "function", "displayName": "Variable As", "group": "core", "label": "core", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Converts the variable to the given type (classname).", "ognl": false, "suffix": "}", "params": [ { "name": "key", "javaType": "String", "required": true, "description": "The variable name" }, { "name": "type", [...]
+ "variables": { "index": 151, "kind": "function", "displayName": "Variables", "group": "core", "label": "core", "required": false, "javaType": "java.util.Map", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Returns all the variables from the current Exchange in a Map", "ognl": false, "suffix": "}", "examples": [ "${variables} -> {myVar=value1, count=5}" ] },
+ "xpath(input,exp)": { "index": 152, "kind": "function", "displayName": "XPath", "group": "xml", "label": "xml", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "When working with XML data, then this allows using the XPath language, for example, to extract data from the message body (in XML format). This requires having camel-xpath JAR on the classpath. For input (optional), you ca [...]
},
"operators": {
"==": { "index": 0, "kind": "operator", "displayName": "Eq", "label": "binary", "required": false, "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tests equality between left and right operand values. Camel will coerce the right operand type to match the left.", "operatorKind": "binary", "operatorSyntax": "LHS == RHS", "precedence": 10, "examples": [ "${header.foo} == 'bar'", "${header.count} == 5" ] },
diff --git a/core/camel-core-languages/src/main/docs/modules/languages/pages/simple-functions.adoc b/core/camel-core-languages/src/main/docs/modules/languages/pages/simple-functions.adoc
index 046c176a5a17..1aff8e88c534 100644
--- a/core/camel-core-languages/src/main/docs/modules/languages/pages/simple-functions.adoc
+++ b/core/camel-core-languages/src/main/docs/modules/languages/pages/simple-functions.adoc
@@ -513,6 +513,8 @@ The string functions is various functions to work with values that are String an
|`capitalize()` | `String` | Capitalizes the message body as a String value (upper case every words)
|`capitalize(exp)` | `String` | Capitalizes the expression as a String value (upper case every words)
|`concat(exp,exp,separator)` | `String` | Performs a string concat using two expressions (message body as default) with optional separator.
+|`escape(kind)` | `String` | Escapes special characters in the message body so it can be safely embedded in HTML, XML, JSON, JavaScript, SQL, or a URL. The kind is one of `html`, `xml`, `json`, `js`, `sql`, or `url`.
+|`escape(kind,exp)` | `String` | Escapes special characters in the expression so it can be safely embedded in HTML, XML, JSON, JavaScript, SQL, or a URL. The kind is one of `html`, `xml`, `json`, `js`, `sql`, or `url`.
|`join(separator,prefix,exp)` | `String` | The join function iterates the message body (by default) and joins the data into a `String`. The separator is by default a comma. The prefix is optional. The join uses the message body as source by default. It is possible to refer to another source (simple language) such as a header via the exp parameter. For example `join('&','id=','$\{header.ids}')`
|`lowercase()` | `String` | Lowercases the message body
|`lowercase(exp)` | `String` | Lowercases the expression
@@ -556,6 +558,26 @@ For example if the message body contains a list of [A, B, C] then `${join()}` wo
To use semicolon as separator you would use `${join(;)}`. The `prefix` argument can be used to prefix each value, so for example
`${join(&,id=)}` would return `id=A&id=B&id=C`.
+The `escape` function escapes special characters so a value can be safely embedded in another format,
+instead of chaining multiple `replace` calls or using a custom bean. The first argument is the kind of escaping:
+
+[width="100%",cols="10%,45%,45%",options="header",]
+|====
+|Kind |Escaping |Example
+|`html` | `&` `<` `>` `"` `'` are replaced with HTML entities | `${escape(html, 'Tom & Jerry')}` returns `Tom & Jerry`
+|`xml` | `&` `<` `>` `"` `'` are replaced with the five predefined XML entities | `${escape(xml, ${header.title})}`
+|`json` | quotes, backslashes and control characters are backslash-escaped for use inside a JSON string (surrounding quotes are not added) | `${escape(json, ${body})}`
+|`js` | as `json`, and also single quotes and `</` so the value can be used inside a JavaScript string literal | `${escape(js, ${header.msg})}`
+|`sql` | single quotes are doubled for use inside an SQL string literal | `${escape(sql, ${header.name})}`
+|`url` | percent-encoding (RFC 3986) for use as a URL query parameter or path segment; a space becomes `%20` | `${escape(url, 'Camel in Action')}` returns `Camel%20in%20Action`
+|====
+
+Without a second argument the function operates on the message body, so if the body is `Monday & Tuesday`
+then `${escape(html)}` returns `Monday & Tuesday`. The kind is case-insensitive, and `javascript` can be used instead of `js`.
+
+TIP: Prefer parameterized queries over `escape(sql)`; the SQL kind is meant as a last resort for
+components where parameters cannot be used.
+
The `lowercase` and `uppercase` functions are as the name implies used for lower and uppercasing.
So `${lowercase('Hello World')}` returns `hello world` and `${uppercase('Hello World')}` returns `HELLO WORLD`.
Without arguments, they operate on the message body: if the body is `HELLO` then `${lowercase()}` returns `hello`.
diff --git a/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/SimpleConstants.java b/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/SimpleConstants.java
index 11e6adae05f0..e733d619a3cc 100644
--- a/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/SimpleConstants.java
+++ b/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/SimpleConstants.java
@@ -339,6 +339,19 @@ public final class SimpleConstants {
annotations = { "param=name:String:required::The environment variable name" })
public static final String ENV = "env.name";
+ @Metadata(description = "Escapes special characters in the message body (or expression) so the value can be safely embedded"
+ + " in HTML, XML, JSON, JavaScript, SQL, or a URL. The kind is one of: html, xml, json, js, sql, url.",
+ label = "string", javaType = "String", displayName = "Escape Special Characters",
+ examples = {
+ "${escape(html)} -> the message body with & < > \" ' escaped as HTML entities",
+ "${escape(xml, ${header.title})} -> the header value with & < > \" ' escaped as XML entities",
+ "${escape(json, ${body})} -> the body with quotes, backslashes and control characters backslash-escaped",
+ "${escape(url, 'Camel in Action')} -> Camel%20in%20Action" },
+ annotations = {
+ "param=kind:String:required::The kind of escaping: html, xml, json, js, sql, or url",
+ "param=exp:Object:optional:body:The expression to escape. When omitted uses the message body" })
+ public static final String ESCAPE = "escape(kind,exp)";
+
@Metadata(description = "The current exchange", javaType = "org.apache.camel.Exchange", label = "core,ognl")
public static final String EXCHANGE = "exchange";
diff --git a/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/StringExpressionBuilder.java b/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/StringExpressionBuilder.java
index f2b29d8a7f88..a14654126b55 100644
--- a/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/StringExpressionBuilder.java
+++ b/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/StringExpressionBuilder.java
@@ -28,6 +28,7 @@ import org.apache.camel.StreamCache;
import org.apache.camel.support.ExpressionAdapter;
import org.apache.camel.support.builder.ExpressionBuilder;
import org.apache.camel.support.builder.PredicateBuilder;
+import org.apache.camel.util.EscapeHelper;
import org.apache.camel.util.IOHelper;
import org.apache.camel.util.ObjectHelper;
import org.apache.camel.util.StringHelper;
@@ -565,6 +566,48 @@ public final class StringExpressionBuilder {
/**
* Normalizes the whitespaces in the given expressions (uses message body if expression is null)
*/
+ /**
+ * Returns an expression that escapes special characters in the given expression (or message body if <tt>null</tt>)
+ * according to the escape kind.
+ *
+ * @param kind the kind of escaping (html, xml, json, js, sql, url)
+ * @param expression the expression to escape, or <tt>null</tt> to use the message body
+ */
+ public static Expression escapeExpression(final EscapeHelper.Kind kind, final String expression) {
+ return new ExpressionAdapter() {
+ private Expression exp;
+
+ @Override
+ public void init(CamelContext context) {
+ if (expression != null) {
+ exp = context.resolveLanguage("simple").createExpression(expression);
+ exp.init(context);
+ }
+ }
+
+ @Override
+ public Object evaluate(Exchange exchange) {
+ String value;
+ if (exp != null) {
+ value = exp.evaluate(exchange, String.class);
+ } else {
+ value = exchange.getMessage().getBody(String.class);
+ }
+ return EscapeHelper.escape(kind, value);
+ }
+
+ @Override
+ public String toString() {
+ String name = kind.name().toLowerCase(Locale.ROOT);
+ if (expression != null) {
+ return "escape(" + name + "," + expression + ")";
+ } else {
+ return "escape(" + name + ")";
+ }
+ }
+ };
+ }
+
public static Expression normalizeWhitespaceExpression(final String expression) {
return new ExpressionAdapter() {
private Expression exp;
diff --git a/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/functions/StringFunctionFactory.java b/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/functions/StringFunctionFactory.java
index dbba5b61c14f..b19fdad17973 100644
--- a/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/functions/StringFunctionFactory.java
+++ b/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/functions/StringFunctionFactory.java
@@ -22,6 +22,7 @@ import org.apache.camel.language.simple.StringExpressionBuilder;
import org.apache.camel.language.simple.types.SimpleParserException;
import org.apache.camel.spi.SimpleLanguageFunctionFactory;
import org.apache.camel.support.builder.ExpressionBuilder;
+import org.apache.camel.util.EscapeHelper;
import org.apache.camel.util.ObjectHelper;
import org.apache.camel.util.StringHelper;
import org.apache.camel.util.StringQuoteHelper;
@@ -32,7 +33,8 @@ import static org.apache.camel.language.simple.SimpleFunctionHelper.ifStartsWith
* Built-in Simple string functions: {@code ${replace}}, {@code ${substring}}, {@code ${substringBefore}},
* {@code ${substringAfter}}, {@code ${substringBetween}}, {@code ${contains}}, {@code ${trim}}, {@code ${val}},
* {@code ${capitalize}}, {@code ${pad}}, {@code ${concat}}, {@code ${quote}}, {@code ${safeQuote}}, {@code ${unquote}},
- * {@code ${uppercase}}, {@code ${lowercase}}, {@code ${length}}, {@code ${size}}, {@code ${normalizeWhitespace}}.
+ * {@code ${uppercase}}, {@code ${lowercase}}, {@code ${length}}, {@code ${size}}, {@code ${normalizeWhitespace}},
+ * {@code ${escape}}.
*/
public final class StringFunctionFactory implements SimpleLanguageFunctionFactory {
@@ -344,6 +346,31 @@ public final class StringFunctionFactory implements SimpleLanguageFunctionFactor
return StringExpressionBuilder.sizeExpression(exp);
}
+ remainder = ifStartsWithReturnRemainder("escape(", function);
+ if (remainder != null) {
+ String values = StringHelper.beforeLast(remainder, ")");
+ if (values == null || ObjectHelper.isEmpty(values)) {
+ throw new SimpleParserException(
+ "Valid syntax: ${escape(kind)} or ${escape(kind,expression)} was: " + function, index);
+ }
+ // only split on the first comma so the expression may contain nested functions with commas
+ String kindName = StringHelper.before(values, ",", values).trim();
+ String exp = StringHelper.after(values, ",");
+ EscapeHelper.Kind kind = EscapeHelper.Kind.fromName(kindName);
+ if (kind == null) {
+ throw new SimpleParserException(
+ "Unknown escape kind: " + kindName + " (valid kinds: html, xml, json, js, sql, url) was: "
+ + function,
+ index);
+ }
+ if (ObjectHelper.isNotEmpty(exp)) {
+ exp = StringHelper.removeQuotes(exp.trim());
+ } else {
+ exp = null;
+ }
+ return StringExpressionBuilder.escapeExpression(kind, exp);
+ }
+
remainder = ifStartsWithReturnRemainder("normalizeWhitespace(", function);
if (remainder != null) {
String exp = null;
diff --git a/core/camel-core/src/test/java/org/apache/camel/language/simple/functions/StringFunctionFactoryTest.java b/core/camel-core/src/test/java/org/apache/camel/language/simple/functions/StringFunctionFactoryTest.java
index f7a2a40e33f4..5f88974a4de7 100644
--- a/core/camel-core/src/test/java/org/apache/camel/language/simple/functions/StringFunctionFactoryTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/language/simple/functions/StringFunctionFactoryTest.java
@@ -18,10 +18,14 @@ package org.apache.camel.language.simple.functions;
import java.util.List;
+import org.apache.camel.language.simple.types.SimpleParserException;
import org.apache.camel.spi.SimpleLanguageFunctionFactory;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class StringFunctionFactoryTest extends AbstractSimpleFunctionFactoryTestSupport {
@@ -199,4 +203,81 @@ public class StringFunctionFactoryTest extends AbstractSimpleFunctionFactoryTest
exchange.getIn().setBody(" hello world ");
assertEquals("hello world", evaluate("normalizeWhitespace()", String.class));
}
+
+ // --- escape ---
+
+ @Test
+ public void testEscapeHtmlBody() {
+ exchange.getIn().setBody("Monday & Tuesday <b>\"quoted\"</b>");
+ assertEquals("Monday & Tuesday <b>"quoted"</b>", evaluate("escape(html)", String.class));
+ }
+
+ @Test
+ public void testEscapeXmlHeader() {
+ exchange.getIn().setHeader("title", "Tom & Jerry's <Show>");
+ assertEquals("Tom & Jerry's <Show>", evaluate("escape(xml, ${header.title})", String.class));
+ }
+
+ @Test
+ public void testEscapeJson() {
+ exchange.getIn().setBody("say \"hi\"\nbye");
+ assertEquals("say \\\"hi\\\"\\nbye", evaluate("escape(json)", String.class));
+ }
+
+ @Test
+ public void testEscapeJs() {
+ exchange.getIn().setBody("it's </script>");
+ assertEquals("it\\'s <\\/script>", evaluate("escape(js)", String.class));
+ assertEquals("it\\'s <\\/script>", evaluate("escape(javascript)", String.class));
+ }
+
+ @Test
+ public void testEscapeSql() {
+ exchange.getIn().setHeader("name", "O'Reilly");
+ assertEquals("O''Reilly", evaluate("escape(sql,${header.name})", String.class));
+ }
+
+ @Test
+ public void testEscapeUrl() {
+ assertEquals("Camel%20in%20Action%3F", evaluate("escape(url, 'Camel in Action?')", String.class));
+ exchange.getIn().setBody("a&b=c");
+ assertEquals("a%26b%3Dc", evaluate("escape(url)", String.class));
+ }
+
+ @Test
+ public void testEscapeKindCaseInsensitive() {
+ exchange.getIn().setBody("a & b");
+ assertEquals("a & b", evaluate("escape(HTML)", String.class));
+ }
+
+ @Test
+ public void testEscapeNestedFunctionWithComma() {
+ exchange.getIn().setBody("<a>");
+ assertEquals("<a>-<a>", evaluate("escape(html, ${concat(${body},${body},-)})", String.class));
+ }
+
+ @Test
+ public void testEscapeNonStringBody() {
+ exchange.getIn().setBody(42);
+ assertEquals("42", evaluate("escape(html)", String.class));
+ }
+
+ @Test
+ public void testEscapeNullBody() {
+ exchange.getIn().setBody(null);
+ assertNull(evaluate("escape(html)", String.class));
+ }
+
+ @Test
+ public void testEscapeUnknownKind() {
+ SimpleParserException e = assertThrows(SimpleParserException.class,
+ () -> createFactory().createFunction(context, "escape(csv)", 0));
+ assertTrue(e.getMessage().contains("Unknown escape kind: csv"));
+ }
+
+ @Test
+ public void testEscapeMissingKind() {
+ assertThrows(SimpleParserException.class,
+ () -> createFactory().createFunction(context, "escape()", 0));
+ }
}
diff --git a/core/camel-util/src/main/java/org/apache/camel/util/EscapeHelper.java b/core/camel-util/src/main/java/org/apache/camel/util/EscapeHelper.java
new file mode 100644
index 000000000000..7416aa2115d3
--- /dev/null
+++ b/core/camel-util/src/main/java/org/apache/camel/util/EscapeHelper.java
@@ -0,0 +1,237 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.util;
+
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.util.Locale;
+
+/**
+ * Helper for escaping special characters so a value can be embedded safely in HTML, XML, JSON, JavaScript, SQL or a
+ * URL.
+ */
+public final class EscapeHelper {
+
+ /**
+ * The supported escape kinds.
+ */
+ public enum Kind {
+ HTML,
+ XML,
+ JSON,
+ JS,
+ SQL,
+ URL;
+
+ /**
+ * Resolves the escape kind from its name (case-insensitive).
+ *
+ * @param name the name such as html, xml, json, js, sql, or url
+ * @return the kind, or <tt>null</tt> if the name is not a supported kind
+ */
+ public static Kind fromName(String name) {
+ if (name == null) {
+ return null;
+ }
+ String key = name.trim().toUpperCase(Locale.ROOT);
+ if ("JAVASCRIPT".equals(key)) {
+ return JS;
+ }
+ for (Kind kind : values()) {
+ if (kind.name().equals(key)) {
+ return kind;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Escapes the value according to this kind.
+ */
+ public String escape(String value) {
+ return EscapeHelper.escape(this, value);
+ }
+ }
+
+ private EscapeHelper() {
+ }
+
+ /**
+ * Escapes the value according to the given kind.
+ *
+ * @param kind the escape kind
+ * @param value the value to escape
+ * @return the escaped value, or <tt>null</tt> if the value is <tt>null</tt>
+ */
+ public static String escape(Kind kind, String value) {
+ if (value == null) {
+ return null;
+ }
+ return switch (kind) {
+ case HTML -> html(value);
+ case XML -> xml(value);
+ case JSON -> json(value);
+ case JS -> js(value);
+ case SQL -> sql(value);
+ case URL -> url(value);
+ };
+ }
+
+ /**
+ * Escapes the value for use in HTML text or attribute values: {@code &}, {@code <}, {@code >}, {@code "} and
+ * {@code '} are replaced with their entities.
+ */
+ public static String html(String value) {
+ if (value == null) {
+ return null;
+ }
+ StringBuilder sb = null;
+ for (int i = 0; i < value.length(); i++) {
+ char ch = value.charAt(i);
+ String rep = switch (ch) {
+ case '&' -> "&";
+ case '<' -> "<";
+ case '>' -> ">";
+ case '"' -> """;
+ case '\'' -> "'";
+ default -> null;
+ };
+ sb = append(sb, value, i, rep);
+ }
+ return sb != null ? sb.toString() : value;
+ }
+
+ /**
+ * Escapes the value for use in XML text or attribute values: {@code &}, {@code <}, {@code >}, {@code "} and
+ * {@code '} are replaced with the five predefined XML entities.
+ */
+ public static String xml(String value) {
+ if (value == null) {
+ return null;
+ }
+ StringBuilder sb = null;
+ for (int i = 0; i < value.length(); i++) {
+ char ch = value.charAt(i);
+ String rep = switch (ch) {
+ case '&' -> "&";
+ case '<' -> "<";
+ case '>' -> ">";
+ case '"' -> """;
+ case '\'' -> "'";
+ default -> null;
+ };
+ sb = append(sb, value, i, rep);
+ }
+ return sb != null ? sb.toString() : value;
+ }
+
+ /**
+ * Escapes the value for use inside a JSON string literal: quotes, backslashes and control characters are
+ * backslash-escaped. The surrounding quotes are not added.
+ */
+ public static String json(String value) {
+ if (value == null) {
+ return null;
+ }
+ StringBuilder sb = null;
+ for (int i = 0; i < value.length(); i++) {
+ char ch = value.charAt(i);
+ String rep = jsonEscape(ch);
+ sb = append(sb, value, i, rep);
+ }
+ return sb != null ? sb.toString() : value;
+ }
+
+ /**
+ * Escapes the value for use inside a JavaScript string literal: the JSON rules plus single quotes are
+ * backslash-escaped, and {@code </} is broken up so the value cannot terminate an enclosing {@code <script>}
+ * element. The surrounding quotes are not added.
+ */
+ public static String js(String value) {
+ if (value == null) {
+ return null;
+ }
+ StringBuilder sb = null;
+ for (int i = 0; i < value.length(); i++) {
+ char ch = value.charAt(i);
+ String rep;
+ if (ch == '\'') {
+ rep = "\\'";
+ } else if (ch == '/' && i > 0 && value.charAt(i - 1) == '<') {
+ rep = "\\/";
+ } else {
+ rep = jsonEscape(ch);
+ }
+ sb = append(sb, value, i, rep);
+ }
+ return sb != null ? sb.toString() : value;
+ }
+
+ /**
+ * Escapes the value for use inside a single-quoted SQL string literal by doubling single quotes. This is a
+ * last-resort measure only; prefer parameterized queries wherever possible.
+ */
+ public static String sql(String value) {
+ if (value == null) {
+ return null;
+ }
+ if (value.indexOf('\'') == -1) {
+ return value;
+ }
+ return value.replace("'", "''");
+ }
+
+ /**
+ * Escapes the value for use as a URL query parameter or path segment using percent-encoding (RFC 3986). Unlike
+ * {@link URLEncoder}, a space is encoded as {@code %20} rather than {@code +}.
+ */
+ public static String url(String value) {
+ if (value == null) {
+ return null;
+ }
+ return URLEncoder.encode(value, StandardCharsets.UTF_8).replace("+", "%20");
+ }
+
+ private static String jsonEscape(char ch) {
+ return switch (ch) {
+ case '"' -> "\\\"";
+ case '\\' -> "\\\\";
+ case '\b' -> "\\b";
+ case '\f' -> "\\f";
+ case '\n' -> "\\n";
+ case '\r' -> "\\r";
+ case '\t' -> "\\t";
+ default -> ch < 0x20 ? String.format("\\u%04x", (int) ch) : null;
+ };
+ }
+
+ private static StringBuilder append(StringBuilder sb, String value, int i, String rep) {
+ if (rep == null) {
+ if (sb != null) {
+ sb.append(value.charAt(i));
+ }
+ return sb;
+ }
+ if (sb == null) {
+ sb = new StringBuilder(value.length() + 16);
+ sb.append(value, 0, i);
+ }
+ sb.append(rep);
+ return sb;
+ }
+
+}
diff --git a/core/camel-util/src/main/java/org/apache/camel/util/SimpleUtils.java b/core/camel-util/src/main/java/org/apache/camel/util/SimpleUtils.java
index 8fe3f9d38c19..747febd13fd0 100644
--- a/core/camel-util/src/main/java/org/apache/camel/util/SimpleUtils.java
+++ b/core/camel-util/src/main/java/org/apache/camel/util/SimpleUtils.java
@@ -61,6 +61,7 @@ public class SimpleUtils {
"distinct",
"empty",
"env",
+ "escape",
"exception",
"exchange",
"exchangeid",
diff --git a/core/camel-util/src/test/java/org/apache/camel/util/EscapeHelperTest.java b/core/camel-util/src/test/java/org/apache/camel/util/EscapeHelperTest.java
new file mode 100644
index 000000000000..1edb20eaf1cf
--- /dev/null
+++ b/core/camel-util/src/test/java/org/apache/camel/util/EscapeHelperTest.java
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.util;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertSame;
+
+public class EscapeHelperTest {
+
+ @Test
+ public void testHtml() {
+ assertEquals("Monday & Tuesday", EscapeHelper.html("Monday & Tuesday"));
+ assertEquals("<b>bold</b>", EscapeHelper.html("<b>bold</b>"));
+ assertEquals("say "hi" & 'bye'", EscapeHelper.html("say \"hi\" & 'bye'"));
+ assertEquals("caf\u00e9", EscapeHelper.html("caf\u00e9"));
+ }
+
+ @Test
+ public void testXml() {
+ assertEquals("Monday & Tuesday", EscapeHelper.xml("Monday & Tuesday"));
+ assertEquals("<a href="x">it's</a>", EscapeHelper.xml("<a href=\"x\">it's</a>"));
+ }
+
+ @Test
+ public void testJson() {
+ assertEquals("say \\\"hi\\\"", EscapeHelper.json("say \"hi\""));
+ assertEquals("c:\\\\temp", EscapeHelper.json("c:\\temp"));
+ assertEquals("line1\\nline2\\ttab\\r\\b\\f", EscapeHelper.json("line1\nline2\ttab\r\b\f"));
+ assertEquals("a\\u0001b", EscapeHelper.json("a\u0001b"));
+ assertEquals("it's <b>", EscapeHelper.json("it's <b>"));
+ }
+
+ @Test
+ public void testJs() {
+ assertEquals("it\\'s \\\"quoted\\\"", EscapeHelper.js("it's \"quoted\""));
+ assertEquals("<\\/script>", EscapeHelper.js("</script>"));
+ assertEquals("a\\nb", EscapeHelper.js("a\nb"));
+ assertEquals("a/b", EscapeHelper.js("a/b"));
+ }
+
+ @Test
+ public void testSql() {
+ assertEquals("O''Reilly", EscapeHelper.sql("O'Reilly"));
+ assertEquals("'''' ", EscapeHelper.sql("'' "));
+ assertEquals("plain", EscapeHelper.sql("plain"));
+ }
+
+ @Test
+ public void testUrl() {
+ assertEquals("Camel%20in%20Action", EscapeHelper.url("Camel in Action"));
+ assertEquals("a%26b%3Dc%2Fd%3Fe", EscapeHelper.url("a&b=c/d?e"));
+ assertEquals("caf%C3%A9", EscapeHelper.url("caf\u00e9"));
+ assertEquals("plain-text_1.2*", EscapeHelper.url("plain-text_1.2*"));
+ }
+
+ @Test
+ public void testNoChangeReturnsSameInstance() {
+ String value = "nothing to escape";
+ assertSame(value, EscapeHelper.html(value));
+ assertSame(value, EscapeHelper.xml(value));
+ assertSame(value, EscapeHelper.json(value));
+ assertSame(value, EscapeHelper.js(value));
+ assertSame(value, EscapeHelper.sql(value));
+ }
+
+ @Test
+ public void testNull() {
+ for (EscapeHelper.Kind kind : EscapeHelper.Kind.values()) {
+ assertNull(EscapeHelper.escape(kind, null));
+ }
+ }
+
+ @Test
+ public void testKindFromName() {
+ assertEquals(EscapeHelper.Kind.HTML, EscapeHelper.Kind.fromName("html"));
+ assertEquals(EscapeHelper.Kind.XML, EscapeHelper.Kind.fromName(" XML "));
+ assertEquals(EscapeHelper.Kind.JSON, EscapeHelper.Kind.fromName("Json"));
+ assertEquals(EscapeHelper.Kind.JS, EscapeHelper.Kind.fromName("js"));
+ assertEquals(EscapeHelper.Kind.JS, EscapeHelper.Kind.fromName("javascript"));
+ assertEquals(EscapeHelper.Kind.SQL, EscapeHelper.Kind.fromName("sql"));
+ assertEquals(EscapeHelper.Kind.URL, EscapeHelper.Kind.fromName("url"));
+ assertNull(EscapeHelper.Kind.fromName("csv"));
+ assertNull(EscapeHelper.Kind.fromName(null));
+ }
+
+ @Test
+ public void testKindEscape() {
+ assertEquals("a & b", EscapeHelper.Kind.HTML.escape("a & b"));
+ assertEquals("a%20%26%20b", EscapeHelper.Kind.URL.escape("a & b"));
+ }
+}