Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Creating new EObjects from XtextResource
Creating new EObjects from XtextResource [message #718393] Wed, 24 August 2011 04:10 Go to next message
Eclipse UserFriend
Hey guys,

with all the help from the forum, I managed to edit my model via EMF and get the results shown in the textual representation.
But what if I don't want to edit existing objects, but to add new objects?

Apparently I can't create any ...Impl because the constructor isn't visible. I guess I can create new objects via a factory, but I couldn't find anything about that :-/

Does anyone have an idea?
Thanks a lot... as always Smile

Best,
Daniel
Re: Creating new EObjects from XtextResource [message #718397 is a reply to message #718393] Wed, 24 August 2011 04:18 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

A factory for your metamodel is generated (or already exists). Use that.
Usually if your Language is called X, the factory is XFactory.

Alex
Re: Creating new EObjects from XtextResource [message #718403 is a reply to message #718397] Wed, 24 August 2011 04:33 Go to previous message
Eclipse UserFriend
Thanks for the fast reply Smile

XFactory.eINSTANCE.createY() should work I guess.
Previous Topic:[xtend2] cast of lists
Next Topic:[xtend] Question on "Create Functions"
Goto Forum:
  


Current Time: Sat Jul 05 17:31:15 EDT 2025

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

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

Back to the top