Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenn Hussey2011-09-29 02:34:03 +0000
committerKenn Hussey2011-09-29 02:34:03 +0000
commitbdc5aaa066faf65feb8c5d27350e20821daf5afa (patch)
tree9a8c7f43f570de5aa4a55d2a5b88e64a5de9f5b7 /plugins/org.eclipse.uml2.uml
parentd1e8734654a958f67ab9330ea0ea99bb4292d4e5 (diff)
downloadorg.eclipse.uml2.test-bdc5aaa066faf65feb8c5d27350e20821daf5afa.tar.gz
org.eclipse.uml2.test-bdc5aaa066faf65feb8c5d27350e20821daf5afa.tar.xz
org.eclipse.uml2.test-bdc5aaa066faf65feb8c5d27350e20821daf5afa.zip
[358792] Adding built-in type mapping and generator model support for
UML primitive types.
Diffstat (limited to 'plugins/org.eclipse.uml2.uml')
-rw-r--r--plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/util/UMLUtil.java29
1 files changed, 27 insertions, 2 deletions
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/util/UMLUtil.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/util/UMLUtil.java
index 1916e034..e6d8756d 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/util/UMLUtil.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/util/UMLUtil.java
@@ -10,10 +10,9 @@
* Kenn Hussey (Embarcadero Technologies) - 199624, 184249, 204406, 208125, 204200, 213218, 213903, 220669, 208016, 226396, 271470
* Nicolas Rouquette (JPL) - 260120, 313837
* Kenn Hussey - 286329, 313601, 314971, 344907, 236184
- * Kenn Hussey (CEA) - 327039
+ * Kenn Hussey (CEA) - 327039, 358792
* Yann Tanguy (CEA) - 350402
*
- * $Id: UMLUtil.java,v 1.89 2011/05/06 01:42:10 khussey Exp $
*/
package org.eclipse.uml2.uml.util;
@@ -2550,6 +2549,9 @@ public class UMLUtil
eType = EcorePackage.eINSTANCE.getEClassifier(type
.getName());
+ } else if (qualifiedName.startsWith("PrimitiveTypes::")) { //$NON-NLS-1$
+ eType = TypesPackage.eINSTANCE.getEClassifier(type
+ .getName());
} else if (qualifiedName.startsWith("XMLPrimitiveTypes::")) { //$NON-NLS-1$
eType = XMLTypePackage.eINSTANCE.getEClassifier(type
.getName());
@@ -6225,6 +6227,18 @@ public class UMLUtil
return null;
}
+ protected Model getUMLPrimitiveTypesLibrary(EModelElement eModelElement) {
+ ResourceSet resourceSet = getResourceSet(eModelElement);
+
+ if (resourceSet != null) {
+ return load(resourceSet,
+ URI.createURI(UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI),
+ UMLPackage.Literals.MODEL);
+ }
+
+ return null;
+ }
+
protected Model getXMLPrimitiveTypesLibrary(EModelElement eModelElement) {
ResourceSet resourceSet = getResourceSet(eModelElement);
@@ -6246,6 +6260,15 @@ public class UMLUtil
: null;
}
+ protected PrimitiveType getUMLPrimitiveType(
+ EModelElement eModelElement, String name) {
+ Model umlPrimitiveTypesLibrary = getUMLPrimitiveTypesLibrary(eModelElement);
+
+ return umlPrimitiveTypesLibrary != null
+ ? (PrimitiveType) umlPrimitiveTypesLibrary.getOwnedType(name)
+ : null;
+ }
+
protected PrimitiveType getXMLPrimitiveType(
EModelElement eModelElement, String name) {
Model xmlPrimitiveTypesLibrary = getXMLPrimitiveTypesLibrary(eModelElement);
@@ -6273,6 +6296,8 @@ public class UMLUtil
if (XMLTypePackage.eNS_URI.equals(nsURI)) {
type = getXMLPrimitiveType(eModelElement, name);
+ } else if (TypesPackage.eNS_URI.equals(nsURI)) {
+ type = getUMLPrimitiveType(eModelElement, name);
} else if (EcorePackage.eNS_URI.equals(nsURI)) {
type = getEcorePrimitiveType(eModelElement, name);
}

Back to the top