camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: tokenize + group + aggregator strategy?
Date Sat, 21 Sep 2013 12:43:14 GMT
Hi

Do like this
.split().tokenize("\n", 100).aggregationStrategy(myStrategy)

On Fri, Sep 20, 2013 at 11:08 AM, Tom Ellis <tellisnz@gmail.com> wrote:
> Hi
>
> Is it possible to do something like this:
>
> int myGroupSize = 100;
> .split(body().tokenize("\n", myGroupSize), new myAggStrategy()) ?
>
> The above doesn't work because the tokenize methods on the
> ValueBuilder don't take groups. The following compiles but is it the
> best way/can someone see if it obviously won't work?
>
> TokenizeLanguage language = new TokenizeLanguage();
> language.setToken("\n");
> language.setGroup(myGroupSize);
> language.setIncludeTokens(true);
> .split(new ValueBuilder(language.createExpression(null)), new myAggStrategy())..
>
> Cheers,
>
> Tom



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
View raw message