Skip to main content



      Home
Home » Modeling » EMF » Creating an Instance on ModelPackage; Extension Point
Creating an Instance on ModelPackage; Extension Point [message #431660] Tue, 21 July 2009 04:29 Go to next message
Eclipse UserFriend
Hi,

I defined an Extension Point which I would like to use for EPackage
(attribute "class"). I think the EP is ok. But if I want to create an
instance of an EPackage, in this case ModelPackage, using this statement

Object o = e.createExecutableExtension("class");

the following Exception appears

org.eclipse.core.runtime.CoreException: Plug-in "org.xxx.yyy.model" was
unable to instantiate class "org.xxx.yyy.model.impl.ModelPackageImpl".

The class ModelPackageImpl is a EPackageIml and is generated by EMF.

I used this EP for other classes, for example EFactory, and it works. But
I can not instanciate EPackage.

Can somebody please tell me what is the problem? Or am I doing something
wrong?

Thank you very much,

RCH
Re: Creating an Instance on ModelPackage; Extension Point [message #431667 is a reply to message #431660] Tue, 21 July 2009 08:00 Go to previous messageGo to next message
Eclipse UserFriend
RCH schrieb:
> Hi,
>
> I defined an Extension Point which I would like to use for EPackage
> (attribute "class").
Why don't you use the global EPackage.Registry.INSTANCE? Generated
packages are automatically contributed to this registry in a lazy manner.

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper


> I think the EP is ok. But if I want to create an instance of an
> EPackage, in this case ModelPackage, using this statement
>
> Object o = e.createExecutableExtension("class");
>
> the following Exception appears
>
> org.eclipse.core.runtime.CoreException: Plug-in "org.xxx.yyy.model"
> was unable to instantiate class
> "org.xxx.yyy.model.impl.ModelPackageImpl".
>
> The class ModelPackageImpl is a EPackageIml and is generated by EMF.
>
> I used this EP for other classes, for example EFactory, and it works.
> But I can not instanciate EPackage.
>
> Can somebody please tell me what is the problem? Or am I doing
> something wrong?
>
> Thank you very much,
>
> RCH
>
Re: Creating an Instance on ModelPackage; Extension Point [message #431683 is a reply to message #431667] Tue, 21 July 2009 10:27 Go to previous message
Eclipse UserFriend
Thank you very much.
I tried using the registered instance and it works.
Previous Topic:Possible to configure the xml-structure of an ecore-model instance?
Next Topic:dynamically generate EMF editor from a metamodel
Goto Forum:
  


Current Time: Wed Jul 23 16:21:28 EDT 2025

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

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

Back to the top