Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Pair up data
Pair up data [message #1729290] Tue, 12 April 2016 15:22 Go to next message
Nattapon Thathong is currently offline Nattapon ThathongFriend
Messages: 1
Registered: April 2016
Junior Member
Hi,

I'm a newbie to Acceleo.

I have a set of json data:
{
"list": [
{
"name" : "test_1",
"type": "a"
},
{
"name" : "test_2",
"type": "b"
},
zd,
{
"name" : "test_2",
"type": "c"
}]
}

I want to group the data that has the same type, for example,
test_1 and test_3 have the same type "a".

I want the output to be like ,
a: test_1, test_3
b: test_2
c: test_3


Can someone help me?
Re: Pair up data [message #1729337 is a reply to message #1729290] Wed, 13 April 2016 08:18 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi,

It doesn't seem like you have a model at all, so Acceleo (which only accepts EMF models as input) doesn't look like the solution for you.

If your requirements as are simple as that, all you would need is a library to parse your data (such as Gson), then simply iterate over it to store your data according to its type, then print it as you like.

If not, you will have to transform your json into an EMF model before you can use it with acceleo or another eclipse m2t project.

Laurent Goubet
Obeo
Previous Topic:[error launching acceleo]
Next Topic:Code synchronization with UML model
Goto Forum:
  


Current Time: Fri Apr 26 18:59:11 GMT 2024

Powered by FUDForum. Page generated in 0.02815 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top