EMF : get Eclass from ClassifierID [message #641649] |
Fri, 26 November 2010 08:37  |
Eclipse User |
|
|
|
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 09:46  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.04817 seconds