[ 
https://issues.apache.org/jira/browse/CAMEL-17505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17623144#comment-17623144
 ] 

Claus Ibsen commented on CAMEL-17505:
-------------------------------------

For 3.x if you want to experiment, then there could be a DataFormatBuilder 
which you then need to use as argument into marshal / unmarshal

Maybe something ala:

marshal(dataFormatBuilder().secureXml())
        .optionA(bla bla)
        .optionB(bla bla)
        .optionC(bla bla)
)

And it can maybe be shorter named

marshal(dataFormat().secureXml())
        .optionA(bla bla)
        .optionB(bla bla)
        .optionC(bla bla)
)

Where dataFormat() is a method in RouteBuilder.

Mind this is just from top of my head, without any looking in the code

> camel-core - DataFormatDSL that is source code generated
> --------------------------------------------------------
>
>                 Key: CAMEL-17505
>                 URL: https://issues.apache.org/jira/browse/CAMEL-17505
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Nicolas Filotto
>            Priority: Major
>             Fix For: Future
>
>
> For Java DSL then we have a data format builder at 
> {{org.apache.camel.builder.DataFormatClause}}
> 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 {{xmlSecurity}} with 15 
> methods.
> Instead, we should propose a builder DSL class that the {{DataFormatClause}} 
> can provide.
> {noformat}
> marshal()
>     .secureXml()
>         .optionA(bla bla)
>         .optionB(bla bla)
>         .optionC(bla bla)
>     .end(){noformat}
> Then we can still manually add a few methods for common use cases, so you can 
> do {{{}marshal().secureXml(bla bla, true){}}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to