camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: String replacement via Spring
Date Wed, 19 Sep 2012 15:43:01 GMT
On Wed, Sep 19, 2012 at 5:05 PM, gramanero <> wrote:
> Yes, I started to realize that when I received an Ambiguous method call
> exception in Camel. This is what I was trying to refer to when I said that
> there are probably some limitations to the Simple language in that I am
> unable to essentially add a cast to show my intent. For example I am
> assuming something like this is not possible:
> transform>
>   <simple>${body.replace((char)'\\',(char)'-')}</simple>
> </transform>

The simple language supports specifying types to pin-point a method
when its ambiguous.
As it is in your case. But we haven't yet implement support for also
passing in parameters at the same time.

You can see some details here:

The scripting language such as groovy, mvel is better suited for this

> This would be an attempt to indicate to the Simple language parser that I
> want the char method of the replace API and not the CharSequence method,
> thus trying to eliminate the Ambiguous call exception.
> Any ideas why the .replaceAll won't work even though I got a simple java
> code sample working? For example, the following works fine, but in the
> Simple language it throws a java.util.regex.PatternSyntaxException: Illegal
> repetition exception.
> class DoubleTheBackslash {
>    public static void main(String[] args) {
>         String path = "E:\\root\\dira\\dirb";
>         System.out.println(path);
>         System.out.println(path.replaceAll("foo","bar"));
>    }
> }
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message