camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Atle Prange (JIRA)" <>
Subject [jira] Commented: (CAMEL-1226) String formatter / interpolator for dsl uris
Date Tue, 06 Jan 2009 15:48:05 GMT


Atle Prange commented on CAMEL-1226:

That seems to do the trick, with the plus that it is already part of the 
JDK, and one could use some String.format static import elsewhere and 
still keep the same conventions.
If i could choose i would pick the method name "format()" instead of 
"toFormat()", it seems more elegant to me....

> String formatter / interpolator for dsl uris
> --------------------------------------------
>                 Key: CAMEL-1226
>                 URL:
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Atle Prange
>            Priority: Minor
> Often one ends up with dsl expressions that build strings like:
> {code}
>  from("direct:start").to("ldap:localhost:" + port + "?base=" + query);
> {code}
> Would in not be better to write
> {code}
> from("direct:start").to("ldps:localhost:{1}?base={2}", port, query);
> {code}
> , where "{1}" means "the first argument in the string varargs following. ( "{1}" could
of course be replaced by some expression that you like the format of)
> To implementent this one could overload the from() and to() methods to accept a vararg
array of Strings following the uri argument, and interpolate the uri with the varargs...

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message