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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
