Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » createExtension() problem
createExtension() problem [message #478333] Sat, 25 April 2009 04:33 Go to next message
Ramon Ribeiro Rabello is currently offline Ramon Ribeiro RabelloFriend
Messages: 2
Registered: July 2009
Junior Member
Hi mdt uml2 folks,

I've been working in profile transformations and would like to reference
both a custom metamodel (instead of UML2) and its metaclasses. So, I
converted the model to a metamodel selecting UML Editor -> Convert to ->
Metamodel and all the metaclasses automatically received a <<metaclass>>
stereotype.

But when i call the method createExtension() and pass as first argument a
metaclass (of type Class), an IllegalArgumentException is thrown:

Exception in thread "main" java.lang.IllegalArgumentException:
org.eclipse.uml2.uml.internal.impl.ClassImpl@1094d48 (name: PrimitiveType,
visibility: <unset>) (isLeaf: false, isAbstract: true) (isActive: false)
at
org.eclipse.uml2.uml.internal.operations.StereotypeOperation s.createExtension(StereotypeOperations.java:174)
at
org.eclipse.uml2.uml.internal.impl.StereotypeImpl.createExte nsion(StereotypeImpl.java:165)
at org.orcas.uml2.UML2Util.createExtension(UML2Util.java:180)
at
org.orcas.uml2.handlers.ClassHandler.handleElement(ClassHand ler.java:27)
at org.orcas.uml2.UML2Util.processPackage(UML2Util.java:122)
at
org.orcas.uml2.handlers.PackageHandler.handleElement(Package Handler.java:27)
at org.orcas.uml2.UML2Util.processResource(UML2Util.java:108)
at
org.orcas.uml2.handlers.PackageHandler.handleElement(Package Handler.java:25)
at org.orcas.uml2.UML2Util.processResource(UML2Util.java:108)
at
org.orcas.uml2.handlers.PackageHandler.handleElement(Package Handler.java:25)
at org.orcas.uml2.UML2Util.processResource(UML2Util.java:108)
at profilegenerator.ProfileGenerator.transform(ProfileGenerator .java:56)
at profilegenerator.ProfileGenerator.main(ProfileGenerator.java :69)

I called the metaclass.isMetaclass() method to confirm that metaclass is
really a metaclass and figured out that it prints 'false', indicating that
the metaclass argument passed to createExtension() is not in fact a real
metaclass. So, i would like to know what i have to do make the method
isMetaclass() prints 'true'.
Re: createExtension() problem [message #478355 is a reply to message #478333] Fri, 01 May 2009 20:30 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Class::isMetaclass() will return true if the 'metaclass' stereotype from the
standard profile is applied to the class.

- James.

"Ramon Ribeiro Rabello" <ramon.rabello@gmail.com> wrote in message
news:e68d85dade79f9b0cbb71f8d9452d860$1@www.eclipse.org...
> Hi mdt uml2 folks,
>
> I've been working in profile transformations and would like to reference
> both a custom metamodel (instead of UML2) and its metaclasses. So, I
> converted the model to a metamodel selecting UML Editor -> Convert to ->
> Metamodel and all the metaclasses automatically received a <<metaclass>>
> stereotype.
>
> But when i call the method createExtension() and pass as first argument a
> metaclass (of type Class), an IllegalArgumentException is thrown:
>
> Exception in thread "main" java.lang.IllegalArgumentException:
> org.eclipse.uml2.uml.internal.impl.ClassImpl@1094d48 (name: PrimitiveType,
> visibility: <unset>) (isLeaf: false, isAbstract: true) (isActive: false)
> at
> org.eclipse.uml2.uml.internal.operations.StereotypeOperation s.createExtension(StereotypeOperations.java:174)
> at
> org.eclipse.uml2.uml.internal.impl.StereotypeImpl.createExte nsion(StereotypeImpl.java:165)
> at org.orcas.uml2.UML2Util.createExtension(UML2Util.java:180)
> at
> org.orcas.uml2.handlers.ClassHandler.handleElement(ClassHand ler.java:27)
> at org.orcas.uml2.UML2Util.processPackage(UML2Util.java:122)
> at
> org.orcas.uml2.handlers.PackageHandler.handleElement(Package Handler.java:27)
> at org.orcas.uml2.UML2Util.processResource(UML2Util.java:108)
> at
> org.orcas.uml2.handlers.PackageHandler.handleElement(Package Handler.java:25)
> at org.orcas.uml2.UML2Util.processResource(UML2Util.java:108)
> at
> org.orcas.uml2.handlers.PackageHandler.handleElement(Package Handler.java:25)
> at org.orcas.uml2.UML2Util.processResource(UML2Util.java:108)
> at profilegenerator.ProfileGenerator.transform(ProfileGenerator .java:56)
> at profilegenerator.ProfileGenerator.main(ProfileGenerator.java :69)
>
> I called the metaclass.isMetaclass() method to confirm that metaclass is
> really a metaclass and figured out that it prints 'false', indicating that
> the metaclass argument passed to createExtension() is not in fact a real
> metaclass. So, i would like to know what i have to do make the method
> isMetaclass() prints 'true'.
>
Re: createExtension() problem [message #627542 is a reply to message #478333] Fri, 01 May 2009 20:30 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Class::isMetaclass() will return true if the 'metaclass' stereotype from the
standard profile is applied to the class.

- James.

"Ramon Ribeiro Rabello" <ramon.rabello@gmail.com> wrote in message
news:e68d85dade79f9b0cbb71f8d9452d860$1@www.eclipse.org...
> Hi mdt uml2 folks,
>
> I've been working in profile transformations and would like to reference
> both a custom metamodel (instead of UML2) and its metaclasses. So, I
> converted the model to a metamodel selecting UML Editor -> Convert to ->
> Metamodel and all the metaclasses automatically received a <<metaclass>>
> stereotype.
>
> But when i call the method createExtension() and pass as first argument a
> metaclass (of type Class), an IllegalArgumentException is thrown:
>
> Exception in thread "main" java.lang.IllegalArgumentException:
> org.eclipse.uml2.uml.internal.impl.ClassImpl@1094d48 (name: PrimitiveType,
> visibility: <unset>) (isLeaf: false, isAbstract: true) (isActive: false)
> at
> org.eclipse.uml2.uml.internal.operations.StereotypeOperation s.createExtension(StereotypeOperations.java:174)
> at
> org.eclipse.uml2.uml.internal.impl.StereotypeImpl.createExte nsion(StereotypeImpl.java:165)
> at org.orcas.uml2.UML2Util.createExtension(UML2Util.java:180)
> at
> org.orcas.uml2.handlers.ClassHandler.handleElement(ClassHand ler.java:27)
> at org.orcas.uml2.UML2Util.processPackage(UML2Util.java:122)
> at
> org.orcas.uml2.handlers.PackageHandler.handleElement(Package Handler.java:27)
> at org.orcas.uml2.UML2Util.processResource(UML2Util.java:108)
> at
> org.orcas.uml2.handlers.PackageHandler.handleElement(Package Handler.java:25)
> at org.orcas.uml2.UML2Util.processResource(UML2Util.java:108)
> at
> org.orcas.uml2.handlers.PackageHandler.handleElement(Package Handler.java:25)
> at org.orcas.uml2.UML2Util.processResource(UML2Util.java:108)
> at profilegenerator.ProfileGenerator.transform(ProfileGenerator .java:56)
> at profilegenerator.ProfileGenerator.main(ProfileGenerator.java :69)
>
> I called the metaclass.isMetaclass() method to confirm that metaclass is
> really a metaclass and figured out that it prints 'false', indicating that
> the metaclass argument passed to createExtension() is not in fact a real
> metaclass. So, i would like to know what i have to do make the method
> isMetaclass() prints 'true'.
>
Previous Topic:Profiling Sequence diagrams
Next Topic:Importing XMI in Eclipse Modelling Tools
Goto Forum:
  


Current Time: Fri Apr 19 07:54:57 GMT 2024

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

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

Back to the top