svn commit: r12796 - trunk/src/model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-06-08 12:32:54-0700
New Revision: 12796

Modified:
   trunk/src/model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java

Log:
Implement getMetaModelName

Modified: trunk/src/model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java?view=diff&rev=12796&p1=trunk/src/model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java&p2=trunk/src/model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java&r1=12795&r2=12796
==============================================================================
--- trunk/src/model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java	(original)
+++ trunk/src/model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java	2007-06-08 12:32:54-0700
@@ -29,6 +29,7 @@
 import java.util.Collection;
 
 import org.argouml.model.ExtensionMechanismsHelper;
+import org.eclipse.uml2.uml.Element;
 
 /**
  * The implementation of the ExtensionMechanismsHelper for EUML2.
@@ -75,10 +76,23 @@
     }
 
     public String getMetaModelName(Object m) {
-        // TODO Auto-generated method stub
-        return null;
+        if (m instanceof Element) {
+            return getMetaModelName(m.getClass());
+        }
+        throw new IllegalArgumentException("Not an Element");
+
     }
 
+    /**
+     * @param clazz
+     *            the UML class
+     * @return the meta name of the UML class
+     */
+    protected String getMetaModelName(Class clazz) {
+        return modelImpl.getMetaTypes().getName(clazz);
+    }
+    
+    
     public Object getStereotype(Object ns, Object stereo) {
         // TODO Auto-generated method stub
         return null;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.