Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenn Hussey2011-11-28 15:41:10 +0000
committerKenn Hussey2011-11-28 15:41:10 +0000
commitbaebd8cde168787a8e9bd6c5901232d06a3f5bb2 (patch)
tree7fa9e8f46035452bfeafcff92ccf126fc859aabf /plugins/org.eclipse.uml2.uml
parentc6d3e218f8ecd5f67ddc837e2f240962956ca760 (diff)
downloadorg.eclipse.uml2.test-baebd8cde168787a8e9bd6c5901232d06a3f5bb2.tar.gz
org.eclipse.uml2.test-baebd8cde168787a8e9bd6c5901232d06a3f5bb2.tar.xz
org.eclipse.uml2.test-baebd8cde168787a8e9bd6c5901232d06a3f5bb2.zip
[351774] Updating interchange support based on UML 2.4.1.
Diffstat (limited to 'plugins/org.eclipse.uml2.uml')
-rw-r--r--plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/CMOF2UMLHandler.java8
-rw-r--r--plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/CMOF2UMLResourceFactoryImpl.java33
-rw-r--r--plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UMLResourceFactoryImpl.java4
-rw-r--r--plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UMLSaveImpl.java29
-rw-r--r--plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLHandler.java40
-rw-r--r--plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLResourceFactoryImpl.java5
-rw-r--r--plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLSaveImpl.java5
-rw-r--r--plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/CMOF2UMLResource.java18
-rw-r--r--plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML212UMLResourceHandler.java56
-rw-r--r--plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML22UMLResourceHandler.java57
-rw-r--r--plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML302UMLResourceHandler.java55
-rw-r--r--plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/XMI2UMLExtendedMetaData.java14
-rw-r--r--plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/XMI2UMLResource.java42
13 files changed, 312 insertions, 54 deletions
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/CMOF2UMLHandler.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/CMOF2UMLHandler.java
index db68632a..8813360d 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/CMOF2UMLHandler.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/CMOF2UMLHandler.java
@@ -8,7 +8,7 @@
* Contributors:
* Kenn Hussey (IBM Corporation, Embarcadero Technologies) - initial API and implementation
* Kenn Hussey (Embarcadero Technologies) - 218388
- * Kenn Hussey (CEA) - 327039
+ * Kenn Hussey (CEA) - 327039, 351774
*
*/
package org.eclipse.uml2.uml.internal.resource;
@@ -44,7 +44,8 @@ public class CMOF2UMLHandler
protected void processElement(String name, String prefix, String localName) {
if (EMOFExtendedMetaData.EXTENSION.equals(localName)
- && XMI2UMLResource.XMI_NS_URI.equals(helper.getURI(prefix))
+ && (XMI2UMLResource.XMI_NS_URI.equals(helper.getURI(prefix)) || XMI2UMLResource.XMI_2_4_NS_URI
+ .equals(helper.getURI(prefix)))
&& attribs != null
&& UMLPackage.eNS_URI.equals(attribs
.getValue(EMOFExtendedMetaData.XMI_EXTENDER_ATTRIBUTE))) {
@@ -84,7 +85,8 @@ public class CMOF2UMLHandler
protected void handleProxy(InternalEObject proxy, String uriLiteral) {
if (uriLiteral
- .startsWith(CMOF2UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI)) {
+ .startsWith(CMOF2UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI) || uriLiteral
+ .startsWith(CMOF2UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_2_4_URI)) {
if (uriLiteral.endsWith(PRIMITIVE_TYPE_BOOLEAN)) {
uriLiteral = PRIMITIVE_TYPE_BOOLEAN_URI;
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/CMOF2UMLResourceFactoryImpl.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/CMOF2UMLResourceFactoryImpl.java
index 7fc5a437..a7cfdacd 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/CMOF2UMLResourceFactoryImpl.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/CMOF2UMLResourceFactoryImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007 IBM Corporation, Embarcadero Technologies, and others.
+ * Copyright (c) 2007, 2011 IBM Corporation, Embarcadero Technologies, CEA, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,8 +7,8 @@
*
* Contributors:
* Kenn Hussey (IBM Corporation, Embarcadero Technologies) - initial API and implementation
+ * Kenn Hussey (CEA) - 351774
*
- * $Id: CMOF2UMLResourceFactoryImpl.java,v 1.1 2007/09/04 15:28:48 khussey Exp $
*/
package org.eclipse.uml2.uml.internal.resource;
@@ -56,8 +56,12 @@ public class CMOF2UMLResourceFactoryImpl
EPackage.Registry ePackageRegistry = new EPackageRegistryImpl(
EPackage.Registry.INSTANCE);
+
ePackageRegistry.put(CMOF2UMLResource.CMOF_METAMODEL_NS_URI,
UMLPackage.eINSTANCE);
+ ePackageRegistry.put(CMOF2UMLResource.CMOF_2_4_METAMODEL_NS_URI,
+ UMLPackage.eINSTANCE);
+
ePackageRegistry
.put(
"platform:/plugin/org.eclipse.uml2.uml/model/UML.ecore", UMLPackage.eINSTANCE); //$NON-NLS-1$
@@ -67,17 +71,26 @@ public class CMOF2UMLResourceFactoryImpl
Ecore2XMLRegistry ecore2xmlRegistry = new Ecore2XMLRegistryImpl(
Ecore2XMLRegistry.INSTANCE);
+
ecore2xmlRegistry
.put(
CMOF2UMLResource.CMOF_METAMODEL_NS_URI,
- EcoreUtil
- .getObjectByType(
- resourceSet
- .getResource(
- URI
- .createURI("platform:/plugin/org.eclipse.uml2.uml/model/CMOF_2_UML.ecore2xml"), //$NON-NLS-1$
- true).getContents(),
- Ecore2XMLPackage.Literals.XML_MAP));
+ EcoreUtil.getObjectByType(
+ resourceSet
+ .getResource(
+ URI.createURI("platform:/plugin/org.eclipse.uml2.uml/model/CMOF_2_UML.ecore2xml"), //$NON-NLS-1$
+ true).getContents(),
+ Ecore2XMLPackage.Literals.XML_MAP));
+
+ ecore2xmlRegistry
+ .put(
+ CMOF2UMLResource.CMOF_2_4_METAMODEL_NS_URI,
+ EcoreUtil.getObjectByType(
+ resourceSet
+ .getResource(
+ URI.createURI("platform:/plugin/org.eclipse.uml2.uml/model/CMOF24_2_UML.ecore2xml"), //$NON-NLS-1$
+ true).getContents(),
+ Ecore2XMLPackage.Literals.XML_MAP));
ExtendedMetaData extendedMetaData = new CMOF2UMLExtendedMetaData(
ePackageRegistry, ecore2xmlRegistry);
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UMLResourceFactoryImpl.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UMLResourceFactoryImpl.java
index 01ebd59f..447efed5 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UMLResourceFactoryImpl.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UMLResourceFactoryImpl.java
@@ -7,7 +7,7 @@
*
* Contributors:
* IBM - initial API and implementation
- * Kenn Hussey (CEA) - 327039
+ * Kenn Hussey (CEA) - 327039, 351774
*
*/
package org.eclipse.uml2.uml.internal.resource;
@@ -64,7 +64,7 @@ public class UMLResourceFactoryImpl
public Resource createResource(URI uri) {
UMLResource resource = (UMLResource) createResourceGen(uri);
- resource.setXMIVersion("20100901"); //$NON-NLS-1$
+ resource.setXMIVersion("20110701"); //$NON-NLS-1$
Map<Object, Object> defaultLoadOptions = resource.getDefaultLoadOptions();
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UMLSaveImpl.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UMLSaveImpl.java
index 117bc2e0..34635957 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UMLSaveImpl.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/UMLSaveImpl.java
@@ -7,27 +7,56 @@
*
* Contributors:
* CEA - initial API and implementation
+ * Kenn Hussey (CEA) - 351774
*
*/
package org.eclipse.uml2.uml.internal.resource;
+import java.util.Map;
+
import org.eclipse.uml2.uml.EnumerationLiteral;
import org.eclipse.uml2.uml.UMLPackage;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
import org.eclipse.emf.ecore.xmi.XMLHelper;
+import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.emf.ecore.xmi.impl.XMISaveImpl;
public class UMLSaveImpl
extends XMISaveImpl {
+ protected static class Lookup
+ extends XMISaveImpl.Lookup {
+
+ public Lookup(XMLResource.XMLMap map, ExtendedMetaData extendedMetaData) {
+ super(map, extendedMetaData);
+ }
+
+ @Override
+ protected int featureKind(EStructuralFeature f) {
+ return f == UMLPackage.Literals.ACTIVITY__GROUP
+ || f == UMLPackage.Literals.ACTIVITY__NODE
+ ? OBJECT_HREF_MANY
+ : super.featureKind(f);
+ }
+
+ }
+
public UMLSaveImpl(XMLHelper helper) {
super(helper);
}
@Override
+ protected void init(XMLResource resource, Map<?, ?> options) {
+ super.init(resource, options);
+
+ featureTable = new Lookup(map, extendedMetaData);
+ }
+
+ @Override
protected void saveIDRefMany(EObject o, EStructuralFeature f) {
if (f == UMLPackage.Literals.INSTANCE_SPECIFICATION__CLASSIFIER && o instanceof EnumerationLiteral) {
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLHandler.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLHandler.java
index c1ef4ba6..c55dd135 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLHandler.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLHandler.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
* Kenn Hussey (Embarcadero Technologies) - 199624, 204202
- * Kenn Hussey (CEA) - 327039, 359964
+ * Kenn Hussey (CEA) - 327039, 359964, 351774
*
*/
package org.eclipse.uml2.uml.internal.resource;
@@ -70,27 +70,36 @@ public class XMI2UMLHandler
@Override
protected void handleProxy(InternalEObject proxy, String uriLiteral) {
- if (uriLiteral.startsWith(XMI2UMLResource.UML_METAMODEL_URI)) {
+ if (uriLiteral.startsWith(XMI2UMLResource.UML_METAMODEL_URI)
+ || uriLiteral.startsWith(XMI2UMLResource.UML_METAMODEL_2_4_URI)) {
int index = uriLiteral.indexOf('#');
uriLiteral = UMLResource.UML_METAMODEL_URI + (index == -1
? "#_0" //$NON-NLS-1$
: uriLiteral.substring(index));
} else if (uriLiteral
- .startsWith(XMI2UMLResource.STANDARD_L2_PROFILE_URI) || uriLiteral
- .startsWith(XMI2UMLResource.STANDARD_L2_PROFILE_2_2_URI)) {
+ .startsWith(XMI2UMLResource.STANDARD_L2_PROFILE_URI)
+ || uriLiteral
+ .startsWith(XMI2UMLResource.STANDARD_L2_PROFILE_2_4_URI)
+ || uriLiteral
+ .startsWith(XMI2UMLResource.STANDARD_L2_PROFILE_2_2_URI)) {
int index = uriLiteral.indexOf('#');
uriLiteral = UMLResource.STANDARD_L2_PROFILE_URI + (index == -1
? "#_0" //$NON-NLS-1$
: uriLiteral.substring(index));
} else if (uriLiteral
- .startsWith(XMI2UMLResource.STANDARD_L3_PROFILE_URI) || uriLiteral
- .startsWith(XMI2UMLResource.STANDARD_L3_PROFILE_2_2_URI)) {
+ .startsWith(XMI2UMLResource.STANDARD_L3_PROFILE_URI)
+ || uriLiteral
+ .startsWith(XMI2UMLResource.STANDARD_L3_PROFILE_2_4_URI)
+ || uriLiteral
+ .startsWith(XMI2UMLResource.STANDARD_L3_PROFILE_2_2_URI)) {
int index = uriLiteral.indexOf('#');
uriLiteral = UMLResource.STANDARD_L3_PROFILE_URI + (index == -1
? "#_0" //$NON-NLS-1$
: uriLiteral.substring(index));
} else if (uriLiteral
- .startsWith(XMI2UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI)) {
+ .startsWith(XMI2UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI)
+ || uriLiteral
+ .startsWith(XMI2UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_2_4_URI)) {
int index = uriLiteral.indexOf('#');
uriLiteral = UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI
+ (index == -1
@@ -105,7 +114,8 @@ public class XMI2UMLHandler
protected void processElement(String name, String prefix, String localName) {
if (EMOFExtendedMetaData.EXTENSION.equals(localName)
- && XMI2UMLResource.XMI_NS_URI.equals(helper.getURI(prefix))
+ && (XMI2UMLResource.XMI_NS_URI.equals(helper.getURI(prefix)) || XMI2UMLResource.XMI_2_4_NS_URI
+ .equals(helper.getURI(prefix)))
&& attribs != null
&& EcorePackage.eNS_URI.equals(attribs
.getValue(EMOFExtendedMetaData.XMI_EXTENDER_ATTRIBUTE))) {
@@ -168,26 +178,32 @@ public class XMI2UMLHandler
String uriLiteral = attribs.getValue(i);
if (uriLiteral
- .startsWith(XMI2UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI)) {
+ .startsWith(XMI2UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI)
+ || uriLiteral
+ .startsWith(XMI2UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_2_4_URI)) {
int index = uriLiteral.indexOf('#');
if (index != -1
&& TypesPackage.eINSTANCE
- .getEClassifier(uriLiteral.substring(index + 1)) instanceof EDataType) {
+ .getEClassifier(uriLiteral
+ .substring(index + 1)) instanceof EDataType) {
factory = UMLFactory.eINSTANCE;
newObject = createObjectFromFactory(factory,
UMLPackage.Literals.PRIMITIVE_TYPE
.getName());
}
} else if (uriLiteral
- .startsWith(XMI2UMLResource.UML_METAMODEL_URI)) {
+ .startsWith(XMI2UMLResource.UML_METAMODEL_URI)
+ || uriLiteral
+ .startsWith(XMI2UMLResource.UML_METAMODEL_2_4_URI)) {
int index = uriLiteral.indexOf('#');
if (index != -1
&& UMLPackage.eINSTANCE
- .getEClassifier(uriLiteral.substring(index + 1)) instanceof EClass) {
+ .getEClassifier(uriLiteral
+ .substring(index + 1)) instanceof EClass) {
factory = UMLFactory.eINSTANCE;
newObject = createObjectFromFactory(factory,
UMLPackage.Literals.CLASS.getName());
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLResourceFactoryImpl.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLResourceFactoryImpl.java
index dc62abf7..157ad4d0 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLResourceFactoryImpl.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLResourceFactoryImpl.java
@@ -7,7 +7,7 @@
*
* Contributors:
* IBM - initial API and implementation
- * Kenn Hussey (CEA) - 327039, 359983
+ * Kenn Hussey (CEA) - 327039, 359983, 351774
*
*/
package org.eclipse.uml2.uml.internal.resource;
@@ -48,8 +48,11 @@ public class XMI2UMLResourceFactoryImpl
EPackage.Registry ePackageRegistry = new EPackageRegistryImpl(
EPackage.Registry.INSTANCE);
+
ePackageRegistry.put(CMOF2UMLResource.CMOF_METAMODEL_NS_URI,
UMLPackage.eINSTANCE);
+ ePackageRegistry.put(CMOF2UMLResource.CMOF_2_4_METAMODEL_NS_URI,
+ UMLPackage.eINSTANCE);
ExtendedMetaData extendedMetaData = new XMI2UMLExtendedMetaData(
ePackageRegistry);
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLSaveImpl.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLSaveImpl.java
index 0156b8f0..32fbbbca 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLSaveImpl.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLSaveImpl.java
@@ -7,7 +7,7 @@
*
* Contributors:
* IBM - initial API and implementation
- * Kenn Hussey (CEA) - 327039
+ * Kenn Hussey (CEA) - 327039, 351774
*
*/
package org.eclipse.uml2.uml.internal.resource;
@@ -26,7 +26,6 @@ import org.eclipse.emf.ecore.util.ExtendedMetaData;
import org.eclipse.emf.ecore.xmi.XMLHelper;
import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.emf.ecore.xmi.impl.EMOFExtendedMetaData;
-import org.eclipse.emf.ecore.xmi.impl.XMISaveImpl;
import org.eclipse.uml2.common.util.UML2Util;
import org.eclipse.uml2.uml.NamedElement;
@@ -40,7 +39,7 @@ public class XMI2UMLSaveImpl
extends UMLSaveImpl {
protected static class Lookup
- extends XMISaveImpl.Lookup {
+ extends UMLSaveImpl.Lookup {
public Lookup(XMLResource.XMLMap map, ExtendedMetaData extendedMetaData) {
super(map, extendedMetaData);
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/CMOF2UMLResource.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/CMOF2UMLResource.java
index 6fce0749..8a02ca7d 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/CMOF2UMLResource.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/CMOF2UMLResource.java
@@ -8,7 +8,7 @@
* Contributors:
* Kenn Hussey (IBM Corporation) - initial API and implementation
* Kenn Hussey (Embarcadero Technologies) - 156879, 218388
- * Kenn Hussey (CEA) - 327039
+ * Kenn Hussey (CEA) - 327039, 351774
*
*/
package org.eclipse.uml2.uml.resource;
@@ -34,9 +34,13 @@ public interface CMOF2UMLResource
String CMOF_2_4_METAMODEL_NS_URI = "http://www.omg.org/spec/MOF/20100901"; //$NON-NLS-1$
- String CMOF_METAMODEL_URI = CMOF_2_4_METAMODEL_URI;
+ String CMOF_2_4_1_METAMODEL_URI = "http://www.omg.org/spec/MOF/20110701/cmof.xmi"; //$NON-NLS-1$
- String CMOF_METAMODEL_NS_URI = CMOF_2_4_METAMODEL_NS_URI;
+ String CMOF_2_4_1_METAMODEL_NS_URI = "http://www.omg.org/spec/MOF/20110701"; //$NON-NLS-1$
+
+ String CMOF_METAMODEL_URI = CMOF_2_4_1_METAMODEL_URI;
+
+ String CMOF_METAMODEL_NS_URI = CMOF_2_4_1_METAMODEL_NS_URI;
String CMOF_METAMODEL_NS_PREFIX = "cmof"; //$NON-NLS-1$
@@ -46,12 +50,16 @@ public interface CMOF2UMLResource
String CMOF_2_4_CONTENT_TYPE_IDENTIFIER = "org.omg.mof.cmof_2_4"; //$NON-NLS-1$
- String CMOF_CONTENT_TYPE_IDENTIFIER = CMOF_2_4_CONTENT_TYPE_IDENTIFIER;
+ String CMOF_2_4_1_CONTENT_TYPE_IDENTIFIER = "org.omg.mof.cmof_2_4_1"; //$NON-NLS-1$
+
+ String CMOF_CONTENT_TYPE_IDENTIFIER = CMOF_2_4_1_CONTENT_TYPE_IDENTIFIER;
String UML_PRIMITIVE_TYPES_LIBRARY_2_0_URI = "http://schema.omg.org/spec/UML/2.0/uml.xml"; //$NON-NLS-1$
String UML_PRIMITIVE_TYPES_LIBRARY_2_4_URI = "http://www.omg.org/spec/UML/20100901/PrimitiveTypes.xmi"; //$NON-NLS-1$
- String UML_PRIMITIVE_TYPES_LIBRARY_URI = UML_PRIMITIVE_TYPES_LIBRARY_2_4_URI;
+ String UML_PRIMITIVE_TYPES_LIBRARY_2_4_1_URI = "http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi"; //$NON-NLS-1$
+
+ String UML_PRIMITIVE_TYPES_LIBRARY_URI = UML_PRIMITIVE_TYPES_LIBRARY_2_4_1_URI;
}
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML212UMLResourceHandler.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML212UMLResourceHandler.java
index c642f0d5..3b9c7367 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML212UMLResourceHandler.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML212UMLResourceHandler.java
@@ -7,7 +7,7 @@
*
* Contributors:
* IBM - initial API and implementation
- * Kenn Hussey (CEA) - 327039
+ * Kenn Hussey (CEA) - 327039, 351774
*
*/
package org.eclipse.uml2.uml.resource;
@@ -16,6 +16,7 @@ import java.io.InputStream;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
+import java.util.ListIterator;
import java.util.Map;
import org.eclipse.emf.common.util.EList;
@@ -38,6 +39,9 @@ import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.emf.ecore.xmi.impl.BasicResourceHandler;
import org.eclipse.emf.ecore.xml.type.AnyType;
import org.eclipse.uml2.common.util.UML2Util;
+import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.ActivityGroup;
+import org.eclipse.uml2.uml.ActivityNode;
import org.eclipse.uml2.uml.Behavior;
import org.eclipse.uml2.uml.BehavioredClassifier;
import org.eclipse.uml2.uml.CallEvent;
@@ -58,6 +62,7 @@ import org.eclipse.uml2.uml.ProfileApplication;
import org.eclipse.uml2.uml.Property;
import org.eclipse.uml2.uml.SignalEvent;
import org.eclipse.uml2.uml.Stereotype;
+import org.eclipse.uml2.uml.StructuredActivityNode;
import org.eclipse.uml2.uml.TimeEvent;
import org.eclipse.uml2.uml.TimeExpression;
import org.eclipse.uml2.uml.UMLPackage;
@@ -366,6 +371,55 @@ public class UML212UMLResourceHandler
UMLSwitch<Object> umlSwitch = new UMLSwitch<Object>() {
@Override
+ public Object caseActivity(Activity activity) {
+ EList<StructuredActivityNode> structuredNodes = activity
+ .getStructuredNodes();
+
+ EList<ActivityGroup> groups = activity.getGroups();
+
+ for (ListIterator<ActivityGroup> ownedGroups = activity
+ .getOwnedGroups().listIterator(); ownedGroups.hasNext();) {
+
+ ActivityGroup group = (ActivityGroup) ownedGroups.next();
+
+ if (group instanceof StructuredActivityNode) {
+ ownedGroups.remove();
+ structuredNodes.add((StructuredActivityNode) group);
+ }
+
+ groups.add(group);
+ }
+
+ EList<ActivityNode> nodes = activity.getNodes();
+
+ for (ListIterator<ActivityNode> ownedNodes = activity
+ .getOwnedNodes().listIterator(); ownedNodes.hasNext();) {
+
+ ActivityNode node = (ActivityNode) ownedNodes.next();
+
+ if (node instanceof StructuredActivityNode) {
+ ownedNodes.remove();
+ structuredNodes.add((StructuredActivityNode) node);
+ }
+
+ nodes.add(node);
+ }
+
+ for (StructuredActivityNode structuredNode : structuredNodes) {
+
+ if (!groups.contains(structuredNode)) {
+ groups.add(structuredNode);
+ }
+
+ if (!nodes.contains(structuredNode)) {
+ nodes.add(structuredNode);
+ }
+ }
+
+ return super.caseActivity(activity);
+ }
+
+ @Override
public Object caseBehavior(Behavior behavior) {
if (!behavior.isSetIsReentrant()) {
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML22UMLResourceHandler.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML22UMLResourceHandler.java
index 1c0e2346..efd29d53 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML22UMLResourceHandler.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML22UMLResourceHandler.java
@@ -7,7 +7,7 @@
*
* Contributors:
* IBM - initial API and implementation
- * Kenn Hussey (CEA) - 327039
+ * Kenn Hussey (CEA) - 327039, 351774
*
*/
package org.eclipse.uml2.uml.resource;
@@ -51,6 +51,8 @@ import org.eclipse.uml2.common.util.UML2Util;
import org.eclipse.uml2.uml.AcceptEventAction;
import org.eclipse.uml2.uml.Action;
import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.ActivityGroup;
+import org.eclipse.uml2.uml.ActivityNode;
import org.eclipse.uml2.uml.Behavior;
import org.eclipse.uml2.uml.BehavioralFeature;
import org.eclipse.uml2.uml.BehavioredClassifier;
@@ -103,6 +105,7 @@ import org.eclipse.uml2.uml.State;
import org.eclipse.uml2.uml.StateMachine;
import org.eclipse.uml2.uml.Stereotype;
import org.eclipse.uml2.uml.StringExpression;
+import org.eclipse.uml2.uml.StructuredActivityNode;
import org.eclipse.uml2.uml.TemplateParameter;
import org.eclipse.uml2.uml.TemplateSignature;
import org.eclipse.uml2.uml.TimeEvent;
@@ -503,8 +506,8 @@ public class UML22UMLResourceHandler
"body", true); //$NON-NLS-1$
if (value instanceof String) {
- UMLUtil.setTaggedValue(activity, getUML2Stereotype(
- activity, STEREOTYPE__ACTIVITY),
+ UMLUtil.setTaggedValue(activity,
+ getUML2Stereotype(activity, STEREOTYPE__ACTIVITY),
TAG_DEFINITION__BODY, value);
}
@@ -512,13 +515,57 @@ public class UML22UMLResourceHandler
"language", true); //$NON-NLS-1$
if (value instanceof String) {
- UMLUtil.setTaggedValue(activity, getUML2Stereotype(
- activity, STEREOTYPE__ACTIVITY),
+ UMLUtil.setTaggedValue(activity,
+ getUML2Stereotype(activity, STEREOTYPE__ACTIVITY),
TAG_DEFINITION__LANGUAGE, value);
}
}
+ EList<StructuredActivityNode> structuredNodes = activity
+ .getStructuredNodes();
+
+ EList<ActivityGroup> groups = activity.getGroups();
+
+ for (ListIterator<ActivityGroup> ownedGroups = activity
+ .getOwnedGroups().listIterator(); ownedGroups.hasNext();) {
+
+ ActivityGroup group = (ActivityGroup) ownedGroups.next();
+
+ if (group instanceof StructuredActivityNode) {
+ ownedGroups.remove();
+ structuredNodes.add((StructuredActivityNode) group);
+ }
+
+ groups.add(group);
+ }
+
+ EList<ActivityNode> nodes = activity.getNodes();
+
+ for (ListIterator<ActivityNode> ownedNodes = activity
+ .getOwnedNodes().listIterator(); ownedNodes.hasNext();) {
+
+ ActivityNode node = (ActivityNode) ownedNodes.next();
+
+ if (node instanceof StructuredActivityNode) {
+ ownedNodes.remove();
+ structuredNodes.add((StructuredActivityNode) node);
+ }
+
+ nodes.add(node);
+ }
+
+ for (StructuredActivityNode structuredNode : structuredNodes) {
+
+ if (!groups.contains(structuredNode)) {
+ groups.add(structuredNode);
+ }
+
+ if (!nodes.contains(structuredNode)) {
+ nodes.add(structuredNode);
+ }
+ }
+
return super.caseActivity(activity);
}
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML302UMLResourceHandler.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML302UMLResourceHandler.java
index b4b93bfc..5a96f9e8 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML302UMLResourceHandler.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/UML302UMLResourceHandler.java
@@ -7,6 +7,7 @@
*
* Contributors:
* CEA - initial API and implementation
+ * Kenn Hussey (CEA) - 351774
*
*/
package org.eclipse.uml2.uml.resource;
@@ -15,9 +16,13 @@ import java.io.InputStream;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
+import java.util.ListIterator;
import java.util.Map;
import org.eclipse.uml2.common.util.UML2Util;
+import org.eclipse.uml2.uml.Activity;
+import org.eclipse.uml2.uml.ActivityGroup;
+import org.eclipse.uml2.uml.ActivityNode;
import org.eclipse.uml2.uml.Behavior;
import org.eclipse.uml2.uml.BehavioredClassifier;
import org.eclipse.uml2.uml.CallEvent;
@@ -38,6 +43,7 @@ import org.eclipse.uml2.uml.ProfileApplication;
import org.eclipse.uml2.uml.Property;
import org.eclipse.uml2.uml.SignalEvent;
import org.eclipse.uml2.uml.Stereotype;
+import org.eclipse.uml2.uml.StructuredActivityNode;
import org.eclipse.uml2.uml.UMLPackage;
import org.eclipse.uml2.uml.UMLPlugin;
import org.eclipse.uml2.uml.util.UMLSwitch;
@@ -348,6 +354,55 @@ public class UML302UMLResourceHandler
UMLSwitch<Object> umlSwitch = new UMLSwitch<Object>() {
@Override
+ public Object caseActivity(Activity activity) {
+ EList<StructuredActivityNode> structuredNodes = activity
+ .getStructuredNodes();
+
+ EList<ActivityGroup> groups = activity.getGroups();
+
+ for (ListIterator<ActivityGroup> ownedGroups = activity
+ .getOwnedGroups().listIterator(); ownedGroups.hasNext();) {
+
+ ActivityGroup group = (ActivityGroup) ownedGroups.next();
+
+ if (group instanceof StructuredActivityNode) {
+ ownedGroups.remove();
+ structuredNodes.add((StructuredActivityNode) group);
+ }
+
+ groups.add(group);
+ }
+
+ EList<ActivityNode> nodes = activity.getNodes();
+
+ for (ListIterator<ActivityNode> ownedNodes = activity
+ .getOwnedNodes().listIterator(); ownedNodes.hasNext();) {
+
+ ActivityNode node = (ActivityNode) ownedNodes.next();
+
+ if (node instanceof StructuredActivityNode) {
+ ownedNodes.remove();
+ structuredNodes.add((StructuredActivityNode) node);
+ }
+
+ nodes.add(node);
+ }
+
+ for (StructuredActivityNode structuredNode : structuredNodes) {
+
+ if (!groups.contains(structuredNode)) {
+ groups.add(structuredNode);
+ }
+
+ if (!nodes.contains(structuredNode)) {
+ nodes.add(structuredNode);
+ }
+ }
+
+ return super.caseActivity(activity);
+ }
+
+ @Override
public Object caseBehavior(Behavior behavior) {
if (!behavior.isSetIsReentrant()) {
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/XMI2UMLExtendedMetaData.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/XMI2UMLExtendedMetaData.java
index 9648e449..35881863 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/XMI2UMLExtendedMetaData.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/XMI2UMLExtendedMetaData.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
* Kenn Hussey (Embarcadero Technologies) - 204202
- * Kenn Hussey (CEA) - 327039
+ * Kenn Hussey (CEA) - 327039, 351774
*
*/
package org.eclipse.uml2.uml.resource;
@@ -37,6 +37,13 @@ public class XMI2UMLExtendedMetaData
URI.createURI(UMLResource.STANDARD_L2_PROFILE_URI));
uriMap.put(
+ URI.createURI(XMI2UMLResource.STANDARD_L3_PROFILE_2_4_URI),
+ URI.createURI(UMLResource.STANDARD_L3_PROFILE_URI));
+ uriMap.put(
+ URI.createURI(XMI2UMLResource.STANDARD_L2_PROFILE_2_4_URI),
+ URI.createURI(UMLResource.STANDARD_L2_PROFILE_URI));
+
+ uriMap.put(
URI.createURI(XMI2UMLResource.STANDARD_L3_PROFILE_2_2_URI),
URI.createURI(UMLResource.STANDARD_L3_PROFILE_URI));
uriMap.put(
@@ -84,12 +91,15 @@ public class XMI2UMLExtendedMetaData
public EPackage getPackage(String namespace) {
return XMI2UMLResource.UML_METAMODEL_NS_URI.equals(namespace)
+ || XMI2UMLResource.UML_METAMODEL_2_4_NS_URI.equals(namespace)
|| XMI2UMLResource.UML_METAMODEL_2_2_NS_URI.equals(namespace)
|| XMI2UMLResource.UML_METAMODEL_2_1_1_NS_URI.equals(namespace)
|| XMI2UMLResource.UML_METAMODEL_2_1_NS_URI.equals(namespace)
? UMLPackage.eINSTANCE
: super.getPackage(XMI2UMLResource.STANDARD_L2_PROFILE_NS_URI
.equals(namespace)
+ || XMI2UMLResource.STANDARD_L2_PROFILE_2_4_NS_URI
+ .equals(namespace)
|| XMI2UMLResource.STANDARD_L2_PROFILE_2_2_NS_URI
.equals(namespace)
|| XMI2UMLResource.STANDARD_L2_PROFILE_2_1_1_NS_URI
@@ -98,6 +108,8 @@ public class XMI2UMLExtendedMetaData
.equals(namespace)
? UMLResource.STANDARD_L2_PROFILE_NS_URI
: (XMI2UMLResource.STANDARD_L3_PROFILE_NS_URI.equals(namespace)
+ || XMI2UMLResource.STANDARD_L3_PROFILE_2_4_NS_URI
+ .equals(namespace)
|| XMI2UMLResource.STANDARD_L3_PROFILE_2_2_NS_URI
.equals(namespace)
|| XMI2UMLResource.STANDARD_L3_PROFILE_2_1_1_NS_URI
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/XMI2UMLResource.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/XMI2UMLResource.java
index 966a6d9a..9db5ab46 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/XMI2UMLResource.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/resource/XMI2UMLResource.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
* Kenn Hussey (Embarcadero Technologies) - 204202, 156879, 226397
- * Kenn Hussey (CEA) - 327039
+ * Kenn Hussey (CEA) - 327039, 351774
*
*/
package org.eclipse.uml2.uml.resource;
@@ -86,21 +86,37 @@ public interface XMI2UMLResource
String UML_PRIMITIVE_TYPES_LIBRARY_2_4_URI = "http://www.omg.org/spec/UML/20100901/PrimitiveTypes.xmi"; //$NON-NLS-1$
- String STANDARD_L2_PROFILE_NS_URI = STANDARD_L2_PROFILE_2_4_NS_URI;
+ String STANDARD_L2_PROFILE_2_4_1_NS_URI = "http://www.omg.org/spec/UML/20110701/StandardProfileL2"; //$NON-NLS-1$
- String STANDARD_L2_PROFILE_URI = STANDARD_L2_PROFILE_2_4_URI;
+ String STANDARD_L2_PROFILE_2_4_1_URI = "http://www.omg.org/spec/UML/20110701/StandardProfileL2.xmi"; //$NON-NLS-1$
- String STANDARD_L3_PROFILE_NS_URI = STANDARD_L3_PROFILE_2_4_NS_URI;
+ String STANDARD_L3_PROFILE_2_4_1_NS_URI = "http://www.omg.org/spec/UML/20110701/StandardProfileL3"; //$NON-NLS-1$
- String STANDARD_L3_PROFILE_URI = STANDARD_L3_PROFILE_2_4_URI;
+ String STANDARD_L3_PROFILE_2_4_1_URI = "http://www.omg.org/spec/UML/20110701/StandardProfileL3.xmi"; //$NON-NLS-1$
- String UML_METAMODEL_NS_URI = UML_METAMODEL_2_4_NS_URI;
+ String UML_METAMODEL_2_4_1_NS_URI = "http://www.omg.org/spec/UML/20110701"; //$NON-NLS-1$
- String UML_METAMODEL_URI = UML_METAMODEL_2_4_URI;
+ String UML_METAMODEL_2_4_1_URI = "http://www.omg.org/spec/UML/20110701/UML.xmi"; //$NON-NLS-1$
- String UML_PRIMITIVE_TYPES_LIBRARY_NS_URI = UML_PRIMITIVE_TYPES_LIBRARY_2_4_NS_URI;
+ String UML_PRIMITIVE_TYPES_LIBRARY_2_4_1_NS_URI = "http://www.omg.org/spec/PrimitiveTypes/20110701"; //$NON-NLS-1$
- String UML_PRIMITIVE_TYPES_LIBRARY_URI = UML_PRIMITIVE_TYPES_LIBRARY_2_4_URI;
+ String UML_PRIMITIVE_TYPES_LIBRARY_2_4_1_URI = "http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi"; //$NON-NLS-1$
+
+ String STANDARD_L2_PROFILE_NS_URI = STANDARD_L2_PROFILE_2_4_1_NS_URI;
+
+ String STANDARD_L2_PROFILE_URI = STANDARD_L2_PROFILE_2_4_1_URI;
+
+ String STANDARD_L3_PROFILE_NS_URI = STANDARD_L3_PROFILE_2_4_1_NS_URI;
+
+ String STANDARD_L3_PROFILE_URI = STANDARD_L3_PROFILE_2_4_1_URI;
+
+ String UML_METAMODEL_NS_URI = UML_METAMODEL_2_4_1_NS_URI;
+
+ String UML_METAMODEL_URI = UML_METAMODEL_2_4_1_URI;
+
+ String UML_PRIMITIVE_TYPES_LIBRARY_NS_URI = UML_PRIMITIVE_TYPES_LIBRARY_2_4_1_NS_URI;
+
+ String UML_PRIMITIVE_TYPES_LIBRARY_URI = UML_PRIMITIVE_TYPES_LIBRARY_2_4_1_URI;
String UML_2_1_CONTENT_TYPE_IDENTIFIER = "org.omg.uml_2_1"; //$NON-NLS-1$
@@ -110,12 +126,16 @@ public interface XMI2UMLResource
String UML_2_4_CONTENT_TYPE_IDENTIFIER = "org.omg.uml_2_4"; //$NON-NLS-1$
- String UML_CONTENT_TYPE_IDENTIFIER = UML_2_4_CONTENT_TYPE_IDENTIFIER; //$NON-NLS-1$
+ String UML_2_4_1_CONTENT_TYPE_IDENTIFIER = "org.omg.uml_2_4_1"; //$NON-NLS-1$
+
+ String UML_CONTENT_TYPE_IDENTIFIER = UML_2_4_1_CONTENT_TYPE_IDENTIFIER; //$NON-NLS-1$
String XMI_2_1_NS_URI = XMI_2_1_URI; //$NON-NLS-1$
String XMI_2_4_NS_URI = XMI_2_4_NAMESPACE_PREFIX + "20100901"; //$NON-NLS-1$
- String XMI_NS_URI = XMI_2_4_NS_URI;
+ String XMI_2_4_1_NS_URI = XMI_2_4_NAMESPACE_PREFIX + "20110701"; //$NON-NLS-1$
+
+ String XMI_NS_URI = XMI_2_4_1_NS_URI;
}

Back to the top