javaeclipsecode-generationeclipse-emfeclipse-emf-ecore

How create Java code from Ecore metamodel without EMF jar dependences?


Is possible to generate Java code from an Ecore metamodel, without the dependencies of EMF? Generate "clean Code" as if it were a generation from a UML model.


Solution

  • The easy way is to set the GenModel option "Suppress EMF Types" in the "Model Feature Defaults" section of the top-level node... There are are hole set of relevant options. Refer to the EMF book (2nd edition), for the complete details.

    You can also use JET to generate you own Java code from the ECore model. Have a look at "Metamodeling with EMF: Generating concrete, reusable Java snippets" for a rather detailed description.