Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] tokenize method returning a Bag instead of Sequence
[Acceleo] tokenize method returning a Bag instead of Sequence [message #1233043] Sat, 18 January 2014 07:39 Go to next message
michel souza is currently offline michel souza
Messages: 18
Registered: December 2013
Junior Member
Hi guys... according to Acceleo documentation the string method is supposed to return a Sequence(string) but in my case is returning a Bag... no idea why?

Have someone ever experienced that?
It's really important to me have a Sequence(String) instead of a Bag(String). And I don't wanna convert because it messes with the order.

Thank you.
Re: [Acceleo] tokenize method returning a Bag instead of Sequence [message #1233923 is a reply to message #1233043] Mon, 20 January 2014 16:14 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane Begaudeau
Messages: 406
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

Tokenize returns a List<String> which in Acceleo is "translated" as a Sequence(String). What does this ['first.second.third.fourth.fifth'.tokenize('.')/] return for you? If it does not return a sequence with the same order (first, second, third, fourth, fifth), which version of Acceleo are you using, which version of Eclipse and which version of OCL?

Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Google+: +stephane.begaudeau
Blog: http://stephanebegaudeau.tumblr.com | Eclipse Java Development Tools Tips and Tricks



Re: [Acceleo] tokenize method returning a Bag instead of Sequence [message #1234868 is a reply to message #1233043] Wed, 22 January 2014 21:14 Go to previous message
michel souza is currently offline michel souza
Messages: 18
Registered: December 2013
Junior Member
Hi Stephane,

I figured out the probleam. In fact, my string came from a search that I did with a 'select'.. this select was returning me a collection that wasn't a Sequence.. so I couldn't apply 'first()' operation. I was directly applying resultofsearch.name.tokenize('.')... instead of resultofsearch->asSequence->first().name.tokenize('.') to apply the operation to one single string.

I'm using the lastest versions, I guess.

Many thanks for your help. Merci vraiment pour votre aide!
Previous Topic:[JET] Eclipse cannot find template path
Next Topic:[Acceleo]Inverting a String
Goto Forum:
  


Current Time: Tue Sep 02 03:01:34 EDT 2014

Powered by FUDForum. Page generated in 0.02223 seconds