Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Modeling (top-level project) » EMF : get Eclass from ClassifierID
EMF : get Eclass from ClassifierID [message #641649] Fri, 26 November 2010 13:37 Go to next message
Sébastien  Gandon is currently offline Sébastien GandonFriend
Messages: 184
Registered: July 2009
Senior Member
Hello,

I use the ClassifierID to identify some class type that I use in server-client application.
I need to recreate the model from the classifier ID that is create instances, using my factory but using ClassifierId.
Or the creation method all use EClass definition and not Classifier.
Is there any Utilities method or genereted method to create an Instance from the ClassifierID or to get the EClass instance from the classifier.
I have noticied that the Factory implementation already has a switch with the ClassifierID but embeded in a Create(EClass) method.
Re: EMF : get Eclass from ClassifierID [message #641658 is a reply to message #641649] Fri, 26 November 2010 14:46 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33107
Registered: July 2009
Senior Member
Sébastien,

Please use the EMF newsgroup (eclipse.tools.emf) for questions about
EMF. More comments below.

Sébastien Gandon wrote:
> Hello,
>
> I use the ClassifierID to identify some class type that I use in
> server-client application.
It's typically better to use the name, at least for any long term storage...
> I need to recreate the model from the classifier ID that is create
> instances, using my factory but using ClassifierId.
You'll need to know the package/factory as well then.
> Or the creation method all use EClass definition and not Classifier.
Yes, because an EClassifier can be either an EClass (instances of which
are EObjects) or an EDataType (instances of which can be any Java type).
> Is there any Utilities method or genereted method to create an
> Instance from the ClassifierID or to get the EClass instance from the
> classifier.
No, because creating an instance of an EDataType requires some
information from which to create it. E.g., you can't create a Integer
unless you specify the value it should have.
> I have noticied that the Factory implementation already has a switch
> with the ClassifierID but embeded in a Create(EClass) method.
Yes, it only covers the classifiers that represent classes.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:ANSI-C-model and dealing with redundant references
Next Topic:generics in ecore model
Goto Forum:
  


Current Time: Tue Mar 19 07:38:56 GMT 2024

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

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

Back to the top