Skip to main content



      Home
Home » Modeling » EMF » Generating ecore file from various sources
Generating ecore file from various sources [message #405657] Fri, 01 December 2006 03:44 Go to next message
Eclipse UserFriend
Hi,

The EMF generator model (genmodel) can be initialised from several
kinds of sources, including ecore files, Java interfaces and XML
schemas. The standard wizards supports selecting either of these,
before building the genmodel file. In my project I work with dynamic
EMF models and instances, so I cannot rely on the generator. But I
would still want to support e.g. XML schemas, in addition to the
native ecore files. Is it possible to convert the above mentioned
files directly to ecore (or rather, an in-memory EMF model), without
involving the generator? I have seen an example using XSDEcoreBuilder,
which builds a set of EPackages, but what I'm looking for is a more
generic approach. I've tried to understand the importer extension
point, but AFAIU this is tied to the generator.

Hallvard
Re: Generating ecore file from various sources [message #405663 is a reply to message #405657] Fri, 01 December 2006 06:05 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.
--------------020405010506040009040403
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Hallvard,

Have you seen this article yet?

Binding XML to Java
< http://www.theserverside.com/tt/articles/article.tss?l=Bindi ngXMLJava>

I'm not sure it gets more generic than XSDEcoreBuilder. I.e., an XML
Schema comes in and a corresponding Ecore model comes out. That seems
very generic. There's also a corresponding JavaEcoreBuilder which
processes the annotations from Java interface...

Don't confuse the GenModel with having to use the Generator. The
GenModel helps manage your Ecore models and their dependencies and the
importer framework helps manage both. For example, when processing Java
annotations you need the GenModels for the other models on which the
current model depends...

So in the end, I don't quite understand what you are looking for...


Hallvard Tr
Re: Generating ecore file from various sources [message #405664 is a reply to message #405663] Fri, 01 December 2006 07:01 Go to previous message
Eclipse UserFriend
Ed,

>Have you seen this article yet?
>
> Binding XML to Java
> < http://www.theserverside.com/tt/articles/article.tss?l=Bindi ngXMLJava>
>

Yes, this is my source of information about XSDEcoreBuilder. I agree
it is generic and handles XML sources well.

>There's also a corresponding JavaEcoreBuilder which
>processes the annotations from Java interface...

Aha.

>Don't confuse the GenModel with having to use the Generator. The
>GenModel helps manage your Ecore models and their dependencies and the
>importer framework helps manage both. For example, when processing Java
>annotations you need the GenModels for the other models on which the
>current model depends...
>
>So in the end, I don't quite understand what you are looking for...

You're right that I was confused. I found slides from EclipseCon 2006,
that explained the importer/exporter mechanism, which is (almost) what
I want. I now better understand the role of GenModel and its use
outside the context of the Generator. I was hoping for a slightly
simpler and leaner mechanism, perhaps at a layer beneath the
importer/exporter, but I accept that this isn't feasible.

Hallvard

>
>
>Hallvard Trætteberg wrote:
>> Hi,
>>
>> The EMF generator model (genmodel) can be initialised from several
>> kinds of sources, including ecore files, Java interfaces and XML
>> schemas. The standard wizards supports selecting either of these,
>> before building the genmodel file. In my project I work with dynamic
>> EMF models and instances, so I cannot rely on the generator. But I
>> would still want to support e.g. XML schemas, in addition to the
>> native ecore files. Is it possible to convert the above mentioned
>> files directly to ecore (or rather, an in-memory EMF model), without
>> involving the generator? I have seen an example using XSDEcoreBuilder,
>> which builds a set of EPackages, but what I'm looking for is a more
>> generic approach. I've tried to understand the importer extension
>> point, but AFAIU this is tied to the generator.
>>
>> Hallvard
>>
Previous Topic:Interrupt the removal of an element
Next Topic:creating Ecore from OMG XMI?
Goto Forum:
  


Current Time: Sun Sep 21 12:07:41 EDT 2025

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

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

Back to the top