This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit c1e0ae6f25a2f0a2763a3f981818b73bbefb557c
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Sat Dec 5 12:32:05 2020 +0100

    CAMEL-15704: camel-csimple - Compiled simple language.
---
 .../camel/catalog/docs/csimple-language.adoc       | 49 ++++++++++++++++++++++
 .../modules/languages/pages/csimple-language.adoc  | 49 ++++++++++++++++++++++
 .../modules/languages/pages/csimple-language.adoc  | 49 ++++++++++++++++++++++
 3 files changed, 147 insertions(+)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/csimple-language.adoc
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/csimple-language.adoc
index 2108f7f..e447b63 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/csimple-language.adoc
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/csimple-language.adoc
@@ -207,6 +207,55 @@ For example the following scripts cannot compile:
     ${bodyAs(MyUser)?.address?.zip} > 10000
 ----
 
+== Auto imports
+
+The csimple language will automatic import from:
+
+[source,java]
+----
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.stream.*;
+import org.apache.camel.*;
+import org.apache.camel.util.*;
+----
+
+== Configuration file
+
+You can configure the csimple language in the `camel-csimple.properties` file 
which is loaded from the root classpath.
+
+For example you can add additional imports in the `camel-csimple.properties` 
file by adding:
+
+[source,properties]
+----
+import com.foo.MyUser;
+import com.bar.*;
+import static com.foo.MyHelper.*;
+----
+
+You can also add aliases (key=value) where an alias will be used as a 
shorthand replacement in the code.
+
+[source,properties]
+----
+echo()=${bodyAs(String)} ${bodyAs(String)}
+----
+
+Which allows to use _echo()_ in the csimple language script such as:
+
+[source,java]
+----
+from("direct:hello")
+    .transform(csimple("Hello echo()"))
+    .log("You said ${body}");
+----
+
+The _echo()_ alias will be replaced with its value resulting in a script as:
+
+[source,java]
+----
+    .transform(csimple("Hello ${bodyAs(String)} ${bodyAs(String)}"))
+----
+
 == More documentation
 
 See the xref:simple-language.adoc[Simple] language as csimple has the same set 
of functions as simple language.
diff --git 
a/core/camel-core-languages/src/main/docs/modules/languages/pages/csimple-language.adoc
 
b/core/camel-core-languages/src/main/docs/modules/languages/pages/csimple-language.adoc
index 2108f7f..e447b63 100644
--- 
a/core/camel-core-languages/src/main/docs/modules/languages/pages/csimple-language.adoc
+++ 
b/core/camel-core-languages/src/main/docs/modules/languages/pages/csimple-language.adoc
@@ -207,6 +207,55 @@ For example the following scripts cannot compile:
     ${bodyAs(MyUser)?.address?.zip} > 10000
 ----
 
+== Auto imports
+
+The csimple language will automatic import from:
+
+[source,java]
+----
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.stream.*;
+import org.apache.camel.*;
+import org.apache.camel.util.*;
+----
+
+== Configuration file
+
+You can configure the csimple language in the `camel-csimple.properties` file 
which is loaded from the root classpath.
+
+For example you can add additional imports in the `camel-csimple.properties` 
file by adding:
+
+[source,properties]
+----
+import com.foo.MyUser;
+import com.bar.*;
+import static com.foo.MyHelper.*;
+----
+
+You can also add aliases (key=value) where an alias will be used as a 
shorthand replacement in the code.
+
+[source,properties]
+----
+echo()=${bodyAs(String)} ${bodyAs(String)}
+----
+
+Which allows to use _echo()_ in the csimple language script such as:
+
+[source,java]
+----
+from("direct:hello")
+    .transform(csimple("Hello echo()"))
+    .log("You said ${body}");
+----
+
+The _echo()_ alias will be replaced with its value resulting in a script as:
+
+[source,java]
+----
+    .transform(csimple("Hello ${bodyAs(String)} ${bodyAs(String)}"))
+----
+
 == More documentation
 
 See the xref:simple-language.adoc[Simple] language as csimple has the same set 
of functions as simple language.
diff --git a/docs/components/modules/languages/pages/csimple-language.adoc 
b/docs/components/modules/languages/pages/csimple-language.adoc
index 8337311..18d6da3 100644
--- a/docs/components/modules/languages/pages/csimple-language.adoc
+++ b/docs/components/modules/languages/pages/csimple-language.adoc
@@ -209,6 +209,55 @@ For example the following scripts cannot compile:
     ${bodyAs(MyUser)?.address?.zip} > 10000
 ----
 
+== Auto imports
+
+The csimple language will automatic import from:
+
+[source,java]
+----
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.stream.*;
+import org.apache.camel.*;
+import org.apache.camel.util.*;
+----
+
+== Configuration file
+
+You can configure the csimple language in the `camel-csimple.properties` file 
which is loaded from the root classpath.
+
+For example you can add additional imports in the `camel-csimple.properties` 
file by adding:
+
+[source,properties]
+----
+import com.foo.MyUser;
+import com.bar.*;
+import static com.foo.MyHelper.*;
+----
+
+You can also add aliases (key=value) where an alias will be used as a 
shorthand replacement in the code.
+
+[source,properties]
+----
+echo()=${bodyAs(String)} ${bodyAs(String)}
+----
+
+Which allows to use _echo()_ in the csimple language script such as:
+
+[source,java]
+----
+from("direct:hello")
+    .transform(csimple("Hello echo()"))
+    .log("You said ${body}");
+----
+
+The _echo()_ alias will be replaced with its value resulting in a script as:
+
+[source,java]
+----
+    .transform(csimple("Hello ${bodyAs(String)} ${bodyAs(String)}"))
+----
+
 == More documentation
 
 See the xref:simple-language.adoc[Simple] language as csimple has the same set 
of functions as simple language.

Reply via email to