Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2018-11-01 06:01:57 -0400
committerEd Willink2018-11-07 04:58:51 -0500
commitbfaa69050f7a1b0ed4745a6b11d57555f88bad45 (patch)
treeec7da2368a9d66124779179469bcc468222c24d2
parent5b99c5dc2df58644724b29287c65e5c8af30acd7 (diff)
downloadorg.eclipse.qvtd-bfaa69050f7a1b0ed4745a6b11d57555f88bad45.tar.gz
org.eclipse.qvtd-bfaa69050f7a1b0ed4745a6b11d57555f88bad45.tar.xz
org.eclipse.qvtd-bfaa69050f7a1b0ed4745a6b11d57555f88bad45.zip
[540684] Elaborate XML model to reference Ecore model
-rw-r--r--plugins/org.eclipse.qvtd.xml/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/Attribute.java18
-rw-r--r--plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/ClassAttribute.java81
-rw-r--r--plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/ClassElement.java62
-rw-r--r--plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/DataTypeAttribute.java62
-rw-r--r--plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/DataTypeElement.java62
-rw-r--r--plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/Element.java18
-rw-r--r--plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/XMLmodelFactory.java36
-rw-r--r--plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/XMLmodelPackage.java626
-rw-r--r--plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/AttributeImpl.java24
-rw-r--r--plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/ClassAttributeImpl.java192
-rw-r--r--plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/ClassElementImpl.java152
-rw-r--r--plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/DataTypeAttributeImpl.java153
-rw-r--r--plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/DataTypeElementImpl.java154
-rw-r--r--plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/DocumentImpl.java8
-rw-r--r--plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/ElementImpl.java41
-rw-r--r--plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/XMLmodelFactoryImpl.java44
-rw-r--r--plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/XMLmodelPackageImpl.java165
-rw-r--r--plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/util/XMLmodelAdapterFactory.java78
-rw-r--r--plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/util/XMLmodelSwitch.java96
-rw-r--r--plugins/org.eclipse.qvtd.xml/model/XMLmodel.ecore215
-rw-r--r--plugins/org.eclipse.qvtd.xml/model/XMLmodel.genmodel15
-rw-r--r--plugins/org.eclipse.qvtd.xml/src/org/eclipse/qvtd/xml/utilities/XMLmodelResourceImpl.java550
-rw-r--r--tests/org.eclipse.qvtd.all.tests/models/Families2Persons.atl.xmi167
-rw-r--r--tests/org.eclipse.qvtd.all.tests/models/Families2Persons.qvtras.xmi201
-rw-r--r--tests/org.eclipse.qvtd.all.tests/src/org/eclipse/qvtd/all/tests/XMLmodelTests.java61
26 files changed, 3060 insertions, 223 deletions
diff --git a/plugins/org.eclipse.qvtd.xml/META-INF/MANIFEST.MF b/plugins/org.eclipse.qvtd.xml/META-INF/MANIFEST.MF
index 97cb00cfb..11e0736a4 100644
--- a/plugins/org.eclipse.qvtd.xml/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.qvtd.xml/META-INF/MANIFEST.MF
@@ -12,7 +12,7 @@ Export-Package: org.eclipse.qvtd.xml,
org.eclipse.qvtd.xml.util,
org.eclipse.qvtd.xml.utilities
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.emf.ecore;visibility:=reexport,
+ org.eclipse.emf.ecore;bundle-version="[2.7.0,3.0.0)";visibility:=reexport,
org.eclipse.emf.ecore.xmi;bundle-version="[2.7.0,3.0.0)";visibility:=reexport,
org.eclipse.jdt.annotation;bundle-version="[2.0.0,3.0.0)"
Bundle-ActivationPolicy: lazy
diff --git a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/Attribute.java b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/Attribute.java
index 5f5c6ed76..fa83850e9 100644
--- a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/Attribute.java
+++ b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/Attribute.java
@@ -14,6 +14,8 @@
*/
package org.eclipse.qvtd.xml;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
/**
* <!-- begin-user-doc -->
@@ -26,6 +28,7 @@ package org.eclipse.qvtd.xml;
* <ul>
* <li>{@link org.eclipse.qvtd.xml.Attribute#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.qvtd.xml.Attribute#getValue <em>Value</em>}</li>
+ * <li>{@link org.eclipse.qvtd.xml.Attribute#getEcoreFeature <em>Ecore Feature</em>}</li>
* </ul>
*
* @see org.eclipse.qvtd.xml.XMLmodelPackage#getAttribute()
@@ -85,4 +88,19 @@ public interface Attribute extends Node {
*/
void setValue(String value);
+ /**
+ * Returns the value of the '<em><b>Ecore Feature</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Ecore Feature</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Ecore Feature</em>' reference.
+ * @see org.eclipse.qvtd.xml.XMLmodelPackage#getAttribute_EcoreFeature()
+ * @model resolveProxies="false" transient="true" changeable="false" volatile="true" derived="true"
+ * @generated
+ */
+ EStructuralFeature getEcoreFeature();
+
} // Attribute
diff --git a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/ClassAttribute.java b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/ClassAttribute.java
new file mode 100644
index 000000000..13bb23e3e
--- /dev/null
+++ b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/ClassAttribute.java
@@ -0,0 +1,81 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2018 Willink Transformations and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v20.html
+ *
+ * Contributors:
+ * E.D.Willink - Initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.qvtd.xml;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Class Attribute</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.qvtd.xml.ClassAttribute#getEcoreReference <em>Ecore Reference</em>}</li>
+ * <li>{@link org.eclipse.qvtd.xml.ClassAttribute#getEObjects <em>EObjects</em>}</li>
+ * </ul>
+ *
+ * @see org.eclipse.qvtd.xml.XMLmodelPackage#getClassAttribute()
+ * @model
+ * @generated
+ */
+public interface ClassAttribute extends Attribute {
+ /**
+ * Returns the value of the '<em><b>Ecore Reference</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Ecore Reference</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Ecore Reference</em>' reference.
+ * @see #setEcoreReference(EReference)
+ * @see org.eclipse.qvtd.xml.XMLmodelPackage#getClassAttribute_EcoreReference()
+ * @model resolveProxies="false" required="true" transient="true"
+ * @generated
+ */
+ EReference getEcoreReference();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.qvtd.xml.ClassAttribute#getEcoreReference <em>Ecore Reference</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Ecore Reference</em>' reference.
+ * @see #getEcoreReference()
+ * @generated
+ */
+ void setEcoreReference(EReference value);
+
+ /**
+ * Returns the value of the '<em><b>EObjects</b></em>' reference list.
+ * The list contents are of type {@link org.eclipse.emf.ecore.EObject}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>EObjects</em>' reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>EObjects</em>' reference list.
+ * @see org.eclipse.qvtd.xml.XMLmodelPackage#getClassAttribute_EObjects()
+ * @model resolveProxies="false" required="true" transient="true"
+ * @generated
+ */
+ EList<EObject> getEObjects();
+
+} // ClassAttribute
diff --git a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/ClassElement.java b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/ClassElement.java
new file mode 100644
index 000000000..29dbc3d0c
--- /dev/null
+++ b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/ClassElement.java
@@ -0,0 +1,62 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2018 Willink Transformations and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v20.html
+ *
+ * Contributors:
+ * E.D.Willink - Initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.qvtd.xml;
+
+import org.eclipse.emf.ecore.EClass;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Class Element</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.qvtd.xml.ClassElement#getEcoreClass <em>Ecore Class</em>}</li>
+ * </ul>
+ *
+ * @see org.eclipse.qvtd.xml.XMLmodelPackage#getClassElement()
+ * @model
+ * @generated
+ */
+public interface ClassElement extends Element {
+ /**
+ * Returns the value of the '<em><b>Ecore Class</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Ecore Class</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Ecore Class</em>' reference.
+ * @see #setEcoreClass(EClass)
+ * @see org.eclipse.qvtd.xml.XMLmodelPackage#getClassElement_EcoreClass()
+ * @model resolveProxies="false" required="true" transient="true"
+ * @generated
+ */
+ EClass getEcoreClass();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.qvtd.xml.ClassElement#getEcoreClass <em>Ecore Class</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Ecore Class</em>' reference.
+ * @see #getEcoreClass()
+ * @generated
+ */
+ void setEcoreClass(EClass value);
+
+} // ClassElement
diff --git a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/DataTypeAttribute.java b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/DataTypeAttribute.java
new file mode 100644
index 000000000..8637bb1b4
--- /dev/null
+++ b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/DataTypeAttribute.java
@@ -0,0 +1,62 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2018 Willink Transformations and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v20.html
+ *
+ * Contributors:
+ * E.D.Willink - Initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.qvtd.xml;
+
+import org.eclipse.emf.ecore.EAttribute;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Data Type Attribute</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.qvtd.xml.DataTypeAttribute#getEcoreAttribute <em>Ecore Attribute</em>}</li>
+ * </ul>
+ *
+ * @see org.eclipse.qvtd.xml.XMLmodelPackage#getDataTypeAttribute()
+ * @model
+ * @generated
+ */
+public interface DataTypeAttribute extends Attribute {
+ /**
+ * Returns the value of the '<em><b>Ecore Attribute</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Ecore Attribute</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Ecore Attribute</em>' reference.
+ * @see #setEcoreAttribute(EAttribute)
+ * @see org.eclipse.qvtd.xml.XMLmodelPackage#getDataTypeAttribute_EcoreAttribute()
+ * @model resolveProxies="false" required="true" transient="true"
+ * @generated
+ */
+ EAttribute getEcoreAttribute();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.qvtd.xml.DataTypeAttribute#getEcoreAttribute <em>Ecore Attribute</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Ecore Attribute</em>' reference.
+ * @see #getEcoreAttribute()
+ * @generated
+ */
+ void setEcoreAttribute(EAttribute value);
+
+} // DataTypeAttribute
diff --git a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/DataTypeElement.java b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/DataTypeElement.java
new file mode 100644
index 000000000..e427aea05
--- /dev/null
+++ b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/DataTypeElement.java
@@ -0,0 +1,62 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2018 Willink Transformations and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v20.html
+ *
+ * Contributors:
+ * E.D.Willink - Initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.qvtd.xml;
+
+import org.eclipse.emf.ecore.EDataType;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Data Type Element</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.qvtd.xml.DataTypeElement#getEcoreDataType <em>Ecore Data Type</em>}</li>
+ * </ul>
+ *
+ * @see org.eclipse.qvtd.xml.XMLmodelPackage#getDataTypeElement()
+ * @model
+ * @generated
+ */
+public interface DataTypeElement extends Element {
+ /**
+ * Returns the value of the '<em><b>Ecore Data Type</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Ecore Data Type</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Ecore Data Type</em>' reference.
+ * @see #setEcoreDataType(EDataType)
+ * @see org.eclipse.qvtd.xml.XMLmodelPackage#getDataTypeElement_EcoreDataType()
+ * @model resolveProxies="false" required="true" transient="true"
+ * @generated
+ */
+ EDataType getEcoreDataType();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.qvtd.xml.DataTypeElement#getEcoreDataType <em>Ecore Data Type</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Ecore Data Type</em>' reference.
+ * @see #getEcoreDataType()
+ * @generated
+ */
+ void setEcoreDataType(EDataType value);
+
+} // DataTypeElement
diff --git a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/Element.java b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/Element.java
index 408167901..4801d0bac 100644
--- a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/Element.java
+++ b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/Element.java
@@ -14,6 +14,8 @@
*/
package org.eclipse.qvtd.xml;
+import org.eclipse.emf.ecore.EClassifier;
+
/**
* <!-- begin-user-doc -->
@@ -27,6 +29,7 @@ package org.eclipse.qvtd.xml;
* <li>{@link org.eclipse.qvtd.xml.Element#getLocalName <em>Local Name</em>}</li>
* <li>{@link org.eclipse.qvtd.xml.Element#getQName <em>QName</em>}</li>
* <li>{@link org.eclipse.qvtd.xml.Element#getUri <em>Uri</em>}</li>
+ * <li>{@link org.eclipse.qvtd.xml.Element#getEcoreClassifier <em>Ecore Classifier</em>}</li>
* </ul>
*
* @see org.eclipse.qvtd.xml.XMLmodelPackage#getElement()
@@ -112,4 +115,19 @@ public interface Element extends Node {
*/
void setUri(String value);
+ /**
+ * Returns the value of the '<em><b>Ecore Classifier</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Ecore Classifier</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Ecore Classifier</em>' reference.
+ * @see org.eclipse.qvtd.xml.XMLmodelPackage#getElement_EcoreClassifier()
+ * @model resolveProxies="false" transient="true" changeable="false" volatile="true" derived="true"
+ * @generated
+ */
+ EClassifier getEcoreClassifier();
+
} // Element
diff --git a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/XMLmodelFactory.java b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/XMLmodelFactory.java
index 79bdd1712..44fa1839e 100644
--- a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/XMLmodelFactory.java
+++ b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/XMLmodelFactory.java
@@ -61,6 +61,24 @@ public interface XMLmodelFactory extends EFactory {
Characters createCharacters();
/**
+ * Returns a new object of class '<em>Class Attribute</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Class Attribute</em>'.
+ * @generated
+ */
+ ClassAttribute createClassAttribute();
+
+ /**
+ * Returns a new object of class '<em>Class Element</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Class Element</em>'.
+ * @generated
+ */
+ ClassElement createClassElement();
+
+ /**
* Returns a new object of class '<em>Comment</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -79,6 +97,24 @@ public interface XMLmodelFactory extends EFactory {
DTD createDTD();
/**
+ * Returns a new object of class '<em>Data Type Attribute</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Data Type Attribute</em>'.
+ * @generated
+ */
+ DataTypeAttribute createDataTypeAttribute();
+
+ /**
+ * Returns a new object of class '<em>Data Type Element</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Data Type Element</em>'.
+ * @generated
+ */
+ DataTypeElement createDataTypeElement();
+
+ /**
* Returns a new object of class '<em>Document</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/XMLmodelPackage.java b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/XMLmodelPackage.java
index 59de0f4a2..7cadfe74a 100644
--- a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/XMLmodelPackage.java
+++ b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/XMLmodelPackage.java
@@ -77,7 +77,7 @@ public interface XMLmodelPackage extends EPackage {
* @see org.eclipse.qvtd.xml.impl.XMLmodelPackageImpl#getNode()
* @generated
*/
- int NODE = 8;
+ int NODE = 12;
/**
* The feature id for the '<em><b>Children</b></em>' containment reference list.
@@ -144,13 +144,22 @@ public interface XMLmodelPackage extends EPackage {
int ATTRIBUTE__VALUE = NODE_FEATURE_COUNT + 1;
/**
+ * The feature id for the '<em><b>Ecore Feature</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE__ECORE_FEATURE = NODE_FEATURE_COUNT + 2;
+
+ /**
* The number of structural features of the '<em>Attribute</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int ATTRIBUTE_FEATURE_COUNT = NODE_FEATURE_COUNT + 2;
+ int ATTRIBUTE_FEATURE_COUNT = NODE_FEATURE_COUNT + 3;
/**
* The number of operations of the '<em>Attribute</em>' class.
@@ -245,6 +254,88 @@ public interface XMLmodelPackage extends EPackage {
int CHARACTERS_OPERATION_COUNT = NODE_OPERATION_COUNT + 0;
/**
+ * The meta object id for the '{@link org.eclipse.qvtd.xml.impl.ClassAttributeImpl <em>Class Attribute</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.qvtd.xml.impl.ClassAttributeImpl
+ * @see org.eclipse.qvtd.xml.impl.XMLmodelPackageImpl#getClassAttribute()
+ * @generated
+ */
+ int CLASS_ATTRIBUTE = 3;
+
+ /**
+ * The feature id for the '<em><b>Children</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_ATTRIBUTE__CHILDREN = ATTRIBUTE__CHILDREN;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_ATTRIBUTE__NAME = ATTRIBUTE__NAME;
+
+ /**
+ * The feature id for the '<em><b>Value</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_ATTRIBUTE__VALUE = ATTRIBUTE__VALUE;
+
+ /**
+ * The feature id for the '<em><b>Ecore Feature</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_ATTRIBUTE__ECORE_FEATURE = ATTRIBUTE__ECORE_FEATURE;
+
+ /**
+ * The feature id for the '<em><b>Ecore Reference</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_ATTRIBUTE__ECORE_REFERENCE = ATTRIBUTE_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>EObjects</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_ATTRIBUTE__EOBJECTS = ATTRIBUTE_FEATURE_COUNT + 1;
+
+ /**
+ * The number of structural features of the '<em>Class Attribute</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_ATTRIBUTE_FEATURE_COUNT = ATTRIBUTE_FEATURE_COUNT + 2;
+
+ /**
+ * The number of operations of the '<em>Class Attribute</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_ATTRIBUTE_OPERATION_COUNT = ATTRIBUTE_OPERATION_COUNT + 0;
+
+ /**
* The meta object id for the '{@link org.eclipse.qvtd.xml.impl.CommentImpl <em>Comment</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -252,7 +343,202 @@ public interface XMLmodelPackage extends EPackage {
* @see org.eclipse.qvtd.xml.impl.XMLmodelPackageImpl#getComment()
* @generated
*/
- int COMMENT = 3;
+ int COMMENT = 5;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.qvtd.xml.impl.DTDImpl <em>DTD</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.qvtd.xml.impl.DTDImpl
+ * @see org.eclipse.qvtd.xml.impl.XMLmodelPackageImpl#getDTD()
+ * @generated
+ */
+ int DTD = 6;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.qvtd.xml.impl.DataTypeAttributeImpl <em>Data Type Attribute</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.qvtd.xml.impl.DataTypeAttributeImpl
+ * @see org.eclipse.qvtd.xml.impl.XMLmodelPackageImpl#getDataTypeAttribute()
+ * @generated
+ */
+ int DATA_TYPE_ATTRIBUTE = 7;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.qvtd.xml.impl.DataTypeElementImpl <em>Data Type Element</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.qvtd.xml.impl.DataTypeElementImpl
+ * @see org.eclipse.qvtd.xml.impl.XMLmodelPackageImpl#getDataTypeElement()
+ * @generated
+ */
+ int DATA_TYPE_ELEMENT = 8;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.qvtd.xml.impl.DocumentImpl <em>Document</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.qvtd.xml.impl.DocumentImpl
+ * @see org.eclipse.qvtd.xml.impl.XMLmodelPackageImpl#getDocument()
+ * @generated
+ */
+ int DOCUMENT = 9;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.qvtd.xml.impl.ElementImpl <em>Element</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.qvtd.xml.impl.ElementImpl
+ * @see org.eclipse.qvtd.xml.impl.XMLmodelPackageImpl#getElement()
+ * @generated
+ */
+ int ELEMENT = 10;
+
+ /**
+ * The feature id for the '<em><b>Children</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ELEMENT__CHILDREN = NODE__CHILDREN;
+
+ /**
+ * The feature id for the '<em><b>Local Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ELEMENT__LOCAL_NAME = NODE_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>QName</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ELEMENT__QNAME = NODE_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Uri</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ELEMENT__URI = NODE_FEATURE_COUNT + 2;
+
+ /**
+ * The feature id for the '<em><b>Ecore Classifier</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ELEMENT__ECORE_CLASSIFIER = NODE_FEATURE_COUNT + 3;
+
+ /**
+ * The number of structural features of the '<em>Element</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ELEMENT_FEATURE_COUNT = NODE_FEATURE_COUNT + 4;
+
+ /**
+ * The number of operations of the '<em>Element</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ELEMENT_OPERATION_COUNT = NODE_OPERATION_COUNT + 0;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.qvtd.xml.impl.ClassElementImpl <em>Class Element</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.qvtd.xml.impl.ClassElementImpl
+ * @see org.eclipse.qvtd.xml.impl.XMLmodelPackageImpl#getClassElement()
+ * @generated
+ */
+ int CLASS_ELEMENT = 4;
+
+ /**
+ * The feature id for the '<em><b>Children</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_ELEMENT__CHILDREN = ELEMENT__CHILDREN;
+
+ /**
+ * The feature id for the '<em><b>Local Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_ELEMENT__LOCAL_NAME = ELEMENT__LOCAL_NAME;
+
+ /**
+ * The feature id for the '<em><b>QName</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_ELEMENT__QNAME = ELEMENT__QNAME;
+
+ /**
+ * The feature id for the '<em><b>Uri</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_ELEMENT__URI = ELEMENT__URI;
+
+ /**
+ * The feature id for the '<em><b>Ecore Classifier</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_ELEMENT__ECORE_CLASSIFIER = ELEMENT__ECORE_CLASSIFIER;
+
+ /**
+ * The feature id for the '<em><b>Ecore Class</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_ELEMENT__ECORE_CLASS = ELEMENT_FEATURE_COUNT + 0;
+
+ /**
+ * The number of structural features of the '<em>Class Element</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_ELEMENT_FEATURE_COUNT = ELEMENT_FEATURE_COUNT + 1;
+
+ /**
+ * The number of operations of the '<em>Class Element</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_ELEMENT_OPERATION_COUNT = ELEMENT_OPERATION_COUNT + 0;
/**
* The feature id for the '<em><b>Children</b></em>' containment reference list.
@@ -291,16 +577,6 @@ public interface XMLmodelPackage extends EPackage {
int COMMENT_OPERATION_COUNT = NODE_OPERATION_COUNT + 0;
/**
- * The meta object id for the '{@link org.eclipse.qvtd.xml.impl.DTDImpl <em>DTD</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.qvtd.xml.impl.DTDImpl
- * @see org.eclipse.qvtd.xml.impl.XMLmodelPackageImpl#getDTD()
- * @generated
- */
- int DTD = 4;
-
- /**
* The feature id for the '<em><b>Children</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -355,51 +631,67 @@ public interface XMLmodelPackage extends EPackage {
int DTD_OPERATION_COUNT = NODE_OPERATION_COUNT + 0;
/**
- * The meta object id for the '{@link org.eclipse.qvtd.xml.impl.DocumentImpl <em>Document</em>}' class.
+ * The feature id for the '<em><b>Children</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.qvtd.xml.impl.DocumentImpl
- * @see org.eclipse.qvtd.xml.impl.XMLmodelPackageImpl#getDocument()
* @generated
+ * @ordered
*/
- int DOCUMENT = 5;
+ int DATA_TYPE_ATTRIBUTE__CHILDREN = ATTRIBUTE__CHILDREN;
/**
- * The feature id for the '<em><b>Children</b></em>' containment reference list.
+ * The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int DOCUMENT__CHILDREN = NODE__CHILDREN;
+ int DATA_TYPE_ATTRIBUTE__NAME = ATTRIBUTE__NAME;
/**
- * The number of structural features of the '<em>Document</em>' class.
+ * The feature id for the '<em><b>Value</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int DOCUMENT_FEATURE_COUNT = NODE_FEATURE_COUNT + 0;
+ int DATA_TYPE_ATTRIBUTE__VALUE = ATTRIBUTE__VALUE;
/**
- * The number of operations of the '<em>Document</em>' class.
+ * The feature id for the '<em><b>Ecore Feature</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int DOCUMENT_OPERATION_COUNT = NODE_OPERATION_COUNT + 0;
+ int DATA_TYPE_ATTRIBUTE__ECORE_FEATURE = ATTRIBUTE__ECORE_FEATURE;
/**
- * The meta object id for the '{@link org.eclipse.qvtd.xml.impl.ElementImpl <em>Element</em>}' class.
+ * The feature id for the '<em><b>Ecore Attribute</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.qvtd.xml.impl.ElementImpl
- * @see org.eclipse.qvtd.xml.impl.XMLmodelPackageImpl#getElement()
* @generated
+ * @ordered
*/
- int ELEMENT = 6;
+ int DATA_TYPE_ATTRIBUTE__ECORE_ATTRIBUTE = ATTRIBUTE_FEATURE_COUNT + 0;
+
+ /**
+ * The number of structural features of the '<em>Data Type Attribute</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DATA_TYPE_ATTRIBUTE_FEATURE_COUNT = ATTRIBUTE_FEATURE_COUNT + 1;
+
+ /**
+ * The number of operations of the '<em>Data Type Attribute</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DATA_TYPE_ATTRIBUTE_OPERATION_COUNT = ATTRIBUTE_OPERATION_COUNT + 0;
/**
* The feature id for the '<em><b>Children</b></em>' containment reference list.
@@ -408,7 +700,7 @@ public interface XMLmodelPackage extends EPackage {
* @generated
* @ordered
*/
- int ELEMENT__CHILDREN = NODE__CHILDREN;
+ int DATA_TYPE_ELEMENT__CHILDREN = ELEMENT__CHILDREN;
/**
* The feature id for the '<em><b>Local Name</b></em>' attribute.
@@ -417,7 +709,7 @@ public interface XMLmodelPackage extends EPackage {
* @generated
* @ordered
*/
- int ELEMENT__LOCAL_NAME = NODE_FEATURE_COUNT + 0;
+ int DATA_TYPE_ELEMENT__LOCAL_NAME = ELEMENT__LOCAL_NAME;
/**
* The feature id for the '<em><b>QName</b></em>' attribute.
@@ -426,7 +718,7 @@ public interface XMLmodelPackage extends EPackage {
* @generated
* @ordered
*/
- int ELEMENT__QNAME = NODE_FEATURE_COUNT + 1;
+ int DATA_TYPE_ELEMENT__QNAME = ELEMENT__QNAME;
/**
* The feature id for the '<em><b>Uri</b></em>' attribute.
@@ -435,25 +727,70 @@ public interface XMLmodelPackage extends EPackage {
* @generated
* @ordered
*/
- int ELEMENT__URI = NODE_FEATURE_COUNT + 2;
+ int DATA_TYPE_ELEMENT__URI = ELEMENT__URI;
/**
- * The number of structural features of the '<em>Element</em>' class.
+ * The feature id for the '<em><b>Ecore Classifier</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int ELEMENT_FEATURE_COUNT = NODE_FEATURE_COUNT + 3;
+ int DATA_TYPE_ELEMENT__ECORE_CLASSIFIER = ELEMENT__ECORE_CLASSIFIER;
/**
- * The number of operations of the '<em>Element</em>' class.
+ * The feature id for the '<em><b>Ecore Data Type</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int ELEMENT_OPERATION_COUNT = NODE_OPERATION_COUNT + 0;
+ int DATA_TYPE_ELEMENT__ECORE_DATA_TYPE = ELEMENT_FEATURE_COUNT + 0;
+
+ /**
+ * The number of structural features of the '<em>Data Type Element</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DATA_TYPE_ELEMENT_FEATURE_COUNT = ELEMENT_FEATURE_COUNT + 1;
+
+ /**
+ * The number of operations of the '<em>Data Type Element</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DATA_TYPE_ELEMENT_OPERATION_COUNT = ELEMENT_OPERATION_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Children</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DOCUMENT__CHILDREN = NODE__CHILDREN;
+
+ /**
+ * The number of structural features of the '<em>Document</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DOCUMENT_FEATURE_COUNT = NODE_FEATURE_COUNT + 0;
+
+ /**
+ * The number of operations of the '<em>Document</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DOCUMENT_OPERATION_COUNT = NODE_OPERATION_COUNT + 0;
/**
* The meta object id for the '{@link org.eclipse.qvtd.xml.impl.EntityImpl <em>Entity</em>}' class.
@@ -463,7 +800,7 @@ public interface XMLmodelPackage extends EPackage {
* @see org.eclipse.qvtd.xml.impl.XMLmodelPackageImpl#getEntity()
* @generated
*/
- int ENTITY = 7;
+ int ENTITY = 11;
/**
* The feature id for the '<em><b>Children</b></em>' containment reference list.
@@ -509,7 +846,7 @@ public interface XMLmodelPackage extends EPackage {
* @see org.eclipse.qvtd.xml.impl.XMLmodelPackageImpl#getPrefixMapping()
* @generated
*/
- int PREFIX_MAPPING = 9;
+ int PREFIX_MAPPING = 13;
/**
* The feature id for the '<em><b>Children</b></em>' containment reference list.
@@ -564,7 +901,7 @@ public interface XMLmodelPackage extends EPackage {
* @see org.eclipse.qvtd.xml.impl.XMLmodelPackageImpl#getProcessingInstruction()
* @generated
*/
- int PROCESSING_INSTRUCTION = 10;
+ int PROCESSING_INSTRUCTION = 14;
/**
* The feature id for the '<em><b>Children</b></em>' containment reference list.
@@ -645,6 +982,17 @@ public interface XMLmodelPackage extends EPackage {
EAttribute getAttribute_Value();
/**
+ * Returns the meta object for the reference '{@link org.eclipse.qvtd.xml.Attribute#getEcoreFeature <em>Ecore Feature</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Ecore Feature</em>'.
+ * @see org.eclipse.qvtd.xml.Attribute#getEcoreFeature()
+ * @see #getAttribute()
+ * @generated
+ */
+ EReference getAttribute_EcoreFeature();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.qvtd.xml.CDATA <em>CDATA</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -676,6 +1024,59 @@ public interface XMLmodelPackage extends EPackage {
EAttribute getCharacters_Data();
/**
+ * Returns the meta object for class '{@link org.eclipse.qvtd.xml.ClassAttribute <em>Class Attribute</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Class Attribute</em>'.
+ * @see org.eclipse.qvtd.xml.ClassAttribute
+ * @generated
+ */
+ EClass getClassAttribute();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.qvtd.xml.ClassAttribute#getEcoreReference <em>Ecore Reference</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Ecore Reference</em>'.
+ * @see org.eclipse.qvtd.xml.ClassAttribute#getEcoreReference()
+ * @see #getClassAttribute()
+ * @generated
+ */
+ EReference getClassAttribute_EcoreReference();
+
+ /**
+ * Returns the meta object for the reference list '{@link org.eclipse.qvtd.xml.ClassAttribute#getEObjects <em>EObjects</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference list '<em>EObjects</em>'.
+ * @see org.eclipse.qvtd.xml.ClassAttribute#getEObjects()
+ * @see #getClassAttribute()
+ * @generated
+ */
+ EReference getClassAttribute_EObjects();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.qvtd.xml.ClassElement <em>Class Element</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Class Element</em>'.
+ * @see org.eclipse.qvtd.xml.ClassElement
+ * @generated
+ */
+ EClass getClassElement();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.qvtd.xml.ClassElement#getEcoreClass <em>Ecore Class</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Ecore Class</em>'.
+ * @see org.eclipse.qvtd.xml.ClassElement#getEcoreClass()
+ * @see #getClassElement()
+ * @generated
+ */
+ EReference getClassElement_EcoreClass();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.qvtd.xml.Comment <em>Comment</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -740,6 +1141,48 @@ public interface XMLmodelPackage extends EPackage {
EAttribute getDTD_SystemId();
/**
+ * Returns the meta object for class '{@link org.eclipse.qvtd.xml.DataTypeAttribute <em>Data Type Attribute</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Data Type Attribute</em>'.
+ * @see org.eclipse.qvtd.xml.DataTypeAttribute
+ * @generated
+ */
+ EClass getDataTypeAttribute();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.qvtd.xml.DataTypeAttribute#getEcoreAttribute <em>Ecore Attribute</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Ecore Attribute</em>'.
+ * @see org.eclipse.qvtd.xml.DataTypeAttribute#getEcoreAttribute()
+ * @see #getDataTypeAttribute()
+ * @generated
+ */
+ EReference getDataTypeAttribute_EcoreAttribute();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.qvtd.xml.DataTypeElement <em>Data Type Element</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Data Type Element</em>'.
+ * @see org.eclipse.qvtd.xml.DataTypeElement
+ * @generated
+ */
+ EClass getDataTypeElement();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.qvtd.xml.DataTypeElement#getEcoreDataType <em>Ecore Data Type</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Ecore Data Type</em>'.
+ * @see org.eclipse.qvtd.xml.DataTypeElement#getEcoreDataType()
+ * @see #getDataTypeElement()
+ * @generated
+ */
+ EReference getDataTypeElement_EcoreDataType();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.qvtd.xml.Document <em>Document</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -793,6 +1236,17 @@ public interface XMLmodelPackage extends EPackage {
EAttribute getElement_Uri();
/**
+ * Returns the meta object for the reference '{@link org.eclipse.qvtd.xml.Element#getEcoreClassifier <em>Ecore Classifier</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Ecore Classifier</em>'.
+ * @see org.eclipse.qvtd.xml.Element#getEcoreClassifier()
+ * @see #getElement()
+ * @generated
+ */
+ EReference getElement_EcoreClassifier();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.qvtd.xml.Entity <em>Entity</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -948,6 +1402,14 @@ public interface XMLmodelPackage extends EPackage {
EAttribute ATTRIBUTE__VALUE = eINSTANCE.getAttribute_Value();
/**
+ * The meta object literal for the '<em><b>Ecore Feature</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference ATTRIBUTE__ECORE_FEATURE = eINSTANCE.getAttribute_EcoreFeature();
+
+ /**
* The meta object literal for the '{@link org.eclipse.qvtd.xml.impl.CDATAImpl <em>CDATA</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -976,6 +1438,50 @@ public interface XMLmodelPackage extends EPackage {
EAttribute CHARACTERS__DATA = eINSTANCE.getCharacters_Data();
/**
+ * The meta object literal for the '{@link org.eclipse.qvtd.xml.impl.ClassAttributeImpl <em>Class Attribute</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.qvtd.xml.impl.ClassAttributeImpl
+ * @see org.eclipse.qvtd.xml.impl.XMLmodelPackageImpl#getClassAttribute()
+ * @generated
+ */
+ EClass CLASS_ATTRIBUTE = eINSTANCE.getClassAttribute();
+
+ /**
+ * The meta object literal for the '<em><b>Ecore Reference</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference CLASS_ATTRIBUTE__ECORE_REFERENCE = eINSTANCE.getClassAttribute_EcoreReference();
+
+ /**
+ * The meta object literal for the '<em><b>EObjects</b></em>' reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference CLASS_ATTRIBUTE__EOBJECTS = eINSTANCE.getClassAttribute_EObjects();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.qvtd.xml.impl.ClassElementImpl <em>Class Element</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.qvtd.xml.impl.ClassElementImpl
+ * @see org.eclipse.qvtd.xml.impl.XMLmodelPackageImpl#getClassElement()
+ * @generated
+ */
+ EClass CLASS_ELEMENT = eINSTANCE.getClassElement();
+
+ /**
+ * The meta object literal for the '<em><b>Ecore Class</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference CLASS_ELEMENT__ECORE_CLASS = eINSTANCE.getClassElement_EcoreClass();
+
+ /**
* The meta object literal for the '{@link org.eclipse.qvtd.xml.impl.CommentImpl <em>Comment</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1028,6 +1534,42 @@ public interface XMLmodelPackage extends EPackage {
EAttribute DTD__SYSTEM_ID = eINSTANCE.getDTD_SystemId();
/**
+ * The meta object literal for the '{@link org.eclipse.qvtd.xml.impl.DataTypeAttributeImpl <em>Data Type Attribute</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.qvtd.xml.impl.DataTypeAttributeImpl
+ * @see org.eclipse.qvtd.xml.impl.XMLmodelPackageImpl#getDataTypeAttribute()
+ * @generated
+ */
+ EClass DATA_TYPE_ATTRIBUTE = eINSTANCE.getDataTypeAttribute();
+
+ /**
+ * The meta object literal for the '<em><b>Ecore Attribute</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference DATA_TYPE_ATTRIBUTE__ECORE_ATTRIBUTE = eINSTANCE.getDataTypeAttribute_EcoreAttribute();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.qvtd.xml.impl.DataTypeElementImpl <em>Data Type Element</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.qvtd.xml.impl.DataTypeElementImpl
+ * @see org.eclipse.qvtd.xml.impl.XMLmodelPackageImpl#getDataTypeElement()
+ * @generated
+ */
+ EClass DATA_TYPE_ELEMENT = eINSTANCE.getDataTypeElement();
+
+ /**
+ * The meta object literal for the '<em><b>Ecore Data Type</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference DATA_TYPE_ELEMENT__ECORE_DATA_TYPE = eINSTANCE.getDataTypeElement_EcoreDataType();
+
+ /**
* The meta object literal for the '{@link org.eclipse.qvtd.xml.impl.DocumentImpl <em>Document</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1072,6 +1614,14 @@ public interface XMLmodelPackage extends EPackage {
EAttribute ELEMENT__URI = eINSTANCE.getElement_Uri();
/**
+ * The meta object literal for the '<em><b>Ecore Classifier</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference ELEMENT__ECORE_CLASSIFIER = eINSTANCE.getElement_EcoreClassifier();
+
+ /**
* The meta object literal for the '{@link org.eclipse.qvtd.xml.impl.EntityImpl <em>Entity</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/AttributeImpl.java b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/AttributeImpl.java
index ddd585a11..b84c9ef2f 100644
--- a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/AttributeImpl.java
+++ b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/AttributeImpl.java
@@ -1,25 +1,23 @@
/**
* <copyright>
- *
+ *
* Copyright (c) 2018 Willink Transformations and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
- *
+ *
* Contributors:
* E.D.Willink - Initial API and implementation
- *
+ *
* </copyright>
*/
package org.eclipse.qvtd.xml.impl;
import org.eclipse.emf.common.notify.Notification;
-
import org.eclipse.emf.ecore.EClass;
-
+import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
import org.eclipse.qvtd.xml.Attribute;
import org.eclipse.qvtd.xml.XMLmodelPackage;
@@ -33,6 +31,7 @@ import org.eclipse.qvtd.xml.XMLmodelPackage;
* <ul>
* <li>{@link org.eclipse.qvtd.xml.impl.AttributeImpl#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.qvtd.xml.impl.AttributeImpl#getValue <em>Value</em>}</li>
+ * <li>{@link org.eclipse.qvtd.xml.impl.AttributeImpl#getEcoreFeature <em>Ecore Feature</em>}</li>
* </ul>
*
* @generated
@@ -102,6 +101,7 @@ public class AttributeImpl extends NodeImpl implements Attribute {
* <!-- end-user-doc -->
* @generated
*/
+ @Override
public String getName() {
return name;
}
@@ -111,6 +111,7 @@ public class AttributeImpl extends NodeImpl implements Attribute {
* <!-- end-user-doc -->
* @generated
*/
+ @Override
public void setName(String newName) {
String oldName = name;
name = newName;
@@ -123,6 +124,7 @@ public class AttributeImpl extends NodeImpl implements Attribute {
* <!-- end-user-doc -->
* @generated
*/
+ @Override
public String getValue() {
return value;
}
@@ -132,6 +134,7 @@ public class AttributeImpl extends NodeImpl implements Attribute {
* <!-- end-user-doc -->
* @generated
*/
+ @Override
public void setValue(String newValue) {
String oldValue = value;
value = newValue;
@@ -151,6 +154,8 @@ public class AttributeImpl extends NodeImpl implements Attribute {
return getName();
case XMLmodelPackage.ATTRIBUTE__VALUE:
return getValue();
+ case XMLmodelPackage.ATTRIBUTE__ECORE_FEATURE:
+ return getEcoreFeature();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -203,11 +208,18 @@ public class AttributeImpl extends NodeImpl implements Attribute {
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case XMLmodelPackage.ATTRIBUTE__VALUE:
return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
+ case XMLmodelPackage.ATTRIBUTE__ECORE_FEATURE:
+ return getEcoreFeature() != null;
}
return super.eIsSet(featureID);
}
@Override
+ public EStructuralFeature getEcoreFeature() {
+ return null;
+ }
+
+ @Override
public String toString() {
return name + "=\"" + value + "\"";
}
diff --git a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/ClassAttributeImpl.java b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/ClassAttributeImpl.java
new file mode 100644
index 000000000..5993afb4f
--- /dev/null
+++ b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/ClassAttributeImpl.java
@@ -0,0 +1,192 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2018 Willink Transformations and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v20.html
+ *
+ * Contributors:
+ * E.D.Willink - Initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.qvtd.xml.impl;
+
+import java.util.Collection;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.util.EObjectEList;
+import org.eclipse.qvtd.xml.ClassAttribute;
+import org.eclipse.qvtd.xml.XMLmodelPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Class Attribute</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.qvtd.xml.impl.ClassAttributeImpl#getEcoreReference <em>Ecore Reference</em>}</li>
+ * <li>{@link org.eclipse.qvtd.xml.impl.ClassAttributeImpl#getEObjects <em>EObjects</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class ClassAttributeImpl extends AttributeImpl implements ClassAttribute {
+ /**
+ * The cached value of the '{@link #getEcoreReference() <em>Ecore Reference</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getEcoreReference()
+ * @generated
+ * @ordered
+ */
+ protected EReference ecoreReference;
+
+ /**
+ * The cached value of the '{@link #getEObjects() <em>EObjects</em>}' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getEObjects()
+ * @generated
+ * @ordered
+ */
+ protected EList<EObject> eObjects;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ClassAttributeImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return XMLmodelPackage.Literals.CLASS_ATTRIBUTE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EReference getEcoreReference() {
+ return ecoreReference;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setEcoreReference(EReference newEcoreReference) {
+ EReference oldEcoreReference = ecoreReference;
+ ecoreReference = newEcoreReference;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, XMLmodelPackage.CLASS_ATTRIBUTE__ECORE_REFERENCE, oldEcoreReference, ecoreReference));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<EObject> getEObjects() {
+ if (eObjects == null) {
+ eObjects = new EObjectEList<EObject>(EObject.class, this, XMLmodelPackage.CLASS_ATTRIBUTE__EOBJECTS);
+ }
+ return eObjects;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case XMLmodelPackage.CLASS_ATTRIBUTE__ECORE_REFERENCE:
+ return getEcoreReference();
+ case XMLmodelPackage.CLASS_ATTRIBUTE__EOBJECTS:
+ return getEObjects();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case XMLmodelPackage.CLASS_ATTRIBUTE__ECORE_REFERENCE:
+ setEcoreReference((EReference)newValue);
+ return;
+ case XMLmodelPackage.CLASS_ATTRIBUTE__EOBJECTS:
+ getEObjects().clear();
+ getEObjects().addAll((Collection<? extends EObject>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case XMLmodelPackage.CLASS_ATTRIBUTE__ECORE_REFERENCE:
+ setEcoreReference((EReference)null);
+ return;
+ case XMLmodelPackage.CLASS_ATTRIBUTE__EOBJECTS:
+ getEObjects().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case XMLmodelPackage.CLASS_ATTRIBUTE__ECORE_REFERENCE:
+ return ecoreReference != null;
+ case XMLmodelPackage.CLASS_ATTRIBUTE__EOBJECTS:
+ return eObjects != null && !eObjects.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ @Override
+ public EStructuralFeature getEcoreFeature() {
+ return getEcoreReference();
+ }
+} //ClassAttributeImpl
diff --git a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/ClassElementImpl.java b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/ClassElementImpl.java
new file mode 100644
index 000000000..bfc8e514e
--- /dev/null
+++ b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/ClassElementImpl.java
@@ -0,0 +1,152 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2018 Willink Transformations and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v20.html
+ *
+ * Contributors:
+ * E.D.Willink - Initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.qvtd.xml.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.qvtd.xml.ClassElement;
+import org.eclipse.qvtd.xml.XMLmodelPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Class Element</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.qvtd.xml.impl.ClassElementImpl#getEcoreClass <em>Ecore Class</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class ClassElementImpl extends ElementImpl implements ClassElement {
+ /**
+ * The cached value of the '{@link #getEcoreClass() <em>Ecore Class</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getEcoreClass()
+ * @generated
+ * @ordered
+ */
+ protected EClass ecoreClass;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ClassElementImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return XMLmodelPackage.Literals.CLASS_ELEMENT;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EClass getEcoreClass() {
+ return ecoreClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setEcoreClass(EClass newEcoreClass) {
+ EClass oldEcoreClass = ecoreClass;
+ ecoreClass = newEcoreClass;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, XMLmodelPackage.CLASS_ELEMENT__ECORE_CLASS, oldEcoreClass, ecoreClass));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case XMLmodelPackage.CLASS_ELEMENT__ECORE_CLASS:
+ return getEcoreClass();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case XMLmodelPackage.CLASS_ELEMENT__ECORE_CLASS:
+ setEcoreClass((EClass)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case XMLmodelPackage.CLASS_ELEMENT__ECORE_CLASS:
+ setEcoreClass((EClass)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case XMLmodelPackage.CLASS_ELEMENT__ECORE_CLASS:
+ return ecoreClass != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ @Override
+ public EClassifier getEcoreClassifier() {
+ return getEcoreClass();
+ }
+} //ClassElementImpl
diff --git a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/DataTypeAttributeImpl.java b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/DataTypeAttributeImpl.java
new file mode 100644
index 000000000..8a0a0039d
--- /dev/null
+++ b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/DataTypeAttributeImpl.java
@@ -0,0 +1,153 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2018 Willink Transformations and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v20.html
+ *
+ * Contributors:
+ * E.D.Willink - Initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.qvtd.xml.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.qvtd.xml.DataTypeAttribute;
+import org.eclipse.qvtd.xml.XMLmodelPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Data Type Attribute</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.qvtd.xml.impl.DataTypeAttributeImpl#getEcoreAttribute <em>Ecore Attribute</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class DataTypeAttributeImpl extends AttributeImpl implements DataTypeAttribute {
+ /**
+ * The cached value of the '{@link #getEcoreAttribute() <em>Ecore Attribute</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getEcoreAttribute()
+ * @generated
+ * @ordered
+ */
+ protected EAttribute ecoreAttribute;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected DataTypeAttributeImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return XMLmodelPackage.Literals.DATA_TYPE_ATTRIBUTE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EAttribute getEcoreAttribute() {
+ return ecoreAttribute;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setEcoreAttribute(EAttribute newEcoreAttribute) {
+ EAttribute oldEcoreAttribute = ecoreAttribute;
+ ecoreAttribute = newEcoreAttribute;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, XMLmodelPackage.DATA_TYPE_ATTRIBUTE__ECORE_ATTRIBUTE, oldEcoreAttribute, ecoreAttribute));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case XMLmodelPackage.DATA_TYPE_ATTRIBUTE__ECORE_ATTRIBUTE:
+ return getEcoreAttribute();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case XMLmodelPackage.DATA_TYPE_ATTRIBUTE__ECORE_ATTRIBUTE:
+ setEcoreAttribute((EAttribute)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case XMLmodelPackage.DATA_TYPE_ATTRIBUTE__ECORE_ATTRIBUTE:
+ setEcoreAttribute((EAttribute)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case XMLmodelPackage.DATA_TYPE_ATTRIBUTE__ECORE_ATTRIBUTE:
+ return ecoreAttribute != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ @Override
+ public EStructuralFeature getEcoreFeature() {
+ return getEcoreAttribute();
+ }
+} //DataTypeAttributeImpl
diff --git a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/DataTypeElementImpl.java b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/DataTypeElementImpl.java
new file mode 100644
index 000000000..463e4d783
--- /dev/null
+++ b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/DataTypeElementImpl.java
@@ -0,0 +1,154 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2018 Willink Transformations and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v20.html
+ *
+ * Contributors:
+ * E.D.Willink - Initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.qvtd.xml.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.qvtd.xml.DataTypeElement;
+import org.eclipse.qvtd.xml.XMLmodelPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Data Type Element</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.qvtd.xml.impl.DataTypeElementImpl#getEcoreDataType <em>Ecore Data Type</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class DataTypeElementImpl extends ElementImpl implements DataTypeElement {
+ /**
+ * The cached value of the '{@link #getEcoreDataType() <em>Ecore Data Type</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getEcoreDataType()
+ * @generated
+ * @ordered
+ */
+ protected EDataType ecoreDataType;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected DataTypeElementImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return XMLmodelPackage.Literals.DATA_TYPE_ELEMENT;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EDataType getEcoreDataType() {
+ return ecoreDataType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setEcoreDataType(EDataType newEcoreDataType) {
+ EDataType oldEcoreDataType = ecoreDataType;
+ ecoreDataType = newEcoreDataType;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, XMLmodelPackage.DATA_TYPE_ELEMENT__ECORE_DATA_TYPE, oldEcoreDataType, ecoreDataType));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case XMLmodelPackage.DATA_TYPE_ELEMENT__ECORE_DATA_TYPE:
+ return getEcoreDataType();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case XMLmodelPackage.DATA_TYPE_ELEMENT__ECORE_DATA_TYPE:
+ setEcoreDataType((EDataType)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case XMLmodelPackage.DATA_TYPE_ELEMENT__ECORE_DATA_TYPE:
+ setEcoreDataType((EDataType)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case XMLmodelPackage.DATA_TYPE_ELEMENT__ECORE_DATA_TYPE:
+ return ecoreDataType != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ @Override
+ public EClassifier getEcoreClassifier() {
+ return getEcoreDataType();
+ }
+
+} //DataTypeElementImpl
diff --git a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/DocumentImpl.java b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/DocumentImpl.java
index c0d9a64fd..3104c7d8b 100644
--- a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/DocumentImpl.java
+++ b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/DocumentImpl.java
@@ -1,21 +1,20 @@
/**
* <copyright>
- *
+ *
* Copyright (c) 2018 Willink Transformations and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
- *
+ *
* Contributors:
* E.D.Willink - Initial API and implementation
- *
+ *
* </copyright>
*/
package org.eclipse.qvtd.xml.impl;
import org.eclipse.emf.ecore.EClass;
-
import org.eclipse.qvtd.xml.Document;
import org.eclipse.qvtd.xml.XMLmodelPackage;
@@ -45,5 +44,4 @@ public class DocumentImpl extends NodeImpl implements Document {
protected EClass eStaticClass() {
return XMLmodelPackage.Literals.DOCUMENT;
}
-
} //DocumentImpl
diff --git a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/ElementImpl.java b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/ElementImpl.java
index 85e1ece03..7f090f358 100644
--- a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/ElementImpl.java
+++ b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/ElementImpl.java
@@ -1,26 +1,27 @@
/**
* <copyright>
- *
+ *
* Copyright (c) 2018 Willink Transformations and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
- *
+ *
* Contributors:
* E.D.Willink - Initial API and implementation
- *
+ *
* </copyright>
*/
package org.eclipse.qvtd.xml.impl;
import org.eclipse.emf.common.notify.Notification;
-
import org.eclipse.emf.ecore.EClass;
-
+import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.qvtd.xml.DataTypeAttribute;
import org.eclipse.qvtd.xml.Element;
+import org.eclipse.qvtd.xml.Node;
import org.eclipse.qvtd.xml.XMLmodelPackage;
/**
@@ -34,6 +35,7 @@ import org.eclipse.qvtd.xml.XMLmodelPackage;
* <li>{@link org.eclipse.qvtd.xml.impl.ElementImpl#getLocalName <em>Local Name</em>}</li>
* <li>{@link org.eclipse.qvtd.xml.impl.ElementImpl#getQName <em>QName</em>}</li>
* <li>{@link org.eclipse.qvtd.xml.impl.ElementImpl#getUri <em>Uri</em>}</li>
+ * <li>{@link org.eclipse.qvtd.xml.impl.ElementImpl#getEcoreClassifier <em>Ecore Classifier</em>}</li>
* </ul>
*
* @generated
@@ -123,6 +125,7 @@ public class ElementImpl extends NodeImpl implements Element {
* <!-- end-user-doc -->
* @generated
*/
+ @Override
public String getLocalName() {
return localName;
}
@@ -132,6 +135,7 @@ public class ElementImpl extends NodeImpl implements Element {
* <!-- end-user-doc -->
* @generated
*/
+ @Override
public void setLocalName(String newLocalName) {
String oldLocalName = localName;
localName = newLocalName;
@@ -144,6 +148,7 @@ public class ElementImpl extends NodeImpl implements Element {
* <!-- end-user-doc -->
* @generated
*/
+ @Override
public String getQName() {
return qName;
}
@@ -153,6 +158,7 @@ public class ElementImpl extends NodeImpl implements Element {
* <!-- end-user-doc -->
* @generated
*/
+ @Override
public void setQName(String newQName) {
String oldQName = qName;
qName = newQName;
@@ -165,6 +171,7 @@ public class ElementImpl extends NodeImpl implements Element {
* <!-- end-user-doc -->
* @generated
*/
+ @Override
public String getUri() {
return uri;
}
@@ -174,6 +181,7 @@ public class ElementImpl extends NodeImpl implements Element {
* <!-- end-user-doc -->
* @generated
*/
+ @Override
public void setUri(String newUri) {
String oldUri = uri;
uri = newUri;
@@ -195,6 +203,8 @@ public class ElementImpl extends NodeImpl implements Element {
return getQName();
case XMLmodelPackage.ELEMENT__URI:
return getUri();
+ case XMLmodelPackage.ELEMENT__ECORE_CLASSIFIER:
+ return getEcoreClassifier();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -255,13 +265,30 @@ public class ElementImpl extends NodeImpl implements Element {
return QNAME_EDEFAULT == null ? qName != null : !QNAME_EDEFAULT.equals(qName);
case XMLmodelPackage.ELEMENT__URI:
return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri);
+ case XMLmodelPackage.ELEMENT__ECORE_CLASSIFIER:
+ return getEcoreClassifier() != null;
}
return super.eIsSet(featureID);
}
@Override
+ public EClassifier getEcoreClassifier() {
+ return null;
+ }
+
+ @Override
public String toString() {
- return "<" + qName + " ... />";
+ StringBuilder s = new StringBuilder();
+ s.append("<");
+ s.append(qName);
+ for (@NonNull Node node : children) {
+ if (node instanceof DataTypeAttribute) {
+ s.append(" ");
+ s.append(node.toString());
+ }
+ }
+ s.append(" ... />");
+ return s.toString();
}
} //ElementImpl
diff --git a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/XMLmodelFactoryImpl.java b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/XMLmodelFactoryImpl.java
index a251c9ed6..be2caca5e 100644
--- a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/XMLmodelFactoryImpl.java
+++ b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/XMLmodelFactoryImpl.java
@@ -71,8 +71,12 @@ public class XMLmodelFactoryImpl extends EFactoryImpl implements XMLmodelFactory
case XMLmodelPackage.ATTRIBUTE: return createAttribute();
case XMLmodelPackage.CDATA: return createCDATA();
case XMLmodelPackage.CHARACTERS: return createCharacters();
+ case XMLmodelPackage.CLASS_ATTRIBUTE: return createClassAttribute();
+ case XMLmodelPackage.CLASS_ELEMENT: return createClassElement();
case XMLmodelPackage.COMMENT: return createComment();
case XMLmodelPackage.DTD: return createDTD();
+ case XMLmodelPackage.DATA_TYPE_ATTRIBUTE: return createDataTypeAttribute();
+ case XMLmodelPackage.DATA_TYPE_ELEMENT: return createDataTypeElement();
case XMLmodelPackage.DOCUMENT: return createDocument();
case XMLmodelPackage.ELEMENT: return createElement();
case XMLmodelPackage.ENTITY: return createEntity();
@@ -118,6 +122,26 @@ public class XMLmodelFactoryImpl extends EFactoryImpl implements XMLmodelFactory
* <!-- end-user-doc -->
* @generated
*/
+ public ClassAttribute createClassAttribute() {
+ ClassAttributeImpl classAttribute = new ClassAttributeImpl();
+ return classAttribute;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ClassElement createClassElement() {
+ ClassElementImpl classElement = new ClassElementImpl();
+ return classElement;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public Comment createComment() {
CommentImpl comment = new CommentImpl();
return comment;
@@ -138,6 +162,26 @@ public class XMLmodelFactoryImpl extends EFactoryImpl implements XMLmodelFactory
* <!-- end-user-doc -->
* @generated
*/
+ public DataTypeAttribute createDataTypeAttribute() {
+ DataTypeAttributeImpl dataTypeAttribute = new DataTypeAttributeImpl();
+ return dataTypeAttribute;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public DataTypeElement createDataTypeElement() {
+ DataTypeElementImpl dataTypeElement = new DataTypeElementImpl();
+ return dataTypeElement;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public Document createDocument() {
DocumentImpl document = new DocumentImpl();
return document;
diff --git a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/XMLmodelPackageImpl.java b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/XMLmodelPackageImpl.java
index b85e7e27c..edd69e835 100644
--- a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/XMLmodelPackageImpl.java
+++ b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/impl/XMLmodelPackageImpl.java
@@ -23,7 +23,11 @@ import org.eclipse.emf.ecore.impl.EPackageImpl;
import org.eclipse.qvtd.xml.Attribute;
import org.eclipse.qvtd.xml.Characters;
+import org.eclipse.qvtd.xml.ClassAttribute;
+import org.eclipse.qvtd.xml.ClassElement;
import org.eclipse.qvtd.xml.Comment;
+import org.eclipse.qvtd.xml.DataTypeAttribute;
+import org.eclipse.qvtd.xml.DataTypeElement;
import org.eclipse.qvtd.xml.Document;
import org.eclipse.qvtd.xml.Element;
import org.eclipse.qvtd.xml.Entity;
@@ -66,6 +70,20 @@ public class XMLmodelPackageImpl extends EPackageImpl implements XMLmodelPackage
* <!-- end-user-doc -->
* @generated
*/
+ private EClass classAttributeEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass classElementEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
private EClass commentEClass = null;
/**
@@ -80,6 +98,20 @@ public class XMLmodelPackageImpl extends EPackageImpl implements XMLmodelPackage
* <!-- end-user-doc -->
* @generated
*/
+ private EClass dataTypeAttributeEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass dataTypeElementEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
private EClass documentEClass = null;
/**
@@ -210,6 +242,15 @@ public class XMLmodelPackageImpl extends EPackageImpl implements XMLmodelPackage
* <!-- end-user-doc -->
* @generated
*/
+ public EReference getAttribute_EcoreFeature() {
+ return (EReference)attributeEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EClass getCDATA() {
return cdataEClass;
}
@@ -237,6 +278,51 @@ public class XMLmodelPackageImpl extends EPackageImpl implements XMLmodelPackage
* <!-- end-user-doc -->
* @generated
*/
+ public EClass getClassAttribute() {
+ return classAttributeEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getClassAttribute_EcoreReference() {
+ return (EReference)classAttributeEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getClassAttribute_EObjects() {
+ return (EReference)classAttributeEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getClassElement() {
+ return classElementEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getClassElement_EcoreClass() {
+ return (EReference)classElementEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EClass getComment() {
return commentEClass;
}
@@ -291,6 +377,42 @@ public class XMLmodelPackageImpl extends EPackageImpl implements XMLmodelPackage
* <!-- end-user-doc -->
* @generated
*/
+ public EClass getDataTypeAttribute() {
+ return dataTypeAttributeEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getDataTypeAttribute_EcoreAttribute() {
+ return (EReference)dataTypeAttributeEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getDataTypeElement() {
+ return dataTypeElementEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getDataTypeElement_EcoreDataType() {
+ return (EReference)dataTypeElementEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EClass getDocument() {
return documentEClass;
}
@@ -336,6 +458,15 @@ public class XMLmodelPackageImpl extends EPackageImpl implements XMLmodelPackage
* <!-- end-user-doc -->
* @generated
*/
+ public EReference getElement_EcoreClassifier() {
+ return (EReference)elementEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EClass getEntity() {
return entityEClass;
}
@@ -452,12 +583,20 @@ public class XMLmodelPackageImpl extends EPackageImpl implements XMLmodelPackage
attributeEClass = createEClass(ATTRIBUTE);
createEAttribute(attributeEClass, ATTRIBUTE__NAME);
createEAttribute(attributeEClass, ATTRIBUTE__VALUE);
+ createEReference(attributeEClass, ATTRIBUTE__ECORE_FEATURE);
cdataEClass = createEClass(CDATA);
charactersEClass = createEClass(CHARACTERS);
createEAttribute(charactersEClass, CHARACTERS__DATA);
+ classAttributeEClass = createEClass(CLASS_ATTRIBUTE);
+ createEReference(classAttributeEClass, CLASS_ATTRIBUTE__ECORE_REFERENCE);
+ createEReference(classAttributeEClass, CLASS_ATTRIBUTE__EOBJECTS);
+
+ classElementEClass = createEClass(CLASS_ELEMENT);
+ createEReference(classElementEClass, CLASS_ELEMENT__ECORE_CLASS);
+
commentEClass = createEClass(COMMENT);
createEAttribute(commentEClass, COMMENT__DATA);
@@ -466,12 +605,19 @@ public class XMLmodelPackageImpl extends EPackageImpl implements XMLmodelPackage
createEAttribute(dtdEClass, DTD__PUBLIC_ID);
createEAttribute(dtdEClass, DTD__SYSTEM_ID);
+ dataTypeAttributeEClass = createEClass(DATA_TYPE_ATTRIBUTE);
+ createEReference(dataTypeAttributeEClass, DATA_TYPE_ATTRIBUTE__ECORE_ATTRIBUTE);
+
+ dataTypeElementEClass = createEClass(DATA_TYPE_ELEMENT);
+ createEReference(dataTypeElementEClass, DATA_TYPE_ELEMENT__ECORE_DATA_TYPE);
+
documentEClass = createEClass(DOCUMENT);
elementEClass = createEClass(ELEMENT);
createEAttribute(elementEClass, ELEMENT__LOCAL_NAME);
createEAttribute(elementEClass, ELEMENT__QNAME);
createEAttribute(elementEClass, ELEMENT__URI);
+ createEReference(elementEClass, ELEMENT__ECORE_CLASSIFIER);
entityEClass = createEClass(ENTITY);
createEAttribute(entityEClass, ENTITY__NAME);
@@ -519,8 +665,12 @@ public class XMLmodelPackageImpl extends EPackageImpl implements XMLmodelPackage
attributeEClass.getESuperTypes().add(this.getNode());
cdataEClass.getESuperTypes().add(this.getNode());
charactersEClass.getESuperTypes().add(this.getNode());
+ classAttributeEClass.getESuperTypes().add(this.getAttribute());
+ classElementEClass.getESuperTypes().add(this.getElement());
commentEClass.getESuperTypes().add(this.getNode());
dtdEClass.getESuperTypes().add(this.getNode());
+ dataTypeAttributeEClass.getESuperTypes().add(this.getAttribute());
+ dataTypeElementEClass.getESuperTypes().add(this.getElement());
documentEClass.getESuperTypes().add(this.getNode());
elementEClass.getESuperTypes().add(this.getNode());
entityEClass.getESuperTypes().add(this.getNode());
@@ -531,12 +681,20 @@ public class XMLmodelPackageImpl extends EPackageImpl implements XMLmodelPackage
initEClass(attributeEClass, Attribute.class, "Attribute", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getAttribute_Name(), ecorePackage.getEString(), "name", null, 1, 1, Attribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
initEAttribute(getAttribute_Value(), ecorePackage.getEString(), "value", null, 1, 1, Attribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
+ initEReference(getAttribute_EcoreFeature(), ecorePackage.getEStructuralFeature(), null, "ecoreFeature", null, 0, 1, Attribute.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
initEClass(cdataEClass, org.eclipse.qvtd.xml.CDATA.class, "CDATA", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(charactersEClass, Characters.class, "Characters", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getCharacters_Data(), ecorePackage.getEString(), "data", null, 1, 1, Characters.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
+ initEClass(classAttributeEClass, ClassAttribute.class, "ClassAttribute", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getClassAttribute_EcoreReference(), ecorePackage.getEReference(), null, "ecoreReference", null, 1, 1, ClassAttribute.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getClassAttribute_EObjects(), ecorePackage.getEObject(), null, "eObjects", null, 1, -1, ClassAttribute.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(classElementEClass, ClassElement.class, "ClassElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getClassElement_EcoreClass(), ecorePackage.getEClass(), null, "ecoreClass", null, 1, 1, ClassElement.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
initEClass(commentEClass, Comment.class, "Comment", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getComment_Data(), ecorePackage.getEString(), "data", null, 1, 1, Comment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
@@ -545,12 +703,19 @@ public class XMLmodelPackageImpl extends EPackageImpl implements XMLmodelPackage
initEAttribute(getDTD_PublicId(), ecorePackage.getEString(), "publicId", null, 1, 1, org.eclipse.qvtd.xml.DTD.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
initEAttribute(getDTD_SystemId(), ecorePackage.getEString(), "systemId", null, 1, 1, org.eclipse.qvtd.xml.DTD.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
+ initEClass(dataTypeAttributeEClass, DataTypeAttribute.class, "DataTypeAttribute", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getDataTypeAttribute_EcoreAttribute(), ecorePackage.getEAttribute(), null, "ecoreAttribute", null, 1, 1, DataTypeAttribute.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(dataTypeElementEClass, DataTypeElement.class, "DataTypeElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getDataTypeElement_EcoreDataType(), ecorePackage.getEDataType(), null, "ecoreDataType", null, 1, 1, DataTypeElement.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
initEClass(documentEClass, Document.class, "Document", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(elementEClass, Element.class, "Element", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getElement_LocalName(), ecorePackage.getEString(), "localName", null, 1, 1, Element.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
initEAttribute(getElement_QName(), ecorePackage.getEString(), "qName", null, 1, 1, Element.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
initEAttribute(getElement_Uri(), ecorePackage.getEString(), "uri", null, 1, 1, Element.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
+ initEReference(getElement_EcoreClassifier(), ecorePackage.getEClassifier(), null, "ecoreClassifier", null, 0, 1, Element.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
initEClass(entityEClass, Entity.class, "Entity", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getEntity_Name(), ecorePackage.getEString(), "name", null, 1, 1, Entity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
diff --git a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/util/XMLmodelAdapterFactory.java b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/util/XMLmodelAdapterFactory.java
index 12e5fd384..bdf636119 100644
--- a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/util/XMLmodelAdapterFactory.java
+++ b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/util/XMLmodelAdapterFactory.java
@@ -20,8 +20,6 @@ import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.qvtd.xml.*;
/**
@@ -78,8 +76,8 @@ public class XMLmodelAdapterFactory extends AdapterFactoryImpl {
* <!-- end-user-doc -->
* @generated
*/
- protected XMLmodelSwitch<@Nullable Adapter> modelSwitch =
- new XMLmodelSwitch<@Nullable Adapter>() {
+ protected XMLmodelSwitch<Adapter> modelSwitch =
+ new XMLmodelSwitch<Adapter>() {
@Override
public Adapter caseAttribute(Attribute object) {
return createAttributeAdapter();
@@ -93,6 +91,14 @@ public class XMLmodelAdapterFactory extends AdapterFactoryImpl {
return createCharactersAdapter();
}
@Override
+ public Adapter caseClassAttribute(ClassAttribute object) {
+ return createClassAttributeAdapter();
+ }
+ @Override
+ public Adapter caseClassElement(ClassElement object) {
+ return createClassElementAdapter();
+ }
+ @Override
public Adapter caseComment(Comment object) {
return createCommentAdapter();
}
@@ -101,6 +107,14 @@ public class XMLmodelAdapterFactory extends AdapterFactoryImpl {
return createDTDAdapter();
}
@Override
+ public Adapter caseDataTypeAttribute(DataTypeAttribute object) {
+ return createDataTypeAttributeAdapter();
+ }
+ @Override
+ public Adapter caseDataTypeElement(DataTypeElement object) {
+ return createDataTypeElementAdapter();
+ }
+ @Override
public Adapter caseDocument(Document object) {
return createDocumentAdapter();
}
@@ -187,6 +201,34 @@ public class XMLmodelAdapterFactory extends AdapterFactoryImpl {
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.qvtd.xml.ClassAttribute <em>Class Attribute</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.qvtd.xml.ClassAttribute
+ * @generated
+ */
+ public Adapter createClassAttributeAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.qvtd.xml.ClassElement <em>Class Element</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.qvtd.xml.ClassElement
+ * @generated
+ */
+ public Adapter createClassElementAdapter() {
+ return null;
+ }
+
+ /**
* Creates a new adapter for an object of class '{@link org.eclipse.qvtd.xml.Comment <em>Comment</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
@@ -215,6 +257,34 @@ public class XMLmodelAdapterFactory extends AdapterFactoryImpl {
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.qvtd.xml.DataTypeAttribute <em>Data Type Attribute</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.qvtd.xml.DataTypeAttribute
+ * @generated
+ */
+ public Adapter createDataTypeAttributeAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.qvtd.xml.DataTypeElement <em>Data Type Element</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.qvtd.xml.DataTypeElement
+ * @generated
+ */
+ public Adapter createDataTypeElementAdapter() {
+ return null;
+ }
+
+ /**
* Creates a new adapter for an object of class '{@link org.eclipse.qvtd.xml.Document <em>Document</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
diff --git a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/util/XMLmodelSwitch.java b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/util/XMLmodelSwitch.java
index 04b9adfa0..f496bbf9c 100644
--- a/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/util/XMLmodelSwitch.java
+++ b/plugins/org.eclipse.qvtd.xml/emf-gen/org/eclipse/qvtd/xml/util/XMLmodelSwitch.java
@@ -18,8 +18,6 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.Switch;
-
-import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.qvtd.xml.*;
/**
@@ -35,7 +33,7 @@ import org.eclipse.qvtd.xml.*;
* @see org.eclipse.qvtd.xml.XMLmodelPackage
* @generated
*/
-public class XMLmodelSwitch<@Nullable T> extends Switch<T> {
+public class XMLmodelSwitch<T> extends Switch<T> {
/**
* The cached model package
* <!-- begin-user-doc -->
@@ -100,6 +98,22 @@ public class XMLmodelSwitch<@Nullable T> extends Switch<T> {
if (result == null) result = defaultCase(theEObject);
return result;
}
+ case XMLmodelPackage.CLASS_ATTRIBUTE: {
+ ClassAttribute classAttribute = (ClassAttribute)theEObject;
+ T result = caseClassAttribute(classAttribute);
+ if (result == null) result = caseAttribute(classAttribute);
+ if (result == null) result = caseNode(classAttribute);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case XMLmodelPackage.CLASS_ELEMENT: {
+ ClassElement classElement = (ClassElement)theEObject;
+ T result = caseClassElement(classElement);
+ if (result == null) result = caseElement(classElement);
+ if (result == null) result = caseNode(classElement);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
case XMLmodelPackage.COMMENT: {
Comment comment = (Comment)theEObject;
T result = caseComment(comment);
@@ -114,6 +128,22 @@ public class XMLmodelSwitch<@Nullable T> extends Switch<T> {
if (result == null) result = defaultCase(theEObject);
return result;
}
+ case XMLmodelPackage.DATA_TYPE_ATTRIBUTE: {
+ DataTypeAttribute dataTypeAttribute = (DataTypeAttribute)theEObject;
+ T result = caseDataTypeAttribute(dataTypeAttribute);
+ if (result == null) result = caseAttribute(dataTypeAttribute);
+ if (result == null) result = caseNode(dataTypeAttribute);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case XMLmodelPackage.DATA_TYPE_ELEMENT: {
+ DataTypeElement dataTypeElement = (DataTypeElement)theEObject;
+ T result = caseDataTypeElement(dataTypeElement);
+ if (result == null) result = caseElement(dataTypeElement);
+ if (result == null) result = caseNode(dataTypeElement);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
case XMLmodelPackage.DOCUMENT: {
Document document = (Document)theEObject;
T result = caseDocument(document);
@@ -205,6 +235,36 @@ public class XMLmodelSwitch<@Nullable T> extends Switch<T> {
}
/**
+ * Returns the result of interpreting the object as an instance of '<em>Class Attribute</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Class Attribute</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseClassAttribute(ClassAttribute object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Class Element</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Class Element</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseClassElement(ClassElement object) {
+ return null;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>Comment</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
@@ -235,6 +295,36 @@ public class XMLmodelSwitch<@Nullable T> extends Switch<T> {
}
/**
+ * Returns the result of interpreting the object as an instance of '<em>Data Type Attribute</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Data Type Attribute</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseDataTypeAttribute(DataTypeAttribute object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Data Type Element</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Data Type Element</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseDataTypeElement(DataTypeElement object) {
+ return null;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>Document</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
diff --git a/plugins/org.eclipse.qvtd.xml/model/XMLmodel.ecore b/plugins/org.eclipse.qvtd.xml/model/XMLmodel.ecore
index ea68aa36b..a3673bcee 100644
--- a/plugins/org.eclipse.qvtd.xml/model/XMLmodel.ecore
+++ b/plugins/org.eclipse.qvtd.xml/model/XMLmodel.ecore
@@ -1,168 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage
- xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- name="xml"
- nsURI="http://www.eclipse.org/qvt/2018/XML"
- nsPrefix="sax">
- <eAnnotations
- source="http://www.eclipse.org/qvt/2018/PostProcess">
- <details
- key="raw"
- value="org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl"/>
- <details
- key="processed"
- value="org.eclipse.qvtd.xml.utilities.XMLmodelResourceFactoryImpl"/>
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="xml" nsURI="http://www.eclipse.org/qvt/2018/XML" nsPrefix="sax">
+ <eAnnotations source="http://www.eclipse.org/qvt/2018/PostProcess">
+ <details key="raw" value="org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl"/>
+ <details key="processed" value="org.eclipse.qvtd.xml.utilities.XMLmodelResourceFactoryImpl"/>
</eAnnotations>
- <eClassifiers
- xsi:type="ecore:EClass"
- name="Attribute"
- eSuperTypes="#//Node">
- <eStructuralFeatures
- xsi:type="ecore:EAttribute"
- name="name"
- ordered="false"
- lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures
- xsi:type="ecore:EAttribute"
- name="value"
- ordered="false"
- lowerBound="1"
+ <eClassifiers xsi:type="ecore:EClass" name="Attribute" eSuperTypes="#//Node">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" ordered="false" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" ordered="false"
+ lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="ecoreFeature" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EStructuralFeature"
+ changeable="false" volatile="true" transient="true" derived="true" resolveProxies="false"/>
</eClassifiers>
- <eClassifiers
- xsi:type="ecore:EClass"
- name="CDATA"
- eSuperTypes="#//Node"/>
- <eClassifiers
- xsi:type="ecore:EClass"
- name="Characters"
- eSuperTypes="#//Node">
- <eStructuralFeatures
- xsi:type="ecore:EAttribute"
- name="data"
- ordered="false"
- lowerBound="1"
+ <eClassifiers xsi:type="ecore:EClass" name="CDATA" eSuperTypes="#//Node"/>
+ <eClassifiers xsi:type="ecore:EClass" name="Characters" eSuperTypes="#//Node">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="data" ordered="false" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
- <eClassifiers
- xsi:type="ecore:EClass"
- name="Comment"
- eSuperTypes="#//Node">
- <eStructuralFeatures
- xsi:type="ecore:EAttribute"
- name="data"
- ordered="false"
- lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eClassifiers xsi:type="ecore:EClass" name="ClassAttribute" eSuperTypes="#//Attribute">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="ecoreReference" lowerBound="1"
+ eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EReference" transient="true"
+ resolveProxies="false"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="eObjects" lowerBound="1"
+ upperBound="-1" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject"
+ transient="true" resolveProxies="false"/>
</eClassifiers>
- <eClassifiers
- xsi:type="ecore:EClass"
- name="DTD"
- eSuperTypes="#//Node">
- <eStructuralFeatures
- xsi:type="ecore:EAttribute"
- name="name"
- ordered="false"
- lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures
- xsi:type="ecore:EAttribute"
- name="publicId"
- ordered="false"
- lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures
- xsi:type="ecore:EAttribute"
- name="systemId"
- ordered="false"
- lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eClassifiers xsi:type="ecore:EClass" name="ClassElement" eSuperTypes="#//Element">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="ecoreClass" lowerBound="1"
+ eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EClass" transient="true"
+ resolveProxies="false"/>
</eClassifiers>
- <eClassifiers
- xsi:type="ecore:EClass"
- name="Document"
- eSuperTypes="#//Node"/>
- <eClassifiers
- xsi:type="ecore:EClass"
- name="Element"
- eSuperTypes="#//Node">
- <eStructuralFeatures
- xsi:type="ecore:EAttribute"
- name="localName"
- ordered="false"
- lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures
- xsi:type="ecore:EAttribute"
- name="qName"
- ordered="false"
- lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures
- xsi:type="ecore:EAttribute"
- name="uri"
- ordered="false"
- lowerBound="1"
+ <eClassifiers xsi:type="ecore:EClass" name="Comment" eSuperTypes="#//Node">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="data" ordered="false" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
- <eClassifiers
- xsi:type="ecore:EClass"
- name="Entity"
- eSuperTypes="#//Node">
- <eStructuralFeatures
- xsi:type="ecore:EAttribute"
- name="name"
- ordered="false"
- lowerBound="1"
+ <eClassifiers xsi:type="ecore:EClass" name="DTD" eSuperTypes="#//Node">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" ordered="false" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="publicId" ordered="false"
+ lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="systemId" ordered="false"
+ lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="DataTypeAttribute" eSuperTypes="#//Attribute">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="ecoreAttribute" lowerBound="1"
+ eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EAttribute" transient="true"
+ resolveProxies="false"/>
</eClassifiers>
- <eClassifiers
- xsi:type="ecore:EClass"
- name="Node"
- abstract="true">
- <eStructuralFeatures
- xsi:type="ecore:EReference"
- name="children"
- upperBound="-1"
- eType="#//Node"
- containment="true"/>
+ <eClassifiers xsi:type="ecore:EClass" name="DataTypeElement" eSuperTypes="#//Element">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="ecoreDataType" lowerBound="1"
+ eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EDataType" transient="true"
+ resolveProxies="false"/>
</eClassifiers>
- <eClassifiers
- xsi:type="ecore:EClass"
- name="PrefixMapping"
- eSuperTypes="#//Node">
- <eStructuralFeatures
- xsi:type="ecore:EAttribute"
- name="prefix"
- ordered="false"
- lowerBound="1"
+ <eClassifiers xsi:type="ecore:EClass" name="Document" eSuperTypes="#//Node"/>
+ <eClassifiers xsi:type="ecore:EClass" name="Element" eSuperTypes="#//Node">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="localName" ordered="false"
+ lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="qName" ordered="false"
+ lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="uri" ordered="false" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures
- xsi:type="ecore:EAttribute"
- name="uri"
- ordered="false"
- lowerBound="1"
+ <eStructuralFeatures xsi:type="ecore:EReference" name="ecoreClassifier" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EClassifier"
+ changeable="false" volatile="true" transient="true" derived="true" resolveProxies="false"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Entity" eSuperTypes="#//Node">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" ordered="false" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
- <eClassifiers
- xsi:type="ecore:EClass"
- name="ProcessingInstruction"
- eSuperTypes="#//Node">
- <eStructuralFeatures
- xsi:type="ecore:EAttribute"
- name="target"
- ordered="false"
- lowerBound="1"
+ <eClassifiers xsi:type="ecore:EClass" name="Node" abstract="true">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="children" upperBound="-1"
+ eType="#//Node" containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="PrefixMapping" eSuperTypes="#//Node">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="prefix" ordered="false"
+ lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="uri" ordered="false" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures
- xsi:type="ecore:EAttribute"
- name="data"
- ordered="false"
- lowerBound="1"
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="ProcessingInstruction" eSuperTypes="#//Node">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="target" ordered="false"
+ lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="data" ordered="false" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
</ecore:EPackage>
diff --git a/plugins/org.eclipse.qvtd.xml/model/XMLmodel.genmodel b/plugins/org.eclipse.qvtd.xml/model/XMLmodel.genmodel
index 276ca167e..73a6151d4 100644
--- a/plugins/org.eclipse.qvtd.xml/model/XMLmodel.genmodel
+++ b/plugins/org.eclipse.qvtd.xml/model/XMLmodel.genmodel
@@ -11,11 +11,19 @@
<genClasses ecoreClass="XMLmodel.ecore#//Attribute">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute XMLmodel.ecore#//Attribute/name"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute XMLmodel.ecore#//Attribute/value"/>
+ <genFeatures property="Readonly" notify="false" createChild="false" ecoreFeature="ecore:EReference XMLmodel.ecore#//Attribute/ecoreFeature"/>
</genClasses>
<genClasses ecoreClass="XMLmodel.ecore#//CDATA"/>
<genClasses image="false" ecoreClass="XMLmodel.ecore#//Characters">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute XMLmodel.ecore#//Characters/data"/>
</genClasses>
+ <genClasses ecoreClass="XMLmodel.ecore#//ClassAttribute">
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference XMLmodel.ecore#//ClassAttribute/ecoreReference"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference XMLmodel.ecore#//ClassAttribute/eObjects"/>
+ </genClasses>
+ <genClasses ecoreClass="XMLmodel.ecore#//ClassElement">
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference XMLmodel.ecore#//ClassElement/ecoreClass"/>
+ </genClasses>
<genClasses ecoreClass="XMLmodel.ecore#//Comment">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute XMLmodel.ecore#//Comment/data"/>
</genClasses>
@@ -24,11 +32,18 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute XMLmodel.ecore#//DTD/publicId"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute XMLmodel.ecore#//DTD/systemId"/>
</genClasses>
+ <genClasses ecoreClass="XMLmodel.ecore#//DataTypeAttribute">
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference XMLmodel.ecore#//DataTypeAttribute/ecoreAttribute"/>
+ </genClasses>
+ <genClasses ecoreClass="XMLmodel.ecore#//DataTypeElement">
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference XMLmodel.ecore#//DataTypeElement/ecoreDataType"/>
+ </genClasses>
<genClasses ecoreClass="XMLmodel.ecore#//Document"/>
<genClasses ecoreClass="XMLmodel.ecore#//Element">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute XMLmodel.ecore#//Element/localName"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute XMLmodel.ecore#//Element/qName"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute XMLmodel.ecore#//Element/uri"/>
+ <genFeatures property="Readonly" notify="false" createChild="false" ecoreFeature="ecore:EReference XMLmodel.ecore#//Element/ecoreClassifier"/>
</genClasses>
<genClasses ecoreClass="XMLmodel.ecore#//Entity">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute XMLmodel.ecore#//Entity/name"/>
diff --git a/plugins/org.eclipse.qvtd.xml/src/org/eclipse/qvtd/xml/utilities/XMLmodelResourceImpl.java b/plugins/org.eclipse.qvtd.xml/src/org/eclipse/qvtd/xml/utilities/XMLmodelResourceImpl.java
index 00da9ce7f..0218c313e 100644
--- a/plugins/org.eclipse.qvtd.xml/src/org/eclipse/qvtd/xml/utilities/XMLmodelResourceImpl.java
+++ b/plugins/org.eclipse.qvtd.xml/src/org/eclipse/qvtd/xml/utilities/XMLmodelResourceImpl.java
@@ -14,6 +14,7 @@
*/
package org.eclipse.qvtd.xml.utilities;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Stack;
@@ -21,8 +22,23 @@ import java.util.Stack;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
+import org.eclipse.emf.common.util.SegmentSequence;
import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.common.util.WrappedException;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.impl.BasicEObjectImpl;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.emf.ecore.xmi.XMIException;
import org.eclipse.emf.ecore.xmi.XMLHelper;
import org.eclipse.emf.ecore.xmi.XMLLoad;
import org.eclipse.emf.ecore.xmi.XMLResource;
@@ -31,11 +47,16 @@ import org.eclipse.emf.ecore.xmi.impl.XMILoadImpl;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl;
import org.eclipse.emf.ecore.xmi.impl.XMISaveImpl;
import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.qvtd.xml.Attribute;
import org.eclipse.qvtd.xml.CDATA;
import org.eclipse.qvtd.xml.Characters;
+import org.eclipse.qvtd.xml.ClassAttribute;
+import org.eclipse.qvtd.xml.ClassElement;
import org.eclipse.qvtd.xml.Comment;
import org.eclipse.qvtd.xml.DTD;
+import org.eclipse.qvtd.xml.DataTypeAttribute;
+import org.eclipse.qvtd.xml.DataTypeElement;
import org.eclipse.qvtd.xml.Document;
import org.eclipse.qvtd.xml.Element;
import org.eclipse.qvtd.xml.Entity;
@@ -43,6 +64,7 @@ import org.eclipse.qvtd.xml.Node;
import org.eclipse.qvtd.xml.PrefixMapping;
import org.eclipse.qvtd.xml.ProcessingInstruction;
import org.eclipse.qvtd.xml.XMLmodelFactory;
+import org.eclipse.qvtd.xml.XMLmodelPackage;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.ext.LexicalHandler;
@@ -56,6 +78,12 @@ import org.xml.sax.helpers.DefaultHandler;
*/
public class XMLmodelResourceImpl extends XMIResourceImpl
{
+ /**
+ * By default xmlns references to user URIs are resolved to EPackages enabling accurate resolution of
+ * xsi:Type child elements and reference resolution.
+ */
+ public static final @NonNull String IGNORE_ECORE = "ignore-ecore";
+
public static class XMLmodelLoadImpl extends XMILoadImpl
{
private SAXParser makeParser = null;
@@ -84,12 +112,31 @@ public class XMLmodelResourceImpl extends XMIResourceImpl
public static class XMLmodelHandler extends DefaultHandler implements LexicalHandler
{
+ private ResourceSet resourceSet = new ResourceSetImpl();
private XMLResource xmlResource;
private Document document = null;
private @NonNull Stack<@NonNull Node> nodeStack = new Stack<>();
+ private boolean useEcore;
+
+ /**
+ * Map from xmlns prefix to its corresponding URI. The default xmlns namespace is the blank string.
+ */
+ protected final @NonNull Map<@NonNull String, @NonNull String> xmlns2uri = new HashMap<>();
+
+ /**
+ * Map from xmlns prefix to its corresponding EPackage. The default xmlns namespace is the blank string.
+ */
+ protected final @NonNull Map<@NonNull String, @NonNull EPackage> xmlns2ePackage = new HashMap<>();
+ protected final @NonNull Map<@NonNull String, @NonNull String> uri2schemaLocation = new HashMap<>();
+ protected final @NonNull Map<@NonNull String, @NonNull Element> xmiid2element = new HashMap<>();
public XMLmodelHandler(XMLResource xmlResource, XMLHelper helper, Map<?, ?> options) {
this.xmlResource = xmlResource;
+ this.useEcore = (options == null) || (options.get(IGNORE_ECORE) != Boolean.TRUE);
+ }
+
+ protected void addError(@NonNull String string) {
+ xmlResource.getErrors().add(new XMIException(string));
}
protected void addNode(Node node) {
@@ -101,6 +148,105 @@ public class XMLmodelResourceImpl extends XMIResourceImpl
}
}
+ protected void addWarning(@NonNull String string) {
+ xmlResource.getWarnings().add(new XMIException(string));
+ }
+
+ protected @Nullable Element basicGetChildElement(@NonNull Element parentElement, @NonNull String pathElement) {
+ if (pathElement.length() <= 0) {
+ return basicGetChildElementByIndex(parentElement, 0);
+ }
+ char firstChar = pathElement.charAt(0);
+ if (firstChar == '@') {
+ String childName;
+ int childIndex = -1;
+ int index = pathElement.indexOf('.');
+ if (index >= 0) {
+ childName = pathElement.substring(1, index);
+ childIndex = Integer.valueOf(pathElement.substring(index+1));
+ }
+ else {
+ childName = pathElement.substring(1);
+ childIndex = 0;
+ }
+ return basicGetChildElementByName(parentElement, childName, childIndex);
+ }
+ else if (Character.isDigit(firstChar)) {
+ int childIndex = Integer.valueOf(pathElement);
+ return basicGetChildElementByIndex(parentElement, childIndex);
+ }
+ else {
+ return basicGetChildElementByEClassName(parentElement, pathElement); // Ecore EClassifier.name match
+ }
+ }
+
+ protected @Nullable Element basicGetChildElementByEClassName(@NonNull Element parentElement, @NonNull String childName) {
+ for (@NonNull Node childNode : parentElement.getChildren()) {
+ if (childNode instanceof Element) {
+ Element childElement = (Element)childNode;
+ for (@NonNull Node grandchildNode : childElement.getChildren()) {
+ if (grandchildNode instanceof DataTypeAttribute) {
+ DataTypeAttribute grandchildElement = (DataTypeAttribute)grandchildNode;
+ if (grandchildElement.getEcoreAttribute() == EcorePackage.Literals.ENAMED_ELEMENT__NAME) {
+ if (childName.equals(grandchildElement.getValue())) {
+ return childElement;
+ }
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ protected @Nullable Element basicGetChildElementByIndex(@NonNull Element parentElement, int childElementIndex) {
+ int matchIndex = 0;
+ for (@NonNull Node childNode : parentElement.getChildren()) {
+ if (childNode instanceof Element) {
+ Element childElement = (Element)childNode;
+ if (matchIndex == childElementIndex) {
+ return childElement;
+ }
+ matchIndex++;
+ }
+ }
+ return null;
+ }
+
+ protected @Nullable Element basicGetChildElementByName(@NonNull Element parentElement, @NonNull String childName, int childIndex) {
+ int matchIndex = 0;
+ for (@NonNull Node childNode : parentElement.getChildren()) {
+ if (childNode instanceof Element) {
+ Element childElement = (Element)childNode;
+ if (childName.equals(childElement.getQName())) {
+ if (matchIndex == childIndex) {
+ return childElement;
+ }
+ matchIndex++;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the object based on the fragment path as a list of Strings.
+ */
+ protected @Nullable Element basicGetElementForPath(List<String> uriFragmentPath) {
+ int size = uriFragmentPath.size();
+ Element element = getRootElement(size == 0 ? "" : uriFragmentPath.get(0));
+ for (int i = 1; i < size && element != null; ++i)
+ {
+ String uriFragmentSegment = uriFragmentPath.get(i);
+ element = basicGetChildElement(element, uriFragmentSegment);
+ }
+ return element;
+ }
+
+ private @Nullable EPackage basicGetEPackage(@NonNull String prefix) {
+ return xmlns2ePackage.get(prefix);
+ }
+
@Override
public void characters(char[] ch, int start, int length) {
boolean isWhite = true;
@@ -141,12 +287,29 @@ public class XMLmodelResourceImpl extends XMIResourceImpl
@Override
public void endDocument() {
xmlResource.getContents().add(document);
+ resolveReferences(document);
document = null;
}
@Override
public void endElement(String uri, String localName, String name) {
- nodeStack.pop();
+ Node node = nodeStack.pop();
+ if (node instanceof ClassElement) {
+ ClassElement element = (ClassElement)node;
+ EClass ecoreClass = element.getEcoreClass();
+ if (ecoreClass != null) {
+ EAttribute idAttribute = ecoreClass.getEIDAttribute();
+ if (idAttribute != null) {
+ Object id = element.eGet(idAttribute);
+ if (id != null) {
+ Element oldElement = xmiid2element.put(String.valueOf(id), element);
+ if (oldElement != null) {
+ addError("Ambiguous xmi:id '" + id + "'");
+ }
+ }
+ }
+ }
+ }
}
@Override
@@ -159,6 +322,254 @@ public class XMLmodelResourceImpl extends XMIResourceImpl
nodeStack.pop();
}
+ protected @Nullable EClassifier getEClassifier(@NonNull String qName) {
+ String prefix = "";
+ int colonIndex = qName.indexOf(":");
+ String suffix = qName;
+ if (colonIndex >= 0) {
+ prefix = qName.substring(0, colonIndex);
+ suffix = qName.substring(colonIndex+1);
+ }
+ EPackage ePackage = getEPackage(prefix);
+ if (ePackage != null) {
+ EClassifier eClassifier = ePackage.getEClassifier(suffix);
+ if (eClassifier != null) {
+ return eClassifier;
+ }
+ }
+ addError("Failed to locate an EClassifier for '" + qName + "'");
+ return null;
+ }
+
+ protected @Nullable EPackage getEPackage(@NonNull String prefix) {
+ EPackage ePackage = xmlns2ePackage.get(prefix);
+ if (ePackage == null) {
+ String uri = getURIofXMLNS(prefix); // FIXME xsi:schemaLocation
+ if ((uri != null) && !ExtendedMetaData.XMI_URI.equals(uri)) {
+ ePackage = resourceSet.getPackageRegistry().getEPackage(uri);
+ if (ePackage instanceof EPackage.Descriptor) {
+ ePackage = ((EPackage.Descriptor)ePackage).getEPackage();
+ }
+ if (ePackage != null) {
+ xmlns2ePackage.put(prefix, ePackage);
+ }
+ else if (!xmlns2ePackage.containsKey(prefix)) {
+ xmlns2ePackage.put(prefix, null);
+ if (useEcore) {
+ addError("Failed to locate EPackage for '" + uri + "'");
+ }
+ else {
+ // addWarning("Failed to locate EPackage for '" + uri + "'");
+ }
+ }
+ }
+ }
+ return ePackage;
+ }
+
+ protected @Nullable Element getElementAtChildIndex(@NonNull Node node, int index) {
+ int elementIndex = 0;
+ for (@NonNull Node child : node.getChildren()) {
+ if (child instanceof Element) {
+ if (elementIndex == index) {
+ return (Element)child;
+ }
+ elementIndex++;
+ }
+ }
+ return null;
+ }
+
+ protected @Nullable Element getElement(@NonNull String uriFragment) {
+ // based on ResourceImpl.getEObject etc
+ int length = uriFragment.length();
+ if (length > 0) {
+ if (uriFragment.charAt(0) == '/') {
+ List<String> path = SegmentSequence.create("/", uriFragment).subSegmentsList(1);
+ Element element = basicGetElementForPath(path);
+ if (element == null) {
+ addError("Failed to resolve '" + uriFragment + "'");
+ }
+ return element;
+ }
+ else if (uriFragment.charAt(length - 1) == '?') {
+ int index = uriFragment.lastIndexOf('?', length - 2);
+ if (index > 0) {
+ uriFragment = uriFragment.substring(0, index);
+ }
+ }
+ }
+ Element element = xmiid2element.get(uriFragment);
+ if (element == null) {
+ addError("Failed to resolve xmi:id '" + uriFragment + "'");
+ }
+ return element;
+ }
+
+ /**
+ * Returns the object associated with the URI fragment root segment.
+ * This default implementation uses the position of the object;
+ * an empty string is the same as <code>"0"</code>.
+ * @return the object associated with the URI fragment root segment.
+ */
+ protected @Nullable Element getRootElement(String uriFragmentRootSegment) {
+ int position = 0;
+ if (uriFragmentRootSegment.length() > 0) {
+ if (uriFragmentRootSegment.charAt(0) == '?') {
+ return xmiid2element.get(uriFragmentRootSegment.substring(1));
+ }
+ try {
+ position = Integer.parseInt(uriFragmentRootSegment);
+ }
+ catch (NumberFormatException exception) {
+ throw new WrappedException(exception);
+ }
+ }
+ Node rootElement = document;
+ List<Node> rootChildren = rootElement.getChildren();
+ if (rootChildren.size() == 1) {
+ Node onlyChild = rootChildren.get(0);
+ if (onlyChild.eClass() == XMLmodelPackage.Literals.ELEMENT) { // Not a ClassElement
+ rootElement = onlyChild;
+ }
+ }
+ return getElementAtChildIndex(rootElement, position);
+ }
+
+ protected @Nullable String getURIofXMLNS(@NonNull String xmlnsPrefix) {
+ String value = xmlns2uri.get(xmlnsPrefix);
+ if (value == null) {
+ addError("Unresolved XMLNS prefix '" + xmlnsPrefix + "'");
+ };
+ return value;
+ }
+
+ protected @Nullable EClassifier getXsiType(@NonNull Attributes attributes) {
+ int length = attributes.getLength();
+ for (int index = 0; index < length; index++) {
+ String qName = attributes.getQName(index);
+ if (qNameEquals(qName, ExtendedMetaData.XMI_URI, "type") || qNameEquals(qName, ExtendedMetaData.XSI_URI, "type")) {
+ String value = attributes.getValue(index);
+ return getEClassifier(value);
+ }
+ }
+ return null;
+ }
+
+ protected void processAttribute(@NonNull Element element, @NonNull String attributeQName, @NonNull String value) {
+ Attribute attribute = null;
+ Element childElement = null;
+ int colonIndex = attributeQName.indexOf(':');
+ if (colonIndex >= 0) {
+ attribute = XMLmodelFactory.eINSTANCE.createAttribute();
+ if (qNameEquals(attributeQName, ExtendedMetaData.XMI_URI, "id")) {
+ Element oldElement = xmiid2element.put(value, element);
+ if (oldElement != null) {
+ addError("Ambiguous xmi:id '" + value + "'");
+ }
+ }
+ }
+ else if (ExtendedMetaData.XMLNS_PREFIX.equals(attributeQName)) {
+ attribute = XMLmodelFactory.eINSTANCE.createAttribute();
+ }
+ else {
+ EClassifier ecoreClassifier = element.getEcoreClassifier();
+ if (ecoreClassifier == null) {
+ attribute = XMLmodelFactory.eINSTANCE.createAttribute();
+ }
+ else if (ecoreClassifier instanceof EClass) {
+ EStructuralFeature eFeature = ((EClass)ecoreClassifier).getEStructuralFeature(attributeQName);
+ if (eFeature instanceof EAttribute) {
+ DataTypeAttribute dataTypeAttribute = XMLmodelFactory.eINSTANCE.createDataTypeAttribute();
+ dataTypeAttribute.setEcoreAttribute((EAttribute) eFeature);
+ attribute = dataTypeAttribute;
+ }
+ else {
+ ClassAttribute classAttribute = XMLmodelFactory.eINSTANCE.createClassAttribute();
+ classAttribute.setEcoreReference((EReference) eFeature);
+ attribute = classAttribute;
+ }
+ }
+ else if (ecoreClassifier instanceof EDataType) {
+ DataTypeElement dataTypeElement = XMLmodelFactory.eINSTANCE.createDataTypeElement();
+ dataTypeElement.setEcoreDataType((EDataType) ecoreClassifier);
+ childElement = dataTypeElement;
+ }
+ else {
+ childElement = XMLmodelFactory.eINSTANCE.createElement();
+ // EStructuralFeature eFeature = ((EClass)ecoreClassifier).getEStructuralFeature(attributeQName);
+ // if (eFeature instanceof EAttribute) {
+ // DataTypeAttribute dataTypeAttribute = XMLmodelFactory.eINSTANCE.createDataTypeAttribute();
+ // dataTypeAttribute.setEcoreAttribute((EAttribute) eFeature);
+ // attribute = dataTypeAttribute;
+ // }
+ // else {
+ // ClassAttribute classAttribute = XMLmodelFactory.eINSTANCE.createClassAttribute();
+ // classAttribute.setEcoreReference((EReference) eFeature);
+ // attribute = classAttribute;
+ // }
+ }
+ }
+ if (attribute != null) {
+ attribute.setName(attributeQName);
+ attribute.setValue(value);
+ element.getChildren().add(attribute);
+ }
+ else if (childElement != null) {
+ element.getChildren().add(childElement);
+ }
+ }
+
+ protected void processRootAttributes(@NonNull Attributes attributes) {
+ int length = attributes.getLength();
+ for (int index = 0; index < length; index++) {
+ String xmlns = null;
+ String qName = attributes.getQName(index);
+ int colonIndex = qName.indexOf(':');
+ if (colonIndex >= 0) {
+ String prefix = qName.substring(0, colonIndex);
+ if (ExtendedMetaData.XMLNS_PREFIX.equals(prefix)) {
+ xmlns = qName.substring(colonIndex+1);
+ }
+ }
+ else if (ExtendedMetaData.XMLNS_PREFIX.equals(qName)) {
+ xmlns = "";
+ }
+ if (xmlns != null) {
+ String newValue = attributes.getValue(index);
+ String oldValue = xmlns2uri.put(xmlns, newValue);
+ if (oldValue != null) {
+ addError("Conflicting '" + xmlns + "' XMLNS values '" + oldValue + "' and '" + newValue + "'");
+ }
+ }
+ }
+ for (int index = 0; index < length; index++) {
+ String qName = attributes.getQName(index);
+ int colonIndex = qName.indexOf(':');
+ if (colonIndex >= 0) {
+ String prefix = qName.substring(0, colonIndex);
+ if (!ExtendedMetaData.XMLNS_PREFIX.equals(prefix)) {
+ String suffix = qName.substring(colonIndex+1);
+ String uri = getURIofXMLNS(prefix);
+ if (ExtendedMetaData.XSI_URI.equals(uri) && "schemaLocation".equals(suffix)) {
+ String value = attributes.getValue(index);
+ int spaceIndex = value.indexOf(' ');
+ String schemaLocation = value;
+ String schemaURI = "";
+ if (spaceIndex >= 0) {
+ schemaLocation = value.substring(spaceIndex+1).trim();
+ schemaURI = value.substring(spaceIndex);
+ }
+ String oldValue = uri2schemaLocation.put(schemaURI, schemaLocation);
+ if (oldValue != null) {
+ addError("Conflicting '" + schemaURI + "' schemaLocation values '" + oldValue + "' and '" + schemaLocation + "'");
+ }
+ }
+ }
+ }
+ }
+ }
+
@Override
public void processingInstruction(String target, String data) {
ProcessingInstruction processingInstruction = XMLmodelFactory.eINSTANCE.createProcessingInstruction();
@@ -167,6 +578,65 @@ public class XMLmodelResourceImpl extends XMIResourceImpl
addNode(processingInstruction);
}
+ /**
+ * Return true if a qName such as 'xmi:id' corresponds to uri:name where uri is registered XMLNS URI for the
+ * qName prefix of defauly XMLNS if qName has no : to separate a prefix.
+ */
+ protected boolean qNameEquals(@NonNull String qName, @NonNull String uri, @NonNull String name) {
+ int colonIndex = qName.indexOf(':');
+ if (colonIndex < 0) {
+ if (!uri.equals(xmlns2uri.get(""))) {
+ return false;
+ }
+ return name.equals(qName);
+ }
+ else {
+ String prefix = qName.substring(0, colonIndex);
+ if (!uri.equals(xmlns2uri.get(prefix))) {
+ return false;
+ }
+ String suffix = qName.substring(colonIndex+1);
+ return name.equals(suffix);
+ }
+ }
+
+ protected void resolveReferences(@NonNull Node node) {
+ if (node instanceof ClassAttribute) {
+ ClassAttribute classAttribute = (ClassAttribute)node;
+ String[] values = classAttribute.getValue().split(" ");
+ for (int i = 0; i < values.length; i++) {
+ EClassifier eClassifier = classAttribute.getEcoreReference().getEType();
+ String value = values[i].trim();
+ int hashIndex = value.indexOf('#');
+ if ((hashIndex < 0) && ((i+1) < values.length)) {
+ String nextValue = values[i+1].trim();
+ int nextHashIndex = nextValue.indexOf('#');
+ if (nextHashIndex > 0) {
+ eClassifier = getEClassifier(value);
+ i++; // Skip type prefix to external reference
+ value = nextValue;
+ hashIndex = nextHashIndex;
+ }
+ }
+ if (value.length() > 0) {
+ EObject resolvedElement = null;
+ if (hashIndex <= 0) { // absent or at start
+ resolvedElement = getElement(hashIndex < 0 ? value : value.substring(1));
+ }
+ if (resolvedElement == null) {
+ resolvedElement = eClassifier.getEPackage().getEFactoryInstance().create((EClass) eClassifier);
+ ((BasicEObjectImpl)resolvedElement).eSetProxyURI(URI.createURI(value));
+ }
+ classAttribute.getEObjects().add(resolvedElement);
+ // }
+ }
+ }
+ }
+ for (@NonNull Node child : node.getChildren()) {
+ resolveReferences(child);
+ }
+ }
+
@Override
public void startCDATA() {
CDATA cdata = XMLmodelFactory.eINSTANCE.createCDATA();
@@ -191,15 +661,81 @@ public class XMLmodelResourceImpl extends XMIResourceImpl
@Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
- Element element = XMLmodelFactory.eINSTANCE.createElement();
+ if (nodeStack.isEmpty()) {
+ processRootAttributes(attributes);
+ }
+ EPackage ecorePackage = null;
+ EClassifier ecoreClassifier = null;
+ String name = qName;
+ int colonIndex = qName.indexOf(':');
+ if (colonIndex >= 0) { // Qualified element name
+ String prefix = qName.substring(0, colonIndex);
+ name = qName.substring(colonIndex+1);
+ ecorePackage = getEPackage(prefix);
+ if (ecorePackage != null) {
+ ecoreClassifier = ecorePackage.getEClassifier(name);
+ if (ecoreClassifier == null) {
+ addError("Failed to locate EClassifier '" + name + "' in '" + ecorePackage.getNsURI() + "'");
+ }
+ }
+ }
+ else {
+ ecoreClassifier = getXsiType(attributes);
+ if (ecoreClassifier == null) {
+ ecorePackage = basicGetEPackage("");
+ if (ecorePackage != null) {
+ ecoreClassifier = ecorePackage.getEClassifier(name);
+ if (ecoreClassifier == null) {
+ addError("Failed to locate EClassifier '" + name + "' in '" + ecorePackage.getNsURI() + "'");
+ }
+ }
+ else {
+ Element container = (Element)nodeStack.peek();
+ EClassifier ecoreContainerClassifier = container.getEcoreClassifier();
+ if (ecoreContainerClassifier instanceof EClass) {
+ EStructuralFeature eStructuralFeature = ((EClass)ecoreContainerClassifier).getEStructuralFeature(name);
+ if (eStructuralFeature != null) {
+ ecoreClassifier = eStructuralFeature.getEType();
+ }
+ else {
+ addError("Failed to locate EStructuralFeature '" + name + "' in '" + ecoreContainerClassifier.getName() + "'");
+ }
+ }
+ else if (ecoreContainerClassifier instanceof EDataType) {
+ // EReference ecoreContainerReference = (EAttribute) ((EDataType)ecoreContainerClassifier).getEStructuralFeature(name);
+ // if (ecoreContainerReference != null) {
+ // ecoreClass = ecoreContainerReference.getEReferenceType();
+ // }
+ // else {
+ // addError("Failed to locate EReference '" + name + "' in '" + ecoreContainerClassifier.getName() + "'");
+ // }
+ }
+ }
+ }
+ }
+
+ Element element;
+ if (ecoreClassifier instanceof EClass) {
+ ClassElement classElement = XMLmodelFactory.eINSTANCE.createClassElement();
+ classElement.setEcoreClass((EClass) ecoreClassifier);
+ element = classElement;
+ }
+ else if (ecoreClassifier instanceof EDataType) {
+ DataTypeElement dataTypeElement = XMLmodelFactory.eINSTANCE.createDataTypeElement();
+ dataTypeElement.setEcoreDataType((EDataType) ecoreClassifier);
+ element = dataTypeElement;
+ }
+ else {
+ element = XMLmodelFactory.eINSTANCE.createElement();
+ }
element.setUri(uri);
element.setLocalName(localName);
element.setQName(qName);
- for (int index = 0; index < attributes.getLength(); index++) {
- Attribute attribute = XMLmodelFactory.eINSTANCE.createAttribute();
- attribute.setName(attributes.getQName(index));
- attribute.setValue(attributes.getValue(index));
- element.getChildren().add(attribute);
+ int length = attributes.getLength();
+ for (int index = 0; index < length; index++) {
+ String attributeQName = attributes.getQName(index);
+ String value = attributes.getValue(index);
+ processAttribute(element, attributeQName, value);
}
addNode(element);
nodeStack.push(element);
diff --git a/tests/org.eclipse.qvtd.all.tests/models/Families2Persons.atl.xmi b/tests/org.eclipse.qvtd.all.tests/models/Families2Persons.atl.xmi
new file mode 100644
index 000000000..bfeead42d
--- /dev/null
+++ b/tests/org.eclipse.qvtd.all.tests/models/Families2Persons.atl.xmi
@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="ASCII"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:atl="http://www.eclipse.org/gmt/2005/ATL" xmlns:ocl="http://www.eclipse.org/gmt/2005/OCL">
+ <atl:Module location="5:1-50:2" name="Families2Persons">
+ <commentsBefore>-- @atlcompiler emftvm</commentsBefore>
+ <commentsBefore>-- @path Families=/org.eclipse.qvtd.xtext.qvtrelation.tests/models/families2persons/Families.ecore</commentsBefore>
+ <commentsBefore>-- @path Persons=/org.eclipse.qvtd.xtext.qvtrelation.tests/models/families2persons/Persons.ecore</commentsBefore>
+ <inModels location="6:27-6:40" name="IN" metamodel="/2"/>
+ <outModels location="6:8-6:21" name="OUT" metamodel="/1"/>
+ <elements xsi:type="atl:Helper" location="8:1-21:8">
+ <definition location="8:8-21:7">
+ <feature xsi:type="ocl:Attribute" location="8:37-21:7" name="familyName">
+ <initExpression xsi:type="ocl:IfExp" location="9:2-21:7">
+ <thenExpression xsi:type="ocl:NavigationOrAttributeCallExp" location="10:3-10:29" name="lastName">
+ <source xsi:type="ocl:NavigationOrAttributeCallExp" location="10:3-10:20" name="familyFather">
+ <source xsi:type="ocl:VariableExp" location="10:3-10:7" referredVariable="/4"/>
+ </source>
+ </thenExpression>
+ <condition xsi:type="ocl:OperatorCallExp" location="9:5-9:43" operationName="not">
+ <source xsi:type="ocl:OperationCallExp" location="9:9-9:43" operationName="oclIsUndefined">
+ <source xsi:type="ocl:NavigationOrAttributeCallExp" location="9:9-9:26" name="familyFather">
+ <source xsi:type="ocl:VariableExp" location="9:9-9:13" referredVariable="/3"/>
+ </source>
+ </source>
+ </condition>
+ <elseExpression xsi:type="ocl:IfExp" location="12:3-20:8">
+ <thenExpression xsi:type="ocl:NavigationOrAttributeCallExp" location="13:4-13:30" name="lastName">
+ <source xsi:type="ocl:NavigationOrAttributeCallExp" location="13:4-13:21" name="familyMother">
+ <source xsi:type="ocl:VariableExp" location="13:4-13:8" referredVariable="/6"/>
+ </source>
+ </thenExpression>
+ <condition xsi:type="ocl:OperatorCallExp" location="12:6-12:44" operationName="not">
+ <source xsi:type="ocl:OperationCallExp" location="12:10-12:44" operationName="oclIsUndefined">
+ <source xsi:type="ocl:NavigationOrAttributeCallExp" location="12:10-12:27" name="familyMother">
+ <source xsi:type="ocl:VariableExp" location="12:10-12:14" referredVariable="/5"/>
+ </source>
+ </source>
+ </condition>
+ <elseExpression xsi:type="ocl:IfExp" location="15:4-19:9">
+ <thenExpression xsi:type="ocl:NavigationOrAttributeCallExp" location="16:5-16:28" name="lastName">
+ <source xsi:type="ocl:NavigationOrAttributeCallExp" location="16:5-16:19" name="familySon">
+ <source xsi:type="ocl:VariableExp" location="16:5-16:9" referredVariable="/8"/>
+ </source>
+ </thenExpression>
+ <condition xsi:type="ocl:OperatorCallExp" location="15:7-15:42" operationName="not">
+ <source xsi:type="ocl:OperationCallExp" location="15:11-15:42" operationName="oclIsUndefined">
+ <source xsi:type="ocl:NavigationOrAttributeCallExp" location="15:11-15:25" name="familySon">
+ <source xsi:type="ocl:VariableExp" location="15:11-15:15" referredVariable="/7"/>
+ </source>
+ </source>
+ </condition>
+ <elseExpression xsi:type="ocl:NavigationOrAttributeCallExp" location="18:5-18:33" name="lastName">
+ <source xsi:type="ocl:NavigationOrAttributeCallExp" location="18:5-18:24" name="familyDaughter">
+ <source xsi:type="ocl:VariableExp" location="18:5-18:9" referredVariable="/9"/>
+ </source>
+ </elseExpression>
+ </elseExpression>
+ </elseExpression>
+ </initExpression>
+ <type xsi:type="ocl:StringType" location="8:50-8:56"/>
+ </feature>
+ <context_ location="8:8-8:31">
+ <context_ xsi:type="ocl:OclModelElement" location="8:16-8:31" name="Member" model="/2"/>
+ </context_>
+ </definition>
+ </elements>
+ <elements xsi:type="atl:Helper" location="23:1-32:8">
+ <definition location="23:8-32:7">
+ <feature xsi:type="ocl:Operation" location="23:37-32:7" name="isFemale">
+ <returnType xsi:type="ocl:BooleanType" location="23:50-23:57"/>
+ <body xsi:type="ocl:IfExp" location="24:2-32:7">
+ <thenExpression xsi:type="ocl:BooleanExp" location="25:3-25:7" booleanSymbol="true"/>
+ <condition xsi:type="ocl:OperatorCallExp" location="24:5-24:43" operationName="not">
+ <source xsi:type="ocl:OperationCallExp" location="24:9-24:43" operationName="oclIsUndefined">
+ <source xsi:type="ocl:NavigationOrAttributeCallExp" location="24:9-24:26" name="familyMother">
+ <source xsi:type="ocl:VariableExp" location="24:9-24:13" referredVariable="/10"/>
+ </source>
+ </source>
+ </condition>
+ <elseExpression xsi:type="ocl:IfExp" location="27:3-31:8">
+ <thenExpression xsi:type="ocl:BooleanExp" location="28:4-28:8" booleanSymbol="true"/>
+ <condition xsi:type="ocl:OperatorCallExp" location="27:6-27:46" operationName="not">
+ <source xsi:type="ocl:OperationCallExp" location="27:10-27:46" operationName="oclIsUndefined">
+ <source xsi:type="ocl:NavigationOrAttributeCallExp" location="27:10-27:29" name="familyDaughter">
+ <source xsi:type="ocl:VariableExp" location="27:10-27:14" referredVariable="/11"/>
+ </source>
+ </source>
+ </condition>
+ <elseExpression xsi:type="ocl:BooleanExp" location="30:4-30:9"/>
+ </elseExpression>
+ </body>
+ </feature>
+ <context_ location="23:8-23:31">
+ <context_ xsi:type="ocl:OclModelElement" location="23:16-23:31" name="Member" model="/2"/>
+ </context_>
+ </definition>
+ </elements>
+ <elements xsi:type="atl:MatchedRule" location="34:1-41:2" name="Member2Male">
+ <outPattern location="37:2-40:4">
+ <elements xsi:type="atl:SimpleOutPatternElement" location="38:3-40:4" varName="t">
+ <type xsi:type="ocl:OclModelElement" location="38:7-38:19" name="Male" model="/1"/>
+ <bindings location="39:4-39:48" propertyName="fullName">
+ <value xsi:type="ocl:OperatorCallExp" location="39:16-39:48" operationName="+">
+ <source xsi:type="ocl:OperatorCallExp" location="39:16-39:33" operationName="+">
+ <source xsi:type="ocl:NavigationOrAttributeCallExp" location="39:16-39:27" name="firstName">
+ <source xsi:type="ocl:VariableExp" location="39:16-39:17" referredVariable="/0/@elements.2/@inPattern/@elements.0"/>
+ </source>
+ <arguments xsi:type="ocl:StringExp" location="39:30-39:33" stringSymbol=" "/>
+ </source>
+ <arguments xsi:type="ocl:NavigationOrAttributeCallExp" location="39:36-39:48" name="familyName">
+ <source xsi:type="ocl:VariableExp" location="39:36-39:37" referredVariable="/0/@elements.2/@inPattern/@elements.0"/>
+ </arguments>
+ </value>
+ </bindings>
+ </elements>
+ </outPattern>
+ <inPattern location="35:2-36:41">
+ <elements xsi:type="atl:SimpleInPatternElement" location="36:3-36:22" varName="s" variableExp="/0/@elements.2/@inPattern/@filter/@source/@source /0/@elements.2/@outPattern/@elements.0/@bindings.0/@value/@source/@source/@source /0/@elements.2/@outPattern/@elements.0/@bindings.0/@value/@arguments.0/@source">
+ <type xsi:type="ocl:OclModelElement" location="36:7-36:22" name="Member" model="/2"/>
+ </elements>
+ <filter xsi:type="ocl:OperatorCallExp" location="36:24-36:40" operationName="not">
+ <source xsi:type="ocl:OperationCallExp" location="36:28-36:40" operationName="isFemale">
+ <source xsi:type="ocl:VariableExp" location="36:28-36:29" referredVariable="/0/@elements.2/@inPattern/@elements.0"/>
+ </source>
+ </filter>
+ </inPattern>
+ </elements>
+ <elements xsi:type="atl:MatchedRule" location="43:1-50:2" name="Member2Female">
+ <outPattern location="46:2-49:4">
+ <elements xsi:type="atl:SimpleOutPatternElement" location="47:3-49:4" varName="t">
+ <type xsi:type="ocl:OclModelElement" location="47:7-47:21" name="Female" model="/1"/>
+ <bindings location="48:4-48:48" propertyName="fullName">
+ <value xsi:type="ocl:OperatorCallExp" location="48:16-48:48" operationName="+">
+ <source xsi:type="ocl:OperatorCallExp" location="48:16-48:33" operationName="+">
+ <source xsi:type="ocl:NavigationOrAttributeCallExp" location="48:16-48:27" name="firstName">
+ <source xsi:type="ocl:VariableExp" location="48:16-48:17" referredVariable="/0/@elements.3/@inPattern/@elements.0"/>
+ </source>
+ <arguments xsi:type="ocl:StringExp" location="48:30-48:33" stringSymbol=" "/>
+ </source>
+ <arguments xsi:type="ocl:NavigationOrAttributeCallExp" location="48:36-48:48" name="familyName">
+ <source xsi:type="ocl:VariableExp" location="48:36-48:37" referredVariable="/0/@elements.3/@inPattern/@elements.0"/>
+ </arguments>
+ </value>
+ </bindings>
+ </elements>
+ </outPattern>
+ <inPattern location="44:2-45:37">
+ <elements xsi:type="atl:SimpleInPatternElement" location="45:3-45:22" varName="s" variableExp="/0/@elements.3/@inPattern/@filter/@source /0/@elements.3/@outPattern/@elements.0/@bindings.0/@value/@source/@source/@source /0/@elements.3/@outPattern/@elements.0/@bindings.0/@value/@arguments.0/@source">
+ <type xsi:type="ocl:OclModelElement" location="45:7-45:22" name="Member" model="/2"/>
+ </elements>
+ <filter xsi:type="ocl:OperationCallExp" location="45:24-45:36" operationName="isFemale">
+ <source xsi:type="ocl:VariableExp" location="45:24-45:25" referredVariable="/0/@elements.3/@inPattern/@elements.0"/>
+ </filter>
+ </inPattern>
+ </elements>
+ </atl:Module>
+ <ocl:OclModel location="6:14-6:21" name="Persons" elements="/0/@elements.2/@outPattern/@elements.0/@type /0/@elements.3/@outPattern/@elements.0/@type" model="/0/@outModels.0"/>
+ <ocl:OclModel location="6:32-6:40" name="Families" elements="/0/@elements.0/@definition/@context_/@context_ /0/@elements.1/@definition/@context_/@context_ /0/@elements.2/@inPattern/@elements.0/@type /0/@elements.3/@inPattern/@elements.0/@type" model="/0/@inModels.0"/>
+ <ocl:VariableDeclaration location="9:9-9:13" varName="self" variableExp="/0/@elements.0/@definition/@feature/@initExpression/@condition/@source/@source/@source"/>
+ <ocl:VariableDeclaration location="10:3-10:7" varName="self" variableExp="/0/@elements.0/@definition/@feature/@initExpression/@thenExpression/@source/@source"/>
+ <ocl:VariableDeclaration location="12:10-12:14" varName="self" variableExp="/0/@elements.0/@definition/@feature/@initExpression/@elseExpression/@condition/@source/@source/@source"/>
+ <ocl:VariableDeclaration location="13:4-13:8" varName="self" variableExp="/0/@elements.0/@definition/@feature/@initExpression/@elseExpression/@thenExpression/@source/@source"/>
+ <ocl:VariableDeclaration location="15:11-15:15" varName="self" variableExp="/0/@elements.0/@definition/@feature/@initExpression/@elseExpression/@elseExpression/@condition/@source/@source/@source"/>
+ <ocl:VariableDeclaration location="16:5-16:9" varName="self" variableExp="/0/@elements.0/@definition/@feature/@initExpression/@elseExpression/@elseExpression/@thenExpression/@source/@source"/>
+ <ocl:VariableDeclaration location="18:5-18:9" varName="self" variableExp="/0/@elements.0/@definition/@feature/@initExpression/@elseExpression/@elseExpression/@elseExpression/@source/@source"/>
+ <ocl:VariableDeclaration location="24:9-24:13" varName="self" variableExp="/0/@elements.1/@definition/@feature/@body/@condition/@source/@source/@source"/>
+ <ocl:VariableDeclaration location="27:10-27:14" varName="self" variableExp="/0/@elements.1/@definition/@feature/@body/@elseExpression/@condition/@source/@source/@source"/>
+</xmi:XMI>
diff --git a/tests/org.eclipse.qvtd.all.tests/models/Families2Persons.qvtras.xmi b/tests/org.eclipse.qvtd.all.tests/models/Families2Persons.qvtras.xmi
new file mode 100644
index 000000000..579332263
--- /dev/null
+++ b/tests/org.eclipse.qvtd.all.tests/models/Families2Persons.qvtras.xmi
@@ -0,0 +1,201 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<qvtr:RelationModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pivot="http://www.eclipse.org/ocl/2015/Pivot"
+ xmlns:qvtb="http://www.eclipse.org/qvt/2015/QVTbase" xmlns:qvtr="http://www.eclipse.org/qvt/2015/QVTrelation" xmlns:qvtt="http://www.eclipse.org/qvt/2015/QVTtemplate"
+ xsi:schemaLocation="http://www.eclipse.org/ocl/2015/Pivot java://org.eclipse.ocl.pivot.PivotPackage http://www.eclipse.org/qvt/2015/QVTbase java://org.eclipse.qvtd.pivot.qvtbase.QVTbasePackage http://www.eclipse.org/qvt/2015/QVTrelation java://org.eclipse.qvtd.pivot.qvtrelation.QVTrelationPackage http://www.eclipse.org/qvt/2015/QVTtemplate java://org.eclipse.qvtd.pivot.qvttemplate.QVTtemplatePackage"
+ xmi:id="AAAAA" externalURI="platform:/resource/_QVTd_QVTrCompilerTests__testQVTrCompiler_ATL2QVTr_CG/Families2Persons_CG.qvtras"
+ name="Families2Persons_CG.qvtras" xmiidVersion="1">
+ <ownedPackages xmi:id="6Fh3I" name="">
+ <ownedClasses xsi:type="qvtr:RelationalTransformation" xmi:id="lSZ2I" name="Families2Persons">
+ <modelParameter xmi:id="mAGsf" isTrace="true" name="middle"/>
+ <modelParameter xmi:id="z2sgS" name="Families" usedPackage="Families.ecore.oclas#ci1p7"/>
+ <modelParameter xmi:id="v4ega" name="Persons" usedPackage="Persons.ecore.oclas#YknpD"/>
+ <ownedContext xsi:type="pivot:ParameterVariable" xmi:id="DqXtJ" name="this" type="#lSZ2I"/>
+ <ownedOperations xsi:type="qvtb:Function" xmi:id="Gr4OV" name="familyName" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#AlwVZ">
+ <ownedParameters xsi:type="qvtb:FunctionParameter" xmi:id="lcaR4" name="self" type="pivot:Class Families.ecore.oclas#r2YVU"/>
+ <queryExpression xsi:type="pivot:IfExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#AlwVZ">
+ <ownedCondition xsi:type="pivot:OperationCallExp" name="not" referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#DH5kA"
+ type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#XEMMs">
+ <ownedSource xsi:type="pivot:OperationCallExp" name="oclIsUndefined" referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#aSwFn"
+ type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#XEMMs">
+ <ownedSource xsi:type="pivot:PropertyCallExp" name="familyFather" referredProperty="Families.ecore.oclas#31gsl"
+ type="pivot:Class Families.ecore.oclas#151KI">
+ <ownedSource xsi:type="pivot:VariableExp" name="self" referredVariable="#lcaR4" type="pivot:Class Families.ecore.oclas#r2YVU"/>
+ </ownedSource>
+ </ownedSource>
+ </ownedCondition>
+ <ownedElse xsi:type="pivot:IfExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#AlwVZ">
+ <ownedCondition xsi:type="pivot:OperationCallExp" name="not" referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#DH5kA"
+ type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#XEMMs">
+ <ownedSource xsi:type="pivot:OperationCallExp" name="oclIsUndefined" referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#aSwFn"
+ type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#XEMMs">
+ <ownedSource xsi:type="pivot:PropertyCallExp" name="familyMother" referredProperty="Families.ecore.oclas#eLUay"
+ type="pivot:Class Families.ecore.oclas#151KI">
+ <ownedSource xsi:type="pivot:VariableExp" name="self" referredVariable="#lcaR4" type="pivot:Class Families.ecore.oclas#r2YVU"/>
+ </ownedSource>
+ </ownedSource>
+ </ownedCondition>
+ <ownedElse xsi:type="pivot:IfExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#AlwVZ">
+ <ownedCondition xsi:type="pivot:OperationCallExp" name="not" referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#DH5kA"
+ type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#XEMMs">
+ <ownedSource xsi:type="pivot:OperationCallExp" name="oclIsUndefined" referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#aSwFn"
+ type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#XEMMs">
+ <ownedSource xsi:type="pivot:PropertyCallExp" name="familySon" referredProperty="Families.ecore.oclas#lstD1"
+ type="pivot:Class Families.ecore.oclas#151KI">
+ <ownedSource xsi:type="pivot:VariableExp" name="self" referredVariable="#lcaR4" type="pivot:Class Families.ecore.oclas#r2YVU"/>
+ </ownedSource>
+ </ownedSource>
+ </ownedCondition>
+ <ownedElse xsi:type="pivot:PropertyCallExp" name="lastName" referredProperty="Families.ecore.oclas#6dF3q"
+ type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#AlwVZ">
+ <ownedSource xsi:type="pivot:PropertyCallExp" name="familyDaughter" referredProperty="Families.ecore.oclas#j4ucQ"
+ type="pivot:Class Families.ecore.oclas#151KI">
+ <ownedSource xsi:type="pivot:VariableExp" name="self" referredVariable="#lcaR4" type="pivot:Class Families.ecore.oclas#r2YVU"/>
+ </ownedSource>
+ </ownedElse>
+ <ownedThen xsi:type="pivot:PropertyCallExp" name="lastName" referredProperty="Families.ecore.oclas#6dF3q"
+ type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#AlwVZ">
+ <ownedSource xsi:type="pivot:PropertyCallExp" name="familySon" referredProperty="Families.ecore.oclas#lstD1"
+ type="pivot:Class Families.ecore.oclas#151KI">
+ <ownedSource xsi:type="pivot:VariableExp" name="self" referredVariable="#lcaR4" type="pivot:Class Families.ecore.oclas#r2YVU"/>
+ </ownedSource>
+ </ownedThen>
+ </ownedElse>
+ <ownedThen xsi:type="pivot:PropertyCallExp" name="lastName" referredProperty="Families.ecore.oclas#6dF3q"
+ type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#AlwVZ">
+ <ownedSource xsi:type="pivot:PropertyCallExp" name="familyMother" referredProperty="Families.ecore.oclas#eLUay"
+ type="pivot:Class Families.ecore.oclas#151KI">
+ <ownedSource xsi:type="pivot:VariableExp" name="self" referredVariable="#lcaR4" type="pivot:Class Families.ecore.oclas#r2YVU"/>
+ </ownedSource>
+ </ownedThen>
+ </ownedElse>
+ <ownedThen xsi:type="pivot:PropertyCallExp" name="lastName" referredProperty="Families.ecore.oclas#6dF3q"
+ type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#AlwVZ">
+ <ownedSource xsi:type="pivot:PropertyCallExp" name="familyFather" referredProperty="Families.ecore.oclas#31gsl"
+ type="pivot:Class Families.ecore.oclas#151KI">
+ <ownedSource xsi:type="pivot:VariableExp" name="self" referredVariable="#lcaR4" type="pivot:Class Families.ecore.oclas#r2YVU"/>
+ </ownedSource>
+ </ownedThen>
+ </queryExpression>
+ </ownedOperations>
+ <ownedOperations xsi:type="qvtb:Function" xmi:id="N,BoB" name="isFemale" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#XEMMs">
+ <ownedParameters xsi:type="qvtb:FunctionParameter" xmi:id="QQAbF" name="self" type="pivot:Class Families.ecore.oclas#r2YVU"/>
+ <queryExpression xsi:type="pivot:IfExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#XEMMs">
+ <ownedCondition xsi:type="pivot:OperationCallExp" name="not" referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#DH5kA"
+ type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#XEMMs">
+ <ownedSource xsi:type="pivot:OperationCallExp" name="oclIsUndefined" referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#aSwFn"
+ type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#XEMMs">
+ <ownedSource xsi:type="pivot:PropertyCallExp" name="familyMother" referredProperty="Families.ecore.oclas#eLUay"
+ type="pivot:Class Families.ecore.oclas#151KI">
+ <ownedSource xsi:type="pivot:VariableExp" name="self" referredVariable="#QQAbF" type="pivot:Class Families.ecore.oclas#r2YVU"/>
+ </ownedSource>
+ </ownedSource>
+ </ownedCondition>
+ <ownedElse xsi:type="pivot:IfExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#XEMMs">
+ <ownedCondition xsi:type="pivot:OperationCallExp" name="not" referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#DH5kA"
+ type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#XEMMs">
+ <ownedSource xsi:type="pivot:OperationCallExp" name="oclIsUndefined" referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#aSwFn"
+ type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#XEMMs">
+ <ownedSource xsi:type="pivot:PropertyCallExp" name="familyDaughter" referredProperty="Families.ecore.oclas#j4ucQ"
+ type="pivot:Class Families.ecore.oclas#151KI">
+ <ownedSource xsi:type="pivot:VariableExp" name="self" referredVariable="#QQAbF" type="pivot:Class Families.ecore.oclas#r2YVU"/>
+ </ownedSource>
+ </ownedSource>
+ </ownedCondition>
+ <ownedElse xsi:type="pivot:BooleanLiteralExp" booleanSymbol="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#XEMMs"/>
+ <ownedThen xsi:type="pivot:BooleanLiteralExp" booleanSymbol="true" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#XEMMs"/>
+ </ownedElse>
+ <ownedThen xsi:type="pivot:BooleanLiteralExp" booleanSymbol="true" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#XEMMs"/>
+ </queryExpression>
+ </ownedOperations>
+ <rule xsi:type="qvtr:Relation" xmi:id="hcUQQ" isTopLevel="true" name="Member2Female">
+ <domain xsi:type="qvtr:RelationDomain" isCheckable="true" isEnforceable="false" rootVariable="#8tM8f" typedModel="#z2sgS">
+ <pattern>
+ <templateExpression xsi:type="qvtt:ObjectTemplateExp" bindsTo="#8tM8f" referredClass="Families.ecore.oclas#r2YVU"
+ type="pivot:Class Families.ecore.oclas#r2YVU"/>
+ </pattern>
+ </domain>
+ <domain xsi:type="qvtr:RelationDomain" isCheckable="false" isEnforceable="true" rootVariable="#9tM8f" typedModel="#v4ega">
+ <pattern>
+ <templateExpression xsi:type="qvtt:ObjectTemplateExp" bindsTo="#9tM8f" referredClass="Persons.ecore.oclas#pzC6s"
+ type="pivot:Class Persons.ecore.oclas#pzC6s">
+ <part referredProperty="Persons.ecore.oclas#8tc+u">
+ <value xsi:type="pivot:OperationCallExp" name="+" referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#gJ7dJ"
+ type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#AlwVZ">
+ <ownedArguments xsi:type="pivot:OperationCallExp" name="familyName" referredOperation="#Gr4OV" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#AlwVZ">
+ <ownedArguments xsi:type="pivot:VariableExp" name="s" referredVariable="#8tM8f" type="pivot:Class Families.ecore.oclas#r2YVU"/>
+ <ownedSource xsi:type="pivot:VariableExp" name="this" referredVariable="#DqXtJ" type="#lSZ2I"/>
+ </ownedArguments>
+ <ownedSource xsi:type="pivot:OperationCallExp" name="+" referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#gJ7dJ"
+ type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#AlwVZ">
+ <ownedArguments xsi:type="pivot:StringLiteralExp" stringSymbol=" " type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#AlwVZ"/>
+ <ownedSource xsi:type="pivot:PropertyCallExp" name="firstName" referredProperty="Families.ecore.oclas#yTUBO"
+ type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#AlwVZ">
+ <ownedSource xsi:type="pivot:VariableExp" name="s" referredVariable="#8tM8f" type="pivot:Class Families.ecore.oclas#r2YVU"/>
+ </ownedSource>
+ </ownedSource>
+ </value>
+ </part>
+ </templateExpression>
+ </pattern>
+ </domain>
+ <variable xsi:type="qvtr:TemplateVariable" xmi:id="8tM8f" name="s" type="pivot:Class Families.ecore.oclas#r2YVU"/>
+ <variable xsi:type="qvtr:TemplateVariable" xmi:id="9tM8f" name="t" type="pivot:Class Persons.ecore.oclas#pzC6s"/>
+ <variable xsi:type="qvtr:SharedVariable" isImplicit="true" name="trace" type="pivot:Class platform:/resource/org.eclipse.qvtd.runtime/model/QVTtrace.ecore.oclas#MdKgS"/>
+ <when>
+ <predicate>
+ <conditionExpression xsi:type="pivot:OperationCallExp" name="isFemale" referredOperation="#N,BoB" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#XEMMs">
+ <ownedArguments xsi:type="pivot:VariableExp" name="s" referredVariable="#8tM8f" type="pivot:Class Families.ecore.oclas#r2YVU"/>
+ <ownedSource xsi:type="pivot:VariableExp" name="this" referredVariable="#DqXtJ" type="#lSZ2I"/>
+ </conditionExpression>
+ </predicate>
+ </when>
+ </rule>
+ <rule xsi:type="qvtr:Relation" xmi:id="ifoLA" isTopLevel="true" name="Member2Male">
+ <domain xsi:type="qvtr:RelationDomain" isCheckable="true" isEnforceable="false" rootVariable="#50ALF" typedModel="#z2sgS">
+ <pattern>
+ <templateExpression xsi:type="qvtt:ObjectTemplateExp" bindsTo="#50ALF" referredClass="Families.ecore.oclas#r2YVU"
+ type="pivot:Class Families.ecore.oclas#r2YVU"/>
+ </pattern>
+ </domain>
+ <domain xsi:type="qvtr:RelationDomain" isCheckable="false" isEnforceable="true" rootVariable="#60ALF" typedModel="#v4ega">
+ <pattern>
+ <templateExpression xsi:type="qvtt:ObjectTemplateExp" bindsTo="#60ALF" referredClass="Persons.ecore.oclas#q+x1v"
+ type="pivot:Class Persons.ecore.oclas#q+x1v">
+ <part referredProperty="Persons.ecore.oclas#8tc+u">
+ <value xsi:type="pivot:OperationCallExp" name="+" referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#gJ7dJ"
+ type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#AlwVZ">
+ <ownedArguments xsi:type="pivot:OperationCallExp" name="familyName" referredOperation="#Gr4OV" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#AlwVZ">
+ <ownedArguments xsi:type="pivot:VariableExp" name="s" referredVariable="#50ALF" type="pivot:Class Families.ecore.oclas#r2YVU"/>
+ <ownedSource xsi:type="pivot:VariableExp" name="this" referredVariable="#DqXtJ" type="#lSZ2I"/>
+ </ownedArguments>
+ <ownedSource xsi:type="pivot:OperationCallExp" name="+" referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#gJ7dJ"
+ type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#AlwVZ">
+ <ownedArguments xsi:type="pivot:StringLiteralExp" stringSymbol=" " type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#AlwVZ"/>
+ <ownedSource xsi:type="pivot:PropertyCallExp" name="firstName" referredProperty="Families.ecore.oclas#yTUBO"
+ type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#AlwVZ">
+ <ownedSource xsi:type="pivot:VariableExp" name="s" referredVariable="#50ALF" type="pivot:Class Families.ecore.oclas#r2YVU"/>
+ </ownedSource>
+ </ownedSource>
+ </value>
+ </part>
+ </templateExpression>
+ </pattern>
+ </domain>
+ <variable xsi:type="qvtr:TemplateVariable" xmi:id="50ALF" name="s" type="pivot:Class Families.ecore.oclas#r2YVU"/>
+ <variable xsi:type="qvtr:TemplateVariable" xmi:id="60ALF" name="t" type="pivot:Class Persons.ecore.oclas#q+x1v"/>
+ <variable xsi:type="qvtr:SharedVariable" isImplicit="true" name="trace" type="pivot:Class platform:/resource/org.eclipse.qvtd.runtime/model/QVTtrace.ecore.oclas#MdKgS"/>
+ <when>
+ <predicate>
+ <conditionExpression xsi:type="pivot:OperationCallExp" name="not" referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#DH5kA"
+ type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#XEMMs">
+ <ownedSource xsi:type="pivot:OperationCallExp" name="isFemale" referredOperation="#N,BoB" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#XEMMs">
+ <ownedArguments xsi:type="pivot:VariableExp" name="s" referredVariable="#50ALF" type="pivot:Class Families.ecore.oclas#r2YVU"/>
+ <ownedSource xsi:type="pivot:VariableExp" name="this" referredVariable="#DqXtJ" type="#lSZ2I"/>
+ </ownedSource>
+ </conditionExpression>
+ </predicate>
+ </when>
+ </rule>
+ </ownedClasses>
+ </ownedPackages>
+</qvtr:RelationModel>
diff --git a/tests/org.eclipse.qvtd.all.tests/src/org/eclipse/qvtd/all/tests/XMLmodelTests.java b/tests/org.eclipse.qvtd.all.tests/src/org/eclipse/qvtd/all/tests/XMLmodelTests.java
index 92c507f95..72a727c79 100644
--- a/tests/org.eclipse.qvtd.all.tests/src/org/eclipse/qvtd/all/tests/XMLmodelTests.java
+++ b/tests/org.eclipse.qvtd.all.tests/src/org/eclipse/qvtd/all/tests/XMLmodelTests.java
@@ -11,13 +11,20 @@
package org.eclipse.qvtd.all.tests;
import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.URIConverter;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
import org.eclipse.emf.ecore.xmi.impl.XMLResourceFactoryImpl;
import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.m2m.atl.common.ATL.ATLPackage;
import org.eclipse.ocl.examples.xtext.tests.NoHttpURIHandlerImpl;
import org.eclipse.ocl.examples.xtext.tests.TestFile;
import org.eclipse.ocl.examples.xtext.tests.TestProject;
@@ -25,8 +32,11 @@ import org.eclipse.ocl.examples.xtext.tests.TestUtil;
import org.eclipse.ocl.pivot.internal.resource.StandaloneProjectMap.LoadFirstStrategy;
import org.eclipse.ocl.pivot.internal.resource.StandaloneProjectMap.MapToFirstConflictHandler;
import org.eclipse.ocl.pivot.resource.ProjectManager;
+import org.eclipse.ocl.pivot.utilities.OCL;
import org.eclipse.ocl.pivot.utilities.XMIUtil;
+import org.eclipse.qvtd.pivot.qvtrelation.QVTrelationPackage;
import org.eclipse.qvtd.xml.utilities.XMLmodelResourceFactoryImpl;
+import org.eclipse.qvtd.xml.utilities.XMLmodelResourceImpl;
import org.eclipse.qvtd.xtext.qvtbase.tests.XtextTestCase;
/**
@@ -34,7 +44,14 @@ import org.eclipse.qvtd.xtext.qvtbase.tests.XtextTestCase;
*/
public class XMLmodelTests extends XtextTestCase
{
- protected void doXMLtest(URI inURI, boolean doCompare) throws Exception {
+ public static @NonNull TestFile copyFile(@NonNull TestProject testProject, @NonNull URIConverter uriConverter, @NonNull URI sourceURI) throws IOException {
+ InputStream inputStream = uriConverter.createInputStream(sourceURI);
+ String lastSegment = sourceURI.lastSegment();
+ assert lastSegment != null;
+ return testProject.getOutputFile(lastSegment, inputStream);
+ }
+
+ protected @NonNull Resource doXMLtest(URI inURI, boolean doCompare, boolean ignoreEcore) throws Exception {
String testExtension = inURI.fileExtension();
String testFileName = inURI.trimFileExtension().lastSegment();
ProjectManager projectManager = getTestProjectManager();
@@ -45,7 +62,12 @@ public class XMLmodelTests extends XtextTestCase
TestFile xmlFile = testProject.getOutputFile(testFileName + ".xml");
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(testExtension, new XMLmodelResourceFactoryImpl());
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xml", new XMLResourceFactoryImpl());
- Resource xmlResource = resourceSet.getResource(inURI, true);
+ Resource xmlResource = resourceSet.createResource(inURI, "");
+ Map<String, Object> loadOptions = new HashMap<>();
+ if (ignoreEcore) {
+ loadOptions.put(XMLmodelResourceImpl.IGNORE_ECORE, Boolean.TRUE);
+ }
+ xmlResource.load(loadOptions);
xmlResource.toString();
URI xmlURI = xmlFile.getURI();
URI outURI = outFile.getURI();
@@ -61,12 +83,20 @@ public class XMLmodelTests extends XtextTestCase
projectManager.initializeResourceSet(resourceSet2);
projectManager.configure(resourceSet2, LoadFirstStrategy.INSTANCE, MapToFirstConflictHandler.INSTANCE);
resourceSet2.getResourceFactoryRegistry().getExtensionToFactoryMap().put("ecore", new EcoreResourceFactoryImpl());
+ resourceSet2.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xmi", new XMIResourceFactoryImpl());
resourceSet2.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", new XMLResourceFactoryImpl());
Resource resource1 = resourceSet2.getResource(inURI, true);
Resource resource2 = resourceSet2.getResource(outURI, true);
assert (resource1 != null) && (resource2 != null);
+ URI uri = URI.createURI("assertSameModel");
+ resource1.setURI(uri);
+ resource2.setURI(uri);
TestUtil.assertSameModel(resource1, resource2);
+ resource1.setURI(inURI);
+ resource2.setURI(outURI);
}
+ xmlResource.getContents().addAll(xmlResource2.getContents());
+ return xmlResource;
}
public static void assertSameModel(@NonNull Resource expectedResource, @NonNull Resource actualResource) throws IOException, InterruptedException {
@@ -76,12 +106,35 @@ public class XMLmodelTests extends XtextTestCase
public void testXML_junit_noframes_xsl() throws Exception {
String inPath = getTestBundleName() + "/models/junit-noframes.xsl";
URI inURI = URI.createPlatformResourceURI(inPath, true);
- doXMLtest(inURI, false); // FIXME whitepsace adrft, Transform package no loadable
+ doXMLtest(inURI, false, true); // FIXME whitepsace adrft, Transform package no loadable
}
public void testXML_Ecore_ecore() throws Exception {
String inPath ="org.eclipse.emf.ecore/model/Ecore.ecore";
URI inURI = URI.createPlatformResourceURI(inPath, true);
- doXMLtest(inURI, true);
+ XMLmodelResourceImpl resource = (XMLmodelResourceImpl) doXMLtest(inURI, true, false);
+ assertNoValidationErrors("Loading '" + resource.getURI().toString() + "'", resource);
+ }
+
+ public void testXML_Families2Persons_qvtras_xmi() throws Exception {
+ OCL ocl = OCL.newInstance(OCL.CLASS_PATH);
+ URIConverter uriConverter = ocl.getResourceSet().getURIConverter();
+ TestProject testProject = getTestProject();
+ TestFile inFile = copyFile(testProject, uriConverter, getModelsURI("Families2Persons.qvtras.xmi"));
+ QVTrelationPackage.eINSTANCE.getClass();
+ URI inURI = inFile.getURI(); //URI.createPlatformResourceURI(inPath, true);
+ @SuppressWarnings("unused")
+ XMLmodelResourceImpl resource = (XMLmodelResourceImpl) doXMLtest(inURI, true, false);
+ // There are unresolved proxies
+ // assertNoValidationErrors("Loading '" + resource.getURI().toString() + "'", resource);
+ ocl.dispose();
+ }
+
+ public void testXML_Families2Persons_atl_xmi() throws Exception {
+ ATLPackage.eINSTANCE.getClass();
+ String inPath = getTestBundleName() + "/models/Families2Persons.atl.xmi";
+ URI inURI = URI.createPlatformResourceURI(inPath, true);
+ XMLmodelResourceImpl resource = (XMLmodelResourceImpl) doXMLtest(inURI, true, false);
+ assertNoValidationErrors("Loading '" + resource.getURI().toString() + "'", resource);
}
}

Back to the top