Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » What is the API equivalent of emf.Ecore2Java
What is the API equivalent of emf.Ecore2Java [message #640011] Thu, 18 November 2010 16:32 Go to next message
Lara Ziosi is currently offline Lara ZiosiFriend
Messages: 3
Registered: July 2009
Junior Member
I am given the requirement to write code (in a plugin) that performs the same task of invoking the ANT Task emf.Ecore2Java.
I could not figure out what is the correct API to invoke and how to provide the necessary parameters:
- location of ecore model
- location of gen model
I am considering invoking the ANT Task programmatically, but if I could just call the API directly that would be an easier solution.
Re: What is the API equivalent of emf.Ecore2Java [message #640026 is a reply to message #640011] Thu, 18 November 2010 17:05 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Lara,

You've looked at the source code for it?


Lara Ziosi wrote:
> I am given the requirement to write code (in a plugin) that performs
> the same task of invoking the ANT Task emf.Ecore2Java.
> I could not figure out what is the correct API to invoke and how to
> provide the necessary parameters:
> - location of ecore model
> - location of gen model
> I am considering invoking the ANT Task programmatically, but if I
> could just call the API directly that would be an easier solution.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: What is the API equivalent of emf.Ecore2Java [message #640126 is a reply to message #640026] Fri, 19 November 2010 09:13 Go to previous messageGo to next message
Lara Ziosi is currently offline Lara ZiosiFriend
Messages: 3
Registered: July 2009
Junior Member
Hi Ed,

I've been spending time over the API this week without getting very far. I understand that it is open source and self documenting however it is complex for a new user, hence this question.

I have seen that the Task uses the class:

org.eclipse.emf.importer.ecore.taskdefs.EcoreGeneratorTask

contained in the ANT Task separate jar file. This extends:

org.eclipse.emf.importer.ecore.EcoreImporterApplication

which in turn extends:

org.eclipse.emf.importer.ModelImporterApplication

from the plugin org.eclipse.emf.importer.

If I do not want to use the ANT infrastructure at all, which should be just unnecessary overhead in the case of a plugin, should I use ModelImporterApplication, and if so, what would be the required call sequence?

This has a number of methods that I do not clearly understand, such as adjustGenModel, handleEPackage etc.

Thank you for any hints that could put me on the right path.

Thank you, Lara






Re: What is the API equivalent of emf.Ecore2Java [message #640195 is a reply to message #640126] Fri, 19 November 2010 14:09 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Lara,



Lara Ziosi wrote:
> Hi Ed,
>
> I've been spending time over the API this week without getting very
> far. I understand that it is open source and self documenting however
> it is complex for a new user, hence this question.
>
> I have seen that the Task uses the class:
>
> org.eclipse.emf.importer.ecore.taskdefs.EcoreGeneratorTask
>
> contained in the ANT Task separate jar file. This extends:
>
> org.eclipse.emf.importer.ecore.EcoreImporterApplication
Yes, this is the reusable piece that's also used within the IDE for the
import wizard.
>
> which in turn extends:
>
> org.eclipse.emf.importer.ModelImporterApplication
>
> from the plugin org.eclipse.emf.importer.
>
> If I do not want to use the ANT infrastructure at all, which should be
> just unnecessary overhead in the case of a plugin, should I use
> ModelImporterApplication, and if so, what would be the required call
> sequence?
Yes you should. I'd suggest doing a bit more dynamic analysis. I.e.,
set breakpoint and watch how things are exercised from the import wizard
in the IDE.
>
> This has a number of methods that I do not clearly understand, such as
> adjustGenModel, handleEPackage etc.
It will be better to do dynamic analysis (watch it work in the debugger)
than static analysis (stare at the code and hope it becomes clear how
the methods get invoked in a running application).
>
> Thank you for any hints that could put me on the right path.
The debugger is your best friend.
>
> Thank you, Lara
>
>
>
>
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:UUID Error
Next Topic:[GWT] MAX_BLOB_SIZE = 100 ?
Goto Forum:
  


Current Time: Wed Apr 24 21:03:18 GMT 2024

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

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

Back to the top