You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2011/06/05 11:08:47 UTC
[jira] [Commented] (CAMEL-4028) Simple language - Allow to
configure prefix and suffix tokens
[ https://issues.apache.org/jira/browse/CAMEL-4028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13044470#comment-13044470 ]
Claus Ibsen commented on CAMEL-4028:
------------------------------------
Taarig that is a great start.
We need tests for camel-spring as well as you can use <simple> in there. And we need tests that uses custom prefix/suffix tokens.
In the SimpleExpression you need to add attributes for prefix/suffix so they can be configured in XML DSL:
{code:xml}
<simple prefix="[" suffix="]">[body] is cool</simple>
{code}
Likewise we should add support for configuring those prefix/suffix tokens on a global level so you dont have to provide custom all the time. But I wonder what a good way would be for that?
In Java it would be to configure the SimpleLanguage
{code}
SimpleLanguage simple = (SimpleLanguage) context.resolveLanguage("simple");
simple.setPrefix("[");
simple.setSuffix)"]");
{code}
But in XML DSL we may want a nice way of doing that in the XSD.
Currently you should be able to do it as a <bean> tag
{code:xml}
<bean id="simple" class="...SimpleLanguage">
<property name="prefix" value="["/>
<property name="suffix" value="]"/>
</bean>
{code}
> Simple language - Allow to configure prefix and suffix tokens
> -------------------------------------------------------------
>
> Key: CAMEL-4028
> URL: https://issues.apache.org/jira/browse/CAMEL-4028
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Affects Versions: 2.7.0
> Reporter: Claus Ibsen
> Priority: Minor
> Fix For: 2.9.0, Future
>
> Attachments: CAMEL-4028_Simple_language_-_Allow_to_configure_prefix_and_suffix_tokens2.patch
>
>
> The simple language uses ${ } tokens by default. However groovy uses those for its GString. So we have a clash. Even if you use $simple{ } instead in Groovy then you have a clash.
> So we should add support for configuring the tokens so you can remedy the GString clash in Groovy.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira