Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » createExtension() problem
createExtension() problem [message #627522] Sat, 25 April 2009 04:33
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'.
Previous Topic:XSD -> EMF -> UML
Next Topic:Importing XMI in Eclipse Modelling Tools
Goto Forum:
  


Current Time: Wed Apr 24 22:49:00 GMT 2024

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

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

Back to the top