Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsEMF : get Eclass from ClassifierID
https://www.eclipse.org/forums/index.php/mv/msg/200959/641649/#msg_641649
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.]]>Sébastien Gandon2010-11-26T13:37:05-00:00Re: EMF : get Eclass from ClassifierID
https://www.eclipse.org/forums/index.php/mv/msg/200959/641658/#msg_641658
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 Merks2010-11-26T14:46:01-00:00