This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch lan-markup in repository https://gitbox.apache.org/repos/asf/camel.git
commit bbb04d1837a21999c4775a0cb81a066f7bf2f713 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Fri Aug 16 10:13:01 2024 +0200 CAMEL-20569: camel-catalog - Markup languages which functions they support for better doc and tooling. --- .../org/apache/camel/language/simple/simple.json | 7 ++++++- .../docs/modules/languages/pages/simple-language.adoc | 2 +- .../apache/camel/language/simple/SimpleConstants.java | 17 +++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) 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 4054c67f8b8..77a53050a85 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 @@ -59,6 +59,11 @@ "env.name": { "index": 34, "kind": "function", "displayName": "Env.name", "group": "function", "label": "function", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The OS environment variable with the given name", "suffix": "}" }, "pretty(exp)": { "index": 35, "kind": "function", "displayName": "Pretty(exp)", "group": "function", "label": "function", "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.", "suffix": "}" }, "date(command)": { "index": 36, "kind": "function", "displayName": "Date(command)", "group": "function", "label": "function", "required": false, "javaType": "java.util.Date", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Evaluates to a java.util.Date object. Supported commands are: `now` for current timestamp, `exchangeCreated` for the timestamp when the current exchange was created, `header.xxx` to use the Long\/Date [...] - "date-with-timezone(command:timezone:pattern)": { "index": 37, "kind": "function", "displayName": "Date-with-timezone(command:timezone:pattern)", "group": "function", "label": "function", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Formats the date to a String using the given date pattern, and with support for timezone. Supported commands are: `now` for current timestamp, `ex [...] + "date-with-timezone(command:timezone:pattern)": { "index": 37, "kind": "function", "displayName": "Date-with-timezone(command:timezone:pattern)", "group": "function", "label": "function", "required": false, "javaType": "String", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Formats the date to a String using the given date pattern, and with support for timezone. Supported commands are: `now` for current timestamp, `ex [...] + "bean(name.method)": { "index": 38, "kind": "function", "displayName": "Bean(name.method)", "group": "function", "label": "function", "required": false, "javaType": "Object", "prefix": "${", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Calls a Java bean. The name of the bean can also refer to a class name using type prefix as follows `bean:type:com.foo.MyClass`. If no method name is given then Camel will automatic attempt to find th [...] + "propertiesExist:key": { "index": 39, "kind": "function", "displayName": "Properties Exist:key", "group": "function", "label": "function", "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 !", "suffix": "}" }, + "properties:key:default": { "index": 40, "kind": "function", "displayName": "Properties:key:default", "group": "function", "label": "function", "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.", "suffix": "}" }, + "ref:name": { "index": 41, "kind": "function", "displayName": "Ref:name", "group": "function", "label": "function", "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.", "suffix": "}" }, + "type:name.field": { "index": 42, "kind": "function", "displayName": "Type:name.field", "group": "function", "label": "function", "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`", "s [...] } } diff --git a/core/camel-core-languages/src/main/docs/modules/languages/pages/simple-language.adoc b/core/camel-core-languages/src/main/docs/modules/languages/pages/simple-language.adoc index 961d107de88..6902902d223 100644 --- a/core/camel-core-languages/src/main/docs/modules/languages/pages/simple-language.adoc +++ b/core/camel-core-languages/src/main/docs/modules/languages/pages/simple-language.adoc @@ -197,7 +197,7 @@ to a bean class (such as calling a static method), then you can prefix with the not exist nor has a value, then an optional default value can be specified. -|propertiesExist:key |String |Checks whether a property placeholder with the given key exists or not. +|propertiesExist:key |boolean |Checks whether a property placeholder with the given key exists or not. The result can be negated by prefixing the key with `!`. |fromRouteId |String |Returns the original route id where this exchange was created. 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 3f0446c3358..d3fa167ef75 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 @@ -145,5 +145,22 @@ public final class SimpleConstants { + " Command accepts offsets such as: `now-24h` or `header.xxx+1h` or even `now+1h30m-100`.", label = "function", javaType = "String") public static final String DATE_WITH_TIMEZONE = "date-with-timezone(command:timezone:pattern)"; + @Metadata(description = "Calls a Java bean." + + " The name of the bean can also refer to a class name using type prefix as follows `bean:type:com.foo.MyClass`." + + " If no method name is given then Camel will automatic attempt to find the best method to use.", + label = "function", javaType = "Object") + public static final String BEAN = "bean(name.method)"; + @Metadata(description = "Checks whether a property placeholder with the given key exists or not. The result can be negated by prefixing the key with !", + label = "function", javaType = "boolean") + public static final String PROPERTIES_EXIST = "propertiesExist:key"; + @Metadata(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.", + label = "function", javaType = "String") + public static final String PROPERTIES = "properties:key:default"; + @Metadata(description = "To look up a bean from the Registry with the given name.", label = "function", javaType = "Object") + public static final String REF = "ref:name"; + @Metadata(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`", + label = "function", javaType = "Object") + public static final String TYPE = "type:name.field"; }