You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/11/08 14:51:00 UTC

[GitHub] [camel] essobedo opened a new pull request, #8688: CAMEL-18697: camel-core - Propose a DSL for languages

essobedo opened a new pull request, #8688:
URL: https://github.com/apache/camel/pull/8688

   Fix for https://issues.apache.org/jira/browse/CAMEL-18697
   
   ## Motivation
   
   For Java DSL then we have a language builder at `org.apache.camel.builder.ExpressionClause`
   
   This class is very verbose as for Java DSL we have overloaded methods to set the various options, but it can get too far like `tokenize` with 12 methods.
   
   Instead, we should propose a builder DSL class that the `RouteBuilder` can provide.
   
   ## Modifications:
   
   * Add a static nested class `Builder` to all existing languages
   * Add a factory for the builder of all the languages `LanguageBuilderFactory`
   * Add the method `expression()` to the `RouteBuilder` to give access to the factory of builders while defining the routes.
   * Add the method `expression(Expression)` to `BuilderSupport` in order to create a `ValueBuilder` from any expression
   
   ## Result
   
   It is now possible to create an expression using the fluent syntax as shown in the next example:
   
   ```
   from("file:data")
       .split(
           expression()
               .tokenize()
                   .token("(\\W+)\\s*")
                   .regex(true)
               .end()
       )
       .process("processEntry");
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #8688: CAMEL-18697: camel-core - Propose a DSL for languages

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8688:
URL: https://github.com/apache/camel/pull/8688#issuecomment-1307339998

   :star2: Thank you for your contribution to the Apache Camel project! :star2: 
   
   :warning: Please note that the changes on this PR may be **tested automatically**. 
   
   If necessary Apache Camel Committers may access logs and test results in the job summaries!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #8688: CAMEL-18697: camel-core - Propose a DSL for languages

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8688:
URL: https://github.com/apache/camel/pull/8688#issuecomment-1307433818

   :no_entry_sign: There are (likely) no components to be tested in this PR


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] essobedo merged pull request #8688: CAMEL-18697: camel-core - Propose a DSL for languages

Posted by GitBox <gi...@apache.org>.
essobedo merged PR #8688:
URL: https://github.com/apache/camel/pull/8688


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org