Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Creating an Instance on ModelPackage; Extension Point
Creating an Instance on ModelPackage; Extension Point [message #431660] Tue, 21 July 2009 08:29 Go to next message
RCH is currently offline RCHFriend
Messages: 6
Registered: July 2009
Junior Member
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 12:00 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
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 14:27 Go to previous message
RCH is currently offline RCHFriend
Messages: 6
Registered: July 2009
Junior Member
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: Thu Apr 18 09:27:05 GMT 2024

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

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

Back to the top