Generating ecore file from various sources [message #405657] |
Fri, 01 December 2006 03:44  |
Eclipse User |
|
|
|
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 #405664 is a reply to message #405663] |
Fri, 01 December 2006 07:01  |
Eclipse User |
|
|
|
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
>>
|
|
|
Powered by
FUDForum. Page generated in 0.03061 seconds