Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkhussey2007-09-04 11:28:34 -0400
committerkhussey2007-09-04 11:28:34 -0400
commitd101355cfd148c37e93cb9dbb170c4966b972370 (patch)
treee7ce483e2f369669b1d746012a64e58fbd3ad682 /plugins
parent1c9bc9948d6b91adfcc33ad000cab0a9a8c0ffcb (diff)
downloadorg.eclipse.uml2-d101355cfd148c37e93cb9dbb170c4966b972370.tar.gz
org.eclipse.uml2-d101355cfd148c37e93cb9dbb170c4966b972370.tar.xz
org.eclipse.uml2-d101355cfd148c37e93cb9dbb170c4966b972370.zip
[199624] Adding support for (de)serialization of UML resources to/from CMOF.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.uml2.uml.ecore.importer/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.uml2.uml.ecore.importer/plugin.xml4
-rw-r--r--plugins/org.eclipse.uml2.uml.ecore.importer/src/org/eclipse/uml2/uml/ecore/importer/UMLImporter.java24
3 files changed, 19 insertions, 11 deletions
diff --git a/plugins/org.eclipse.uml2.uml.ecore.importer/META-INF/MANIFEST.MF b/plugins/org.eclipse.uml2.uml.ecore.importer/META-INF/MANIFEST.MF
index 0a4060234..9d8d53442 100644
--- a/plugins/org.eclipse.uml2.uml.ecore.importer/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.uml2.uml.ecore.importer/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.uml2.uml.ecore.importer; singleton:=true
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 2.2.0.qualifier
Bundle-ClassPath: .
Bundle-Activator: org.eclipse.uml2.uml.ecore.importer.UMLImporterPlugin$Implementation
Bundle-Vendor: %providerName
diff --git a/plugins/org.eclipse.uml2.uml.ecore.importer/plugin.xml b/plugins/org.eclipse.uml2.uml.ecore.importer/plugin.xml
index f18c0e311..61abf74fe 100644
--- a/plugins/org.eclipse.uml2.uml.ecore.importer/plugin.xml
+++ b/plugins/org.eclipse.uml2.uml.ecore.importer/plugin.xml
@@ -11,7 +11,7 @@
Contributors:
IBM - initial API and implementation
- $Id: plugin.xml,v 1.4 2007/02/09 16:35:35 khussey Exp $
+ $Id: plugin.xml,v 1.5 2007/09/04 15:28:34 khussey Exp $
-->
<plugin>
@@ -21,7 +21,7 @@
id="org.eclipse.uml2.uml.ecore.importer"
name="%_UI_UMLImporter_label"
icon="platform:/plugin/org.eclipse.uml2.uml.editor/icons/full/obj16/UMLModelFile.gif"
- extensions="uml,uml2,xmi"
+ extensions="uml,uml2,xmi,cmof"
description="%_UI_UMLModelImporter_description"
wizard="org.eclipse.uml2.uml.ecore.importer.ui.UMLImporterWizard"/>
</extension>
diff --git a/plugins/org.eclipse.uml2.uml.ecore.importer/src/org/eclipse/uml2/uml/ecore/importer/UMLImporter.java b/plugins/org.eclipse.uml2.uml.ecore.importer/src/org/eclipse/uml2/uml/ecore/importer/UMLImporter.java
index f87e182d7..124eee68d 100644
--- a/plugins/org.eclipse.uml2.uml.ecore.importer/src/org/eclipse/uml2/uml/ecore/importer/UMLImporter.java
+++ b/plugins/org.eclipse.uml2.uml.ecore.importer/src/org/eclipse/uml2/uml/ecore/importer/UMLImporter.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: UMLImporter.java,v 1.11 2007/05/30 20:11:19 khussey Exp $
+ * $Id: UMLImporter.java,v 1.12 2007/09/04 15:28:34 khussey Exp $
*/
package org.eclipse.uml2.uml.ecore.importer;
@@ -41,9 +41,12 @@ import org.eclipse.uml2.common.util.UML2Util;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Stereotype;
import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.resource.CMOF2UMLExtendedMetaData;
+import org.eclipse.uml2.uml.resource.CMOF2UMLResource;
import org.eclipse.uml2.uml.resource.UML22UMLExtendedMetaData;
import org.eclipse.uml2.uml.resource.UML22UMLResource;
import org.eclipse.uml2.uml.resource.UMLResource;
+import org.eclipse.uml2.uml.resource.XMI2UMLExtendedMetaData;
import org.eclipse.uml2.uml.resource.XMI2UMLResource;
import org.eclipse.uml2.uml.util.UMLUtil;
@@ -116,9 +119,8 @@ public class UMLImporter
|| UMLUtil.OPTION__PROCESS
.equals(options
.get(UMLUtil.UML2EcoreConverter.OPTION__SUBSETTING_PROPERTIES))
- || UMLUtil.OPTION__PROCESS
- .equals(options
- .get(UMLUtil.UML2EcoreConverter.OPTION__OPERATION_BODIES))
+ || UMLUtil.OPTION__PROCESS.equals(options
+ .get(UMLUtil.UML2EcoreConverter.OPTION__OPERATION_BODIES))
|| UMLUtil.OPTION__PROCESS.equals(options
.get(UMLUtil.UML2EcoreConverter.OPTION__UNION_PROPERTIES))) {
@@ -233,7 +235,7 @@ public class UMLImporter
if (Diagnostic.INFO < diagnostics.getSeverity()) {
diagnostic = diagnostics;
}
-
+
if (Diagnostic.ERROR > diagnostics.getSeverity()) {
adjustEPackages(monitor);
}
@@ -309,7 +311,8 @@ public class UMLImporter
if (value.endsWith('.' + UMLResource.FILE_EXTENSION)
|| value.endsWith('.' + UML22UMLResource.FILE_EXTENSION)
- || value.endsWith('.' + XMI2UMLResource.FILE_EXTENSION)) {
+ || value.endsWith('.' + XMI2UMLResource.FILE_EXTENSION)
+ || value.endsWith('.' + CMOF2UMLResource.FILE_EXTENSION)) {
text.append(makeAbsolute(URI.createURI(value), genModelURI)
.toString());
@@ -344,9 +347,14 @@ public class UMLImporter
UML22UMLResource.Factory.INSTANCE);
extensionToFactoryMap.put(XMI2UMLResource.FILE_EXTENSION,
XMI2UMLResource.Factory.INSTANCE);
+ extensionToFactoryMap.put(CMOF2UMLResource.FILE_EXTENSION,
+ CMOF2UMLResource.Factory.INSTANCE);
+
+ Map<URI, URI> uriMap = resourceSet.getURIConverter().getURIMap();
- resourceSet.getURIConverter().getURIMap().putAll(
- UML22UMLExtendedMetaData.getURIMap());
+ uriMap.putAll(UML22UMLExtendedMetaData.getURIMap());
+ uriMap.putAll(XMI2UMLExtendedMetaData.getURIMap());
+ uriMap.putAll(CMOF2UMLExtendedMetaData.getURIMap());
return resourceSet;
}

Back to the top