|
|
Re: Define EMF metamodel From XPand [message #1071188 is a reply to message #1071184] |
Fri, 19 July 2013 14:19 |
serhat gezgin Messages: 243 Registered: January 2013 Location: Izmir |
Senior Member |
|
|
Hi Ed,
i have a xml file as input model and i want to generate emf metamodel from this
xml file. I generate this as M2T with XPAND and now i want to refactore this XPAND file. And if i can do M2M with XPAND i want to use this feature.
And i want to ask u another question;
on XPAND documentation i saw a function as;
create Entity this duplicate(Entity old):
attribute.addAll(old.attribute.duplicate()) ->
reference.addAll(old.reference.duplicate()) ->
setName(old.name);
What does this code ? i dont understand. (I thought this is M2M function)
Regards,
[Updated on: Fri, 19 July 2013 14:22] Report message to a moderator
|
|
|
|
|
Re: Define EMF metamodel From XPand [message #1071493 is a reply to message #1071270] |
Sat, 20 July 2013 08:30 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
Serhat,
Comments below.
On 19/07/2013 7:44 PM, serhat gezgin wrote:
> Hi,
>
> (My xml is clafer feature model xml.)
Eclipse has a feature model project. I wonder if that helps:
http://www.eclipse.org/featuremodel/
>
> I am writing feture model with clafer and then i generate it's xml by
> clafer program.
>
> clafer is quite simple feature model language like;
>
>
> abstract date : string
>
> abstract Person
> Name : string
> Surname : string
> DateOfBirth : date
> or Gender
> Male
> Female
> xor MaritalStatus
> NeverMarried
> Married
> Divorced
> Address
> Street : string
> UnitNo : string ?
> City : string
> Country : string
> PostalCode : string
>
>
> when i use clafer program to generate this code, it gives me a modeled
> xml file. (and i have clafer's xsd file too)
So you could also produce an Ecore model from the XSD in order to read
the XML as an EMF instance:
http://help.eclipse.org/kepler/index.jsp?topic=/org.eclipse.emf.doc/tutorials/xlibmod/xlibmod.html
Is that what you're doing?
>
> After that, i want to pass emf for generate java code of my domain
> model from this xml file. (more specifically for product line)
So for that you want to use Xpand. You might also use
http://www.eclipse.org/acceleo/ or http://www.eclipse.org/xtend/
>
> Hımm then i can M2M with .ext file. am i rigth ?
I believe so.
> cause i can call .ext functions on .xpt file ?
Yes.
> This is true ?
>
> Regards.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.04536 seconds