svn commit: r17123 - trunk/src: argouml-core-model-euml/src/org/argouml/model/euml argouml-core-model-mdr/src/org/argouml/model/mdr argouml-core-model/src/org/argouml/model

Thomas Neustupny <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: thn
Date: 2009-04-24 00:20:09-0700
New Revision: 17123

Modified:
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java
   trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java
   trunk/src/argouml-core-model/src/org/argouml/model/CoreHelper.java

Log:
UML2: support for raised exceptions
(obtained from arueckert)

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java?view=diff&pathrev=17123&r1=17122&r2=17123
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java	2009-04-24 00:20:09-0700
@@ -413,6 +413,16 @@
         throw new NotYetImplementedException();
     }
 
+    public void addRaisedException(Object handle, Object exception) {
+        if (!(handle instanceof Operation)) {
+            throw new IllegalArgumentException( "The operation must be an instance of Operation");
+        }
+        if (!(exception instanceof Type)) {
+            throw new IllegalArgumentException( "The exception must be an instance of Type");
+        }
+        (((Operation)handle).getRaisedExceptions()).add((Type)exception);
+    }
+    
     public void addSourceFlow(Object handle, Object flow) {
         // TODO: implement
         throw new NotYetImplementedException();

Modified: trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java?view=diff&pathrev=17123&r1=17122&r2=17123
==============================================================================
--- trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java	(original)
+++ trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java	2009-04-24 00:20:09-0700
@@ -2435,6 +2435,16 @@
                 + sig);
     }
 
+    /**
+     *  Dummy method for exceptions in MDR metamodel.
+     *  
+     * @author Andreas Rueckert <[email protected]>
+     *  
+     * @see org.argouml.model.CoreHelper#addRaisedException(java.lang.Object, java.lang.Object)
+     */
+    public void addRaisedException(Object handle, Object Exception) {
+        throw new NotImplementedException( "UML 1.4 has no exceptions for operations");
+    }
 
     public void addSourceFlow(Object handle, Object flow) {
         if (handle instanceof ModelElement && flow instanceof Flow) {

Modified: trunk/src/argouml-core-model/src/org/argouml/model/CoreHelper.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model/src/org/argouml/model/CoreHelper.java?view=diff&pathrev=17123&r1=17122&r2=17123
==============================================================================
--- trunk/src/argouml-core-model/src/org/argouml/model/CoreHelper.java	(original)
+++ trunk/src/argouml-core-model/src/org/argouml/model/CoreHelper.java	2009-04-24 00:20:09-0700
@@ -743,12 +743,20 @@
     void addQualifier(Object handle, int position, Object qualifier);
 
     /**
-     * Add a raised Signal to a Message or Operation.
+     * Add a raised Signal to a Message.
      *
      * @param handle the Message or Operation
      * @param sig the Signal that is raised
      */
     void addRaisedSignal(Object handle, Object sig);
+    
+    /**
+     * Add a raised exception to a Operation.
+     *
+     * @param handle the Operation
+     * @param exception the raised exception.
+     */
+    void addRaisedException(Object handle, Object exception);
 
     /**
      * Add a source flow to a ModelElement.

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=1887773

To unsubscribe from this discussion, e-mail: [[email protected]].
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.