diff options
9 files changed, 285 insertions, 33 deletions
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/Key.java b/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/Key.java index 19a015f54..15585a939 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/Key.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/Key.java @@ -114,6 +114,15 @@ public interface Key extends Element { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * @model annotation="http://www.eclipse.org/uml2/2.0.0/UML originalName='PartsIncludesContainer'" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='/**\n *\n * inv PartsIncludesContainer:\n * let severity : Integer[1] = \'Key::PartsIncludesContainer\'.getSeverity()\n * in\n * if severity <= 0\n * then true\n * else\n * let\n * result : Boolean[?] = part.opposite?->exists(isComposite) or\n * oppositePart->exists(isComposite)\n * in\n * \'Key::PartsIncludesContainer\'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0)\n * endif\n \052/\nfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.evaluation.@<%org.eclipse.jdt.annotation.NonNull%> Executor executor = <%org.eclipse.ocl.pivot.internal.utilities.PivotUtilInternal%>.getExecutor(this);\nfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.ids.@<%org.eclipse.jdt.annotation.NonNull%> IdResolver idResolver = executor.getIdResolver();\nfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.values.@<%org.eclipse.jdt.annotation.NonNull%> IntegerValue severity_0 = <%org.eclipse.ocl.pivot.library.string.CGStringGetSeverityOperation%>.INSTANCE.evaluate(executor, <%org.eclipse.qvtd.pivot.qvtrelation.QVTrelationTables%>.STR_Key_c_c_PartsIncludesContainer);\nfinal /*@NonInvalid\052/ boolean le = <%org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation%>.INSTANCE.evaluate(executor, severity_0, <%org.eclipse.qvtd.pivot.qvtrelation.QVTrelationTables%>.INT_0).booleanValue();\n/*@NonInvalid\052/ boolean symbol_0;\nif (le) {\n\tsymbol_0 = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE;\n}\nelse {\n\t/*@Caught\052/ @<%org.eclipse.jdt.annotation.Nullable%> <%java.lang.Object%> CAUGHT_result;\n\ttry {\n\t\t/*@Caught\052/ @<%org.eclipse.jdt.annotation.NonNull%> <%java.lang.Object%> CAUGHT_exists;\n\t\ttry {\n\t\t\t@SuppressWarnings(\"null\")\n\t\t\tfinal /*@NonInvalid\052/ java.util.@<%org.eclipse.jdt.annotation.NonNull%> List<<%org.eclipse.ocl.pivot.Property%>> part = this.getPart();\n\t\t\tfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.values.@<%org.eclipse.jdt.annotation.NonNull%> SetValue BOXED_part = idResolver.createSetOfAll(<%org.eclipse.qvtd.pivot.qvtrelation.QVTrelationTables%>.SET_CLSSid_Property, part);\n\t\t\t/*@Thrown\052/ <%org.eclipse.ocl.pivot.values.BagValue%>.@org.eclipse.jdt.annotation.NonNull Accumulator accumulator = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.createBagAccumulatorValue(<%org.eclipse.qvtd.pivot.qvtrelation.QVTrelationTables%>.BAG_CLSSid_Property);\n\t\t\t@<%org.eclipse.jdt.annotation.NonNull%> <%java.util.Iterator%><<%java.lang.Object%>> ITERATOR__1 = BOXED_part.iterator();\n\t\t\t/*@Thrown\052/ org.eclipse.ocl.pivot.values.@<%org.eclipse.jdt.annotation.NonNull%> BagValue collect;\n\t\t\twhile (true) {\n\t\t\t\tif (!ITERATOR__1.hasNext()) {\n\t\t\t\t\tcollect = accumulator;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t@SuppressWarnings(\"null\")\n\t\t\t\t/*@NonInvalid\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> Property _1 = (<%org.eclipse.ocl.pivot.Property%>)ITERATOR__1.next();\n\t\t\t\t/**\n\t\t\t\t * opposite\n\t\t\t\t \052/\n\t\t\t\tfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.Nullable%> Property opposite = _1.getOpposite();\n\t\t\t\t//\n\t\t\t\taccumulator.add(opposite);\n\t\t\t}\n\t\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.values.@<%org.eclipse.jdt.annotation.NonNull%> BagValue safe_null_sources = (<%org.eclipse.ocl.pivot.values.BagValue%>)<%org.eclipse.ocl.pivot.library.collection.CollectionExcludingOperation%>.INSTANCE.evaluate(collect, (Object)null);\n\t\t\t/*@Thrown\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> Object accumulator_0 = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.FALSE_VALUE;\n\t\t\t@<%org.eclipse.jdt.annotation.NonNull%> <%java.util.Iterator%><<%java.lang.Object%>> ITERATOR__1_0 = safe_null_sources.iterator();\n\t\t\t/*@Thrown\052/ boolean exists;\n\t\t\twhile (true) {\n\t\t\t\tif (!ITERATOR__1_0.hasNext()) {\n\t\t\t\t\tif (accumulator_0 == <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.FALSE_VALUE) {\n\t\t\t\t\t\texists = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.FALSE_VALUE;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthrow (<%org.eclipse.ocl.pivot.values.InvalidValueException%>)accumulator_0;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t@SuppressWarnings(\"null\")\n\t\t\t\t/*@NonInvalid\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> Property _1_0 = (<%org.eclipse.ocl.pivot.Property%>)ITERATOR__1_0.next();\n\t\t\t\t/**\n\t\t\t\t * isComposite\n\t\t\t\t \052/\n\t\t\t\tfinal /*@NonInvalid\052/ boolean isComposite = _1_0.isIsComposite();\n\t\t\t\t//\n\t\t\t\tif (isComposite == <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE) {\t\t\t\t\t// Normal successful body evaluation result\n\t\t\t\t\texists = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE;\n\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Stop immediately\n\t\t\t\t}\n\t\t\t\telse if (isComposite == <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.FALSE_VALUE) {\t\t\t\t// Normal unsuccessful body evaluation result\n\t\t\t\t\t;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Carry on\n\t\t\t\t}\n\t\t\t\telse {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Impossible badly typed result\n\t\t\t\t\taccumulator_0 = new <%org.eclipse.ocl.pivot.values.InvalidValueException%>(<%org.eclipse.ocl.pivot.messages.PivotMessages%>.NonBooleanBody, \"exists\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tCAUGHT_exists = exists;\n\t\t}\n\t\tcatch (<%java.lang.Exception%> e) {\n\t\t\tCAUGHT_exists = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.createInvalidValue(e);\n\t\t}\n\t\t/*@Caught\052/ @<%org.eclipse.jdt.annotation.NonNull%> <%java.lang.Object%> CAUGHT_exists_0;\n\t\ttry {\n\t\t\t@SuppressWarnings(\"null\")\n\t\t\tfinal /*@NonInvalid\052/ java.util.@<%org.eclipse.jdt.annotation.NonNull%> List<<%org.eclipse.ocl.pivot.Property%>> oppositePart = this.getOppositePart();\n\t\t\tfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.values.@<%org.eclipse.jdt.annotation.NonNull%> SetValue BOXED_oppositePart = idResolver.createSetOfAll(<%org.eclipse.qvtd.pivot.qvtrelation.QVTrelationTables%>.SET_CLSSid_Property, oppositePart);\n\t\t\t/*@Thrown\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> Object accumulator_1 = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.FALSE_VALUE;\n\t\t\t@<%org.eclipse.jdt.annotation.NonNull%> <%java.util.Iterator%><<%java.lang.Object%>> ITERATOR__1_1 = BOXED_oppositePart.iterator();\n\t\t\t/*@Thrown\052/ boolean exists_0;\n\t\t\twhile (true) {\n\t\t\t\tif (!ITERATOR__1_1.hasNext()) {\n\t\t\t\t\tif (accumulator_1 == <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.FALSE_VALUE) {\n\t\t\t\t\t\texists_0 = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.FALSE_VALUE;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthrow (<%org.eclipse.ocl.pivot.values.InvalidValueException%>)accumulator_1;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t@SuppressWarnings(\"null\")\n\t\t\t\t/*@NonInvalid\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> Property _1_1 = (<%org.eclipse.ocl.pivot.Property%>)ITERATOR__1_1.next();\n\t\t\t\t/**\n\t\t\t\t * isComposite\n\t\t\t\t \052/\n\t\t\t\tfinal /*@NonInvalid\052/ boolean isComposite_0 = _1_1.isIsComposite();\n\t\t\t\t//\n\t\t\t\tif (isComposite_0 == <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE) {\t\t\t\t\t// Normal successful body evaluation result\n\t\t\t\t\texists_0 = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE;\n\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Stop immediately\n\t\t\t\t}\n\t\t\t\telse if (isComposite_0 == <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.FALSE_VALUE) {\t\t\t\t// Normal unsuccessful body evaluation result\n\t\t\t\t\t;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Carry on\n\t\t\t\t}\n\t\t\t\telse {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Impossible badly typed result\n\t\t\t\t\taccumulator_1 = new <%org.eclipse.ocl.pivot.values.InvalidValueException%>(<%org.eclipse.ocl.pivot.messages.PivotMessages%>.NonBooleanBody, \"exists\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tCAUGHT_exists_0 = exists_0;\n\t\t}\n\t\tcatch (<%java.lang.Exception%> e) {\n\t\t\tCAUGHT_exists_0 = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.createInvalidValue(e);\n\t\t}\n\t\tfinal /*@Thrown\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> Boolean result = <%org.eclipse.ocl.pivot.library.logical.BooleanOrOperation%>.INSTANCE.evaluate(CAUGHT_exists, CAUGHT_exists_0);\n\t\tCAUGHT_result = result;\n\t}\n\tcatch (<%java.lang.Exception%> e) {\n\t\tCAUGHT_result = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.createInvalidValue(e);\n\t}\n\tfinal /*@NonInvalid\052/ boolean logDiagnostic = <%org.eclipse.ocl.pivot.library.string.CGStringLogDiagnosticOperation%>.INSTANCE.evaluate(executor, <%org.eclipse.ocl.pivot.ids.TypeId%>.BOOLEAN, <%org.eclipse.qvtd.pivot.qvtrelation.QVTrelationTables%>.STR_Key_c_c_PartsIncludesContainer, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_result, <%org.eclipse.qvtd.pivot.qvtrelation.QVTrelationTables%>.INT_0).booleanValue();\n\tsymbol_0 = logDiagnostic;\n}\nreturn Boolean.TRUE == symbol_0;'" + * @generated + */ + boolean validatePartsIncludesContainer(DiagnosticChain diagnostics, Map<Object, Object> context); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> * @model annotation="http://www.eclipse.org/uml2/2.0.0/UML originalName='IdentifiesIsNotAbstract'" * annotation="http://www.eclipse.org/emf/2002/GenModel body='/**\n *\n * inv IdentifiesIsNotAbstract:\n * let severity : Integer[1] = \'Key::IdentifiesIsNotAbstract\'.getSeverity()\n * in\n * if severity <= 0\n * then true\n * else\n * let result : Boolean[?] = not identifies.isAbstract\n * in\n * \'Key::IdentifiesIsNotAbstract\'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0)\n * endif\n \052/\nfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.evaluation.@<%org.eclipse.jdt.annotation.NonNull%> Executor executor = <%org.eclipse.ocl.pivot.internal.utilities.PivotUtilInternal%>.getExecutor(this);\nfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.values.@<%org.eclipse.jdt.annotation.NonNull%> IntegerValue severity_0 = <%org.eclipse.ocl.pivot.library.string.CGStringGetSeverityOperation%>.INSTANCE.evaluate(executor, <%org.eclipse.qvtd.pivot.qvtrelation.QVTrelationTables%>.STR_Key_c_c_IdentifiesIsNotAbstract);\nfinal /*@NonInvalid\052/ boolean le = <%org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation%>.INSTANCE.evaluate(executor, severity_0, <%org.eclipse.qvtd.pivot.qvtrelation.QVTrelationTables%>.INT_0).booleanValue();\n/*@NonInvalid\052/ boolean symbol_0;\nif (le) {\n\tsymbol_0 = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE;\n}\nelse {\n\t@SuppressWarnings(\"null\")\n\tfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> Class identifies = this.getIdentifies();\n\tfinal /*@NonInvalid\052/ boolean isAbstract = identifies.isIsAbstract();\n\tfinal /*@NonInvalid\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> Boolean result = <%org.eclipse.ocl.pivot.library.logical.BooleanNotOperation%>.INSTANCE.evaluate(isAbstract);\n\tfinal /*@NonInvalid\052/ boolean logDiagnostic = <%org.eclipse.ocl.pivot.library.string.CGStringLogDiagnosticOperation%>.INSTANCE.evaluate(executor, <%org.eclipse.ocl.pivot.ids.TypeId%>.BOOLEAN, <%org.eclipse.qvtd.pivot.qvtrelation.QVTrelationTables%>.STR_Key_c_c_IdentifiesIsNotAbstract, this, (Object)null, diagnostics, context, (Object)null, severity_0, result, <%org.eclipse.qvtd.pivot.qvtrelation.QVTrelationTables%>.INT_0).booleanValue();\n\tsymbol_0 = logDiagnostic;\n}\nreturn Boolean.TRUE == symbol_0;'" * @generated diff --git a/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/QVTrelationPackage.java b/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/QVTrelationPackage.java index d17744041..efb9e92ed 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/QVTrelationPackage.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/QVTrelationPackage.java @@ -294,13 +294,22 @@ public interface QVTrelationPackage extends EPackage { int KEY___GET_VALUE__TYPE_STRING = PivotPackage.ELEMENT___GET_VALUE__TYPE_STRING; /** + * The operation id for the '<em>Validate Parts Includes Container</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int KEY___VALIDATE_PARTS_INCLUDES_CONTAINER__DIAGNOSTICCHAIN_MAP = PivotPackage.ELEMENT_OPERATION_COUNT + 0; + + /** * The operation id for the '<em>Validate Identifies Is Not Abstract</em>' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - int KEY___VALIDATE_IDENTIFIES_IS_NOT_ABSTRACT__DIAGNOSTICCHAIN_MAP = PivotPackage.ELEMENT_OPERATION_COUNT + 0; + int KEY___VALIDATE_IDENTIFIES_IS_NOT_ABSTRACT__DIAGNOSTICCHAIN_MAP = PivotPackage.ELEMENT_OPERATION_COUNT + 1; /** * The operation id for the '<em>Validate Identifies Is AUsed Package Class</em>' operation. @@ -309,7 +318,7 @@ public interface QVTrelationPackage extends EPackage { * @generated * @ordered */ - int KEY___VALIDATE_IDENTIFIES_IS_AUSED_PACKAGE_CLASS__DIAGNOSTICCHAIN_MAP = PivotPackage.ELEMENT_OPERATION_COUNT + 1; + int KEY___VALIDATE_IDENTIFIES_IS_AUSED_PACKAGE_CLASS__DIAGNOSTICCHAIN_MAP = PivotPackage.ELEMENT_OPERATION_COUNT + 2; /** * The operation id for the '<em>Validate No Super Keys</em>' operation. @@ -318,7 +327,7 @@ public interface QVTrelationPackage extends EPackage { * @generated * @ordered */ - int KEY___VALIDATE_NO_SUPER_KEYS__DIAGNOSTICCHAIN_MAP = PivotPackage.ELEMENT_OPERATION_COUNT + 2; + int KEY___VALIDATE_NO_SUPER_KEYS__DIAGNOSTICCHAIN_MAP = PivotPackage.ELEMENT_OPERATION_COUNT + 3; /** * The operation id for the '<em>Validate Identifies Is Unique</em>' operation. @@ -327,7 +336,7 @@ public interface QVTrelationPackage extends EPackage { * @generated * @ordered */ - int KEY___VALIDATE_IDENTIFIES_IS_UNIQUE__DIAGNOSTICCHAIN_MAP = PivotPackage.ELEMENT_OPERATION_COUNT + 3; + int KEY___VALIDATE_IDENTIFIES_IS_UNIQUE__DIAGNOSTICCHAIN_MAP = PivotPackage.ELEMENT_OPERATION_COUNT + 4; /** * The operation id for the '<em>Validate Opposite Parts Have Opposites</em>' operation. @@ -336,7 +345,7 @@ public interface QVTrelationPackage extends EPackage { * @generated * @ordered */ - int KEY___VALIDATE_OPPOSITE_PARTS_HAVE_OPPOSITES__DIAGNOSTICCHAIN_MAP = PivotPackage.ELEMENT_OPERATION_COUNT + 4; + int KEY___VALIDATE_OPPOSITE_PARTS_HAVE_OPPOSITES__DIAGNOSTICCHAIN_MAP = PivotPackage.ELEMENT_OPERATION_COUNT + 5; /** * The operation id for the '<em>Validate Opposite Parts Are Opposite Parts</em>' operation. @@ -345,7 +354,7 @@ public interface QVTrelationPackage extends EPackage { * @generated * @ordered */ - int KEY___VALIDATE_OPPOSITE_PARTS_ARE_OPPOSITE_PARTS__DIAGNOSTICCHAIN_MAP = PivotPackage.ELEMENT_OPERATION_COUNT + 5; + int KEY___VALIDATE_OPPOSITE_PARTS_ARE_OPPOSITE_PARTS__DIAGNOSTICCHAIN_MAP = PivotPackage.ELEMENT_OPERATION_COUNT + 6; /** * The operation id for the '<em>Validate Parts Are Parts</em>' operation. @@ -354,7 +363,7 @@ public interface QVTrelationPackage extends EPackage { * @generated * @ordered */ - int KEY___VALIDATE_PARTS_ARE_PARTS__DIAGNOSTICCHAIN_MAP = PivotPackage.ELEMENT_OPERATION_COUNT + 6; + int KEY___VALIDATE_PARTS_ARE_PARTS__DIAGNOSTICCHAIN_MAP = PivotPackage.ELEMENT_OPERATION_COUNT + 7; /** * The operation id for the '<em>Validate Parts Are Unique</em>' operation. @@ -363,7 +372,7 @@ public interface QVTrelationPackage extends EPackage { * @generated * @ordered */ - int KEY___VALIDATE_PARTS_ARE_UNIQUE__DIAGNOSTICCHAIN_MAP = PivotPackage.ELEMENT_OPERATION_COUNT + 7; + int KEY___VALIDATE_PARTS_ARE_UNIQUE__DIAGNOSTICCHAIN_MAP = PivotPackage.ELEMENT_OPERATION_COUNT + 8; /** * The number of operations of the '<em>Key</em>' class. @@ -372,7 +381,7 @@ public interface QVTrelationPackage extends EPackage { * @generated * @ordered */ - int KEY_OPERATION_COUNT = PivotPackage.ELEMENT_OPERATION_COUNT + 8; + int KEY_OPERATION_COUNT = PivotPackage.ELEMENT_OPERATION_COUNT + 9; /** * The meta object id for the '{@link org.eclipse.qvtd.pivot.qvtrelation.impl.RelationImpl <em>Relation</em>}' class. @@ -2177,6 +2186,16 @@ public interface QVTrelationPackage extends EPackage { EReference getKey_Transformation(); /** + * Returns the meta object for the '{@link org.eclipse.qvtd.pivot.qvtrelation.Key#validatePartsIncludesContainer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Parts Includes Container</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Validate Parts Includes Container</em>' operation. + * @see org.eclipse.qvtd.pivot.qvtrelation.Key#validatePartsIncludesContainer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * @generated + */ + EOperation getKey__ValidatePartsIncludesContainer__DiagnosticChain_Map(); + + /** * Returns the meta object for the '{@link org.eclipse.qvtd.pivot.qvtrelation.Key#validateIdentifiesIsNotAbstract(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Identifies Is Not Abstract</em>}' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -2668,6 +2687,14 @@ public interface QVTrelationPackage extends EPackage { EReference KEY__TRANSFORMATION = eINSTANCE.getKey_Transformation(); /** + * The meta object literal for the '<em><b>Validate Parts Includes Container</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation KEY___VALIDATE_PARTS_INCLUDES_CONTAINER__DIAGNOSTICCHAIN_MAP = eINSTANCE.getKey__ValidatePartsIncludesContainer__DiagnosticChain_Map(); + + /** * The meta object literal for the '<em><b>Validate Identifies Is Not Abstract</b></em>' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/QVTrelationTables.java b/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/QVTrelationTables.java index a58157c0c..7e1423d5b 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/QVTrelationTables.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/QVTrelationTables.java @@ -98,6 +98,7 @@ public class QVTrelationTables public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_Key_c_c_OppositePartsHaveOpposites = "Key::OppositePartsHaveOpposites"; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_Key_c_c_PartsAreParts = "Key::PartsAreParts"; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_Key_c_c_PartsAreUnique = "Key::PartsAreUnique"; + public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_Key_c_c_PartsIncludesContainer = "Key::PartsIncludesContainer"; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_RelationCallExp_c_c_MatchingArgumentCount = "RelationCallExp::MatchingArgumentCount"; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_RelationDomainAssignment_c_c_CompatibleTypeForValue = "RelationDomainAssignment::CompatibleTypeForValue"; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_RelationDomain_c_c_RelationDomainAssignmentsAreUnique = "RelationDomain::RelationDomainAssignmentsAreUnique"; diff --git a/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/impl/KeyImpl.java b/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/impl/KeyImpl.java index c8ff8db38..584991e80 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/impl/KeyImpl.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/impl/KeyImpl.java @@ -40,6 +40,7 @@ import org.eclipse.ocl.pivot.library.collection.CollectionExcludesOperation; import org.eclipse.ocl.pivot.library.collection.CollectionExcludingOperation; import org.eclipse.ocl.pivot.library.collection.CollectionIncludesOperation; import org.eclipse.ocl.pivot.library.logical.BooleanNotOperation; +import org.eclipse.ocl.pivot.library.logical.BooleanOrOperation; import org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation; import org.eclipse.ocl.pivot.library.string.CGStringGetSeverityOperation; import org.eclipse.ocl.pivot.library.string.CGStringLogDiagnosticOperation; @@ -227,6 +228,151 @@ public class KeyImpl extends ElementImpl implements Key { * @generated */ @Override + public boolean validatePartsIncludesContainer(final DiagnosticChain diagnostics, final Map<Object, Object> context) { + /** + * + * inv PartsIncludesContainer: + * let severity : Integer[1] = 'Key::PartsIncludesContainer'.getSeverity() + * in + * if severity <= 0 + * then true + * else + * let + * result : Boolean[?] = part.opposite?->exists(isComposite) or + * oppositePart->exists(isComposite) + * in + * 'Key::PartsIncludesContainer'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0) + * endif + */ + final /*@NonInvalid*/ org.eclipse.ocl.pivot.evaluation.@NonNull Executor executor = PivotUtilInternal.getExecutor(this); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@NonNull IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.values.@NonNull IntegerValue severity_0 = CGStringGetSeverityOperation.INSTANCE.evaluate(executor, QVTrelationTables.STR_Key_c_c_PartsIncludesContainer); + final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, QVTrelationTables.INT_0).booleanValue(); + /*@NonInvalid*/ boolean symbol_0; + if (le) { + symbol_0 = ValueUtil.TRUE_VALUE; + } + else { + /*@Caught*/ @Nullable Object CAUGHT_result; + try { + /*@Caught*/ @NonNull Object CAUGHT_exists; + try { + @SuppressWarnings("null") + final /*@NonInvalid*/ java.util.@NonNull List<Property> part = this.getPart(); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.values.@NonNull SetValue BOXED_part = idResolver.createSetOfAll(QVTrelationTables.SET_CLSSid_Property, part); + /*@Thrown*/ BagValue.@org.eclipse.jdt.annotation.NonNull Accumulator accumulator = ValueUtil.createBagAccumulatorValue(QVTrelationTables.BAG_CLSSid_Property); + @NonNull Iterator<Object> ITERATOR__1 = BOXED_part.iterator(); + /*@Thrown*/ org.eclipse.ocl.pivot.values.@NonNull BagValue collect; + while (true) { + if (!ITERATOR__1.hasNext()) { + collect = accumulator; + break; + } + @SuppressWarnings("null") + /*@NonInvalid*/ org.eclipse.ocl.pivot.@NonNull Property _1 = (Property)ITERATOR__1.next(); + /** + * opposite + */ + final /*@NonInvalid*/ org.eclipse.ocl.pivot.@Nullable Property opposite = _1.getOpposite(); + // + accumulator.add(opposite); + } + final /*@Thrown*/ org.eclipse.ocl.pivot.values.@NonNull BagValue safe_null_sources = (BagValue)CollectionExcludingOperation.INSTANCE.evaluate(collect, (Object)null); + /*@Thrown*/ java.lang.@Nullable Object accumulator_0 = ValueUtil.FALSE_VALUE; + @NonNull Iterator<Object> ITERATOR__1_0 = safe_null_sources.iterator(); + /*@Thrown*/ boolean exists; + while (true) { + if (!ITERATOR__1_0.hasNext()) { + if (accumulator_0 == ValueUtil.FALSE_VALUE) { + exists = ValueUtil.FALSE_VALUE; + } + else { + throw (InvalidValueException)accumulator_0; + } + break; + } + @SuppressWarnings("null") + /*@NonInvalid*/ org.eclipse.ocl.pivot.@NonNull Property _1_0 = (Property)ITERATOR__1_0.next(); + /** + * isComposite + */ + final /*@NonInvalid*/ boolean isComposite = _1_0.isIsComposite(); + // + if (isComposite == ValueUtil.TRUE_VALUE) { // Normal successful body evaluation result + exists = ValueUtil.TRUE_VALUE; + break; // Stop immediately + } + else if (isComposite == ValueUtil.FALSE_VALUE) { // Normal unsuccessful body evaluation result + ; // Carry on + } + else { // Impossible badly typed result + accumulator_0 = new InvalidValueException(PivotMessages.NonBooleanBody, "exists"); + } + } + CAUGHT_exists = exists; + } + catch (Exception e) { + CAUGHT_exists = ValueUtil.createInvalidValue(e); + } + /*@Caught*/ @NonNull Object CAUGHT_exists_0; + try { + @SuppressWarnings("null") + final /*@NonInvalid*/ java.util.@NonNull List<Property> oppositePart = this.getOppositePart(); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.values.@NonNull SetValue BOXED_oppositePart = idResolver.createSetOfAll(QVTrelationTables.SET_CLSSid_Property, oppositePart); + /*@Thrown*/ java.lang.@Nullable Object accumulator_1 = ValueUtil.FALSE_VALUE; + @NonNull Iterator<Object> ITERATOR__1_1 = BOXED_oppositePart.iterator(); + /*@Thrown*/ boolean exists_0; + while (true) { + if (!ITERATOR__1_1.hasNext()) { + if (accumulator_1 == ValueUtil.FALSE_VALUE) { + exists_0 = ValueUtil.FALSE_VALUE; + } + else { + throw (InvalidValueException)accumulator_1; + } + break; + } + @SuppressWarnings("null") + /*@NonInvalid*/ org.eclipse.ocl.pivot.@NonNull Property _1_1 = (Property)ITERATOR__1_1.next(); + /** + * isComposite + */ + final /*@NonInvalid*/ boolean isComposite_0 = _1_1.isIsComposite(); + // + if (isComposite_0 == ValueUtil.TRUE_VALUE) { // Normal successful body evaluation result + exists_0 = ValueUtil.TRUE_VALUE; + break; // Stop immediately + } + else if (isComposite_0 == ValueUtil.FALSE_VALUE) { // Normal unsuccessful body evaluation result + ; // Carry on + } + else { // Impossible badly typed result + accumulator_1 = new InvalidValueException(PivotMessages.NonBooleanBody, "exists"); + } + } + CAUGHT_exists_0 = exists_0; + } + catch (Exception e) { + CAUGHT_exists_0 = ValueUtil.createInvalidValue(e); + } + final /*@Thrown*/ java.lang.@Nullable Boolean result = BooleanOrOperation.INSTANCE.evaluate(CAUGHT_exists, CAUGHT_exists_0); + CAUGHT_result = result; + } + catch (Exception e) { + CAUGHT_result = ValueUtil.createInvalidValue(e); + } + final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, QVTrelationTables.STR_Key_c_c_PartsIncludesContainer, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_result, QVTrelationTables.INT_0).booleanValue(); + symbol_0 = logDiagnostic; + } + return Boolean.TRUE == symbol_0; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override public boolean validateIdentifiesIsNotAbstract(final DiagnosticChain diagnostics, final Map<Object, Object> context) { /** * @@ -1020,6 +1166,8 @@ public class KeyImpl extends ElementImpl implements Key { @SuppressWarnings("unchecked") public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException { switch (operationID) { + case QVTrelationPackage.KEY___VALIDATE_PARTS_INCLUDES_CONTAINER__DIAGNOSTICCHAIN_MAP: + return validatePartsIncludesContainer((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); case QVTrelationPackage.KEY___VALIDATE_IDENTIFIES_IS_NOT_ABSTRACT__DIAGNOSTICCHAIN_MAP: return validateIdentifiesIsNotAbstract((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); case QVTrelationPackage.KEY___VALIDATE_IDENTIFIES_IS_AUSED_PACKAGE_CLASS__DIAGNOSTICCHAIN_MAP: diff --git a/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/impl/QVTrelationPackageImpl.java b/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/impl/QVTrelationPackageImpl.java index e5c147bd8..ef4446ff7 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/impl/QVTrelationPackageImpl.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/impl/QVTrelationPackageImpl.java @@ -263,7 +263,7 @@ public class QVTrelationPackageImpl extends EPackageImpl implements QVTrelationP * @generated */ @Override - public EOperation getKey__ValidateIdentifiesIsNotAbstract__DiagnosticChain_Map() { + public EOperation getKey__ValidatePartsIncludesContainer__DiagnosticChain_Map() { return keyEClass.getEOperations().get(0); } @@ -273,7 +273,7 @@ public class QVTrelationPackageImpl extends EPackageImpl implements QVTrelationP * @generated */ @Override - public EOperation getKey__ValidateIdentifiesIsAUsedPackageClass__DiagnosticChain_Map() { + public EOperation getKey__ValidateIdentifiesIsNotAbstract__DiagnosticChain_Map() { return keyEClass.getEOperations().get(1); } @@ -283,7 +283,7 @@ public class QVTrelationPackageImpl extends EPackageImpl implements QVTrelationP * @generated */ @Override - public EOperation getKey__ValidateNoSuperKeys__DiagnosticChain_Map() { + public EOperation getKey__ValidateIdentifiesIsAUsedPackageClass__DiagnosticChain_Map() { return keyEClass.getEOperations().get(2); } @@ -293,7 +293,7 @@ public class QVTrelationPackageImpl extends EPackageImpl implements QVTrelationP * @generated */ @Override - public EOperation getKey__ValidateIdentifiesIsUnique__DiagnosticChain_Map() { + public EOperation getKey__ValidateNoSuperKeys__DiagnosticChain_Map() { return keyEClass.getEOperations().get(3); } @@ -303,7 +303,7 @@ public class QVTrelationPackageImpl extends EPackageImpl implements QVTrelationP * @generated */ @Override - public EOperation getKey__ValidateOppositePartsHaveOpposites__DiagnosticChain_Map() { + public EOperation getKey__ValidateIdentifiesIsUnique__DiagnosticChain_Map() { return keyEClass.getEOperations().get(4); } @@ -313,7 +313,7 @@ public class QVTrelationPackageImpl extends EPackageImpl implements QVTrelationP * @generated */ @Override - public EOperation getKey__ValidateOppositePartsAreOppositeParts__DiagnosticChain_Map() { + public EOperation getKey__ValidateOppositePartsHaveOpposites__DiagnosticChain_Map() { return keyEClass.getEOperations().get(5); } @@ -323,7 +323,7 @@ public class QVTrelationPackageImpl extends EPackageImpl implements QVTrelationP * @generated */ @Override - public EOperation getKey__ValidatePartsAreParts__DiagnosticChain_Map() { + public EOperation getKey__ValidateOppositePartsAreOppositeParts__DiagnosticChain_Map() { return keyEClass.getEOperations().get(6); } @@ -333,7 +333,7 @@ public class QVTrelationPackageImpl extends EPackageImpl implements QVTrelationP * @generated */ @Override - public EOperation getKey__ValidatePartsAreUnique__DiagnosticChain_Map() { + public EOperation getKey__ValidatePartsAreParts__DiagnosticChain_Map() { return keyEClass.getEOperations().get(7); } @@ -343,6 +343,16 @@ public class QVTrelationPackageImpl extends EPackageImpl implements QVTrelationP * @generated */ @Override + public EOperation getKey__ValidatePartsAreUnique__DiagnosticChain_Map() { + return keyEClass.getEOperations().get(8); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override public EReference getKey_OppositePart() { return (EReference)keyEClass.getEStructuralFeatures().get(1); } @@ -694,6 +704,7 @@ public class QVTrelationPackageImpl extends EPackageImpl implements QVTrelationP createEReference(keyEClass, KEY__OPPOSITE_PART); createEReference(keyEClass, KEY__PART); createEReference(keyEClass, KEY__TRANSFORMATION); + createEOperation(keyEClass, KEY___VALIDATE_PARTS_INCLUDES_CONTAINER__DIAGNOSTICCHAIN_MAP); createEOperation(keyEClass, KEY___VALIDATE_IDENTIFIES_IS_NOT_ABSTRACT__DIAGNOSTICCHAIN_MAP); createEOperation(keyEClass, KEY___VALIDATE_IDENTIFIES_IS_AUSED_PACKAGE_CLASS__DIAGNOSTICCHAIN_MAP); createEOperation(keyEClass, KEY___VALIDATE_NO_SUPER_KEYS__DIAGNOSTICCHAIN_MAP); @@ -799,7 +810,7 @@ public class QVTrelationPackageImpl extends EPackageImpl implements QVTrelationP initEReference(getKey_Part(), thePivotPackage.getProperty(), null, "part", null, 0, -1, Key.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); initEReference(getKey_Transformation(), this.getRelationalTransformation(), this.getRelationalTransformation_OwnedKey(), "transformation", null, 0, 1, Key.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - EOperation op = initEOperation(getKey__ValidateIdentifiesIsNotAbstract__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "validateIdentifiesIsNotAbstract", 0, 1, IS_UNIQUE, IS_ORDERED); + EOperation op = initEOperation(getKey__ValidatePartsIncludesContainer__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "validatePartsIncludesContainer", 0, 1, IS_UNIQUE, IS_ORDERED); addEParameter(op, ecorePackage.getEDiagnosticChain(), "diagnostics", 0, 1, IS_UNIQUE, IS_ORDERED); EGenericType g1 = createEGenericType(ecorePackage.getEMap()); EGenericType g2 = createEGenericType(ecorePackage.getEJavaObject()); @@ -808,6 +819,15 @@ public class QVTrelationPackageImpl extends EPackageImpl implements QVTrelationP g1.getETypeArguments().add(g2); addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED); + op = initEOperation(getKey__ValidateIdentifiesIsNotAbstract__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "validateIdentifiesIsNotAbstract", 0, 1, IS_UNIQUE, IS_ORDERED); + addEParameter(op, ecorePackage.getEDiagnosticChain(), "diagnostics", 0, 1, IS_UNIQUE, IS_ORDERED); + g1 = createEGenericType(ecorePackage.getEMap()); + g2 = createEGenericType(ecorePackage.getEJavaObject()); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(ecorePackage.getEJavaObject()); + g1.getETypeArguments().add(g2); + addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED); + op = initEOperation(getKey__ValidateIdentifiesIsAUsedPackageClass__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "validateIdentifiesIsAUsedPackageClass", 0, 1, IS_UNIQUE, IS_ORDERED); addEParameter(op, ecorePackage.getEDiagnosticChain(), "diagnostics", 0, 1, IS_UNIQUE, IS_ORDERED); g1 = createEGenericType(ecorePackage.getEMap()); @@ -1065,6 +1085,12 @@ public class QVTrelationPackageImpl extends EPackageImpl implements QVTrelationP protected void createUMLAnnotations() { String source = "http://www.eclipse.org/uml2/2.0.0/UML"; addAnnotation + (getKey__ValidatePartsIncludesContainer__DiagnosticChain_Map(), + source, + new String[] { + "originalName", "PartsIncludesContainer" + }); + addAnnotation (getKey__ValidateIdentifiesIsNotAbstract__DiagnosticChain_Map(), source, new String[] { diff --git a/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/util/QVTrelationValidator.java b/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/util/QVTrelationValidator.java index 1b19e79fd..8bfb6c331 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/util/QVTrelationValidator.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/util/QVTrelationValidator.java @@ -55,12 +55,20 @@ public class QVTrelationValidator extends EObjectValidator { public static final String DIAGNOSTIC_SOURCE = "org.eclipse.qvtd.pivot.qvtrelation"; /** + * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Parts Includes Container' of 'Key'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final int KEY__VALIDATE_PARTS_INCLUDES_CONTAINER = 1; + + /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Identifies Is Not Abstract' of 'Key'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ - public static final int KEY__VALIDATE_IDENTIFIES_IS_NOT_ABSTRACT = 1; + public static final int KEY__VALIDATE_IDENTIFIES_IS_NOT_ABSTRACT = 2; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Identifies Is AUsed Package Class' of 'Key'. @@ -68,7 +76,7 @@ public class QVTrelationValidator extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int KEY__VALIDATE_IDENTIFIES_IS_AUSED_PACKAGE_CLASS = 2; + public static final int KEY__VALIDATE_IDENTIFIES_IS_AUSED_PACKAGE_CLASS = 3; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate No Super Keys' of 'Key'. @@ -76,7 +84,7 @@ public class QVTrelationValidator extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int KEY__VALIDATE_NO_SUPER_KEYS = 3; + public static final int KEY__VALIDATE_NO_SUPER_KEYS = 4; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Identifies Is Unique' of 'Key'. @@ -84,7 +92,7 @@ public class QVTrelationValidator extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int KEY__VALIDATE_IDENTIFIES_IS_UNIQUE = 4; + public static final int KEY__VALIDATE_IDENTIFIES_IS_UNIQUE = 5; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Opposite Parts Have Opposites' of 'Key'. @@ -92,7 +100,7 @@ public class QVTrelationValidator extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int KEY__VALIDATE_OPPOSITE_PARTS_HAVE_OPPOSITES = 5; + public static final int KEY__VALIDATE_OPPOSITE_PARTS_HAVE_OPPOSITES = 6; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Opposite Parts Are Opposite Parts' of 'Key'. @@ -100,7 +108,7 @@ public class QVTrelationValidator extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int KEY__VALIDATE_OPPOSITE_PARTS_ARE_OPPOSITE_PARTS = 6; + public static final int KEY__VALIDATE_OPPOSITE_PARTS_ARE_OPPOSITE_PARTS = 7; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Parts Are Parts' of 'Key'. @@ -108,7 +116,7 @@ public class QVTrelationValidator extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int KEY__VALIDATE_PARTS_ARE_PARTS = 7; + public static final int KEY__VALIDATE_PARTS_ARE_PARTS = 8; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Parts Are Unique' of 'Key'. @@ -116,7 +124,7 @@ public class QVTrelationValidator extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int KEY__VALIDATE_PARTS_ARE_UNIQUE = 8; + public static final int KEY__VALIDATE_PARTS_ARE_UNIQUE = 9; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Domains Are Relation Domains' of 'Relation'. @@ -124,7 +132,7 @@ public class QVTrelationValidator extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int RELATION__VALIDATE_DOMAINS_ARE_RELATION_DOMAINS = 9; + public static final int RELATION__VALIDATE_DOMAINS_ARE_RELATION_DOMAINS = 10; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Transformation Is Relational Transformation' of 'Relation'. @@ -132,7 +140,7 @@ public class QVTrelationValidator extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int RELATION__VALIDATE_TRANSFORMATION_IS_RELATIONAL_TRANSFORMATION = 10; + public static final int RELATION__VALIDATE_TRANSFORMATION_IS_RELATIONAL_TRANSFORMATION = 11; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Matching Argument Count' of 'Relation Call Exp'. @@ -140,7 +148,7 @@ public class QVTrelationValidator extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int RELATION_CALL_EXP__VALIDATE_MATCHING_ARGUMENT_COUNT = 11; + public static final int RELATION_CALL_EXP__VALIDATE_MATCHING_ARGUMENT_COUNT = 12; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Relation Domain Assignments Are Unique' of 'Relation Domain'. @@ -148,7 +156,7 @@ public class QVTrelationValidator extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int RELATION_DOMAIN__VALIDATE_RELATION_DOMAIN_ASSIGNMENTS_ARE_UNIQUE = 12; + public static final int RELATION_DOMAIN__VALIDATE_RELATION_DOMAIN_ASSIGNMENTS_ARE_UNIQUE = 13; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Compatible Type For Value' of 'Relation Domain Assignment'. @@ -156,7 +164,7 @@ public class QVTrelationValidator extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int RELATION_DOMAIN_ASSIGNMENT__VALIDATE_COMPATIBLE_TYPE_FOR_VALUE = 13; + public static final int RELATION_DOMAIN_ASSIGNMENT__VALIDATE_COMPATIBLE_TYPE_FOR_VALUE = 14; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Rules Are Relations' of 'Relational Transformation'. @@ -164,7 +172,7 @@ public class QVTrelationValidator extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int RELATIONAL_TRANSFORMATION__VALIDATE_RULES_ARE_RELATIONS = 14; + public static final int RELATIONAL_TRANSFORMATION__VALIDATE_RULES_ARE_RELATIONS = 15; /** * A constant with a fixed name that can be used as the base value for additional hand written constants. @@ -172,7 +180,7 @@ public class QVTrelationValidator extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 14; + private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 15; /** * A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class. @@ -281,6 +289,7 @@ public class QVTrelationValidator extends EObjectValidator { if (result || diagnostics != null) result &= validate_UniqueID(key, diagnostics, context); if (result || diagnostics != null) result &= validate_EveryKeyUnique(key, diagnostics, context); if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(key, diagnostics, context); + if (result || diagnostics != null) result &= validateKey_validatePartsIncludesContainer(key, diagnostics, context); if (result || diagnostics != null) result &= validateKey_validateIdentifiesIsNotAbstract(key, diagnostics, context); if (result || diagnostics != null) result &= validateKey_validateIdentifiesIsAUsedPackageClass(key, diagnostics, context); if (result || diagnostics != null) result &= validateKey_validateNoSuperKeys(key, diagnostics, context); @@ -293,6 +302,16 @@ public class QVTrelationValidator extends EObjectValidator { } /** + * Validates the validatePartsIncludesContainer constraint of '<em>Key</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateKey_validatePartsIncludesContainer(Key key, DiagnosticChain diagnostics, Map<Object, Object> context) { + return key.validatePartsIncludesContainer(diagnostics, context); + } + + /** * Validates the validateIdentifiesIsNotAbstract constraint of '<em>Key</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/plugins/org.eclipse.qvtd.pivot.qvtrelation/model/QVTrelation.ecore b/plugins/org.eclipse.qvtd.pivot.qvtrelation/model/QVTrelation.ecore index 40512a412..669eec259 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtrelation/model/QVTrelation.ecore +++ b/plugins/org.eclipse.qvtd.pivot.qvtrelation/model/QVTrelation.ecore @@ -14,6 +14,21 @@ containment="true"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" xmi:id="T-qvtrelation-Key" name="Key" eSuperTypes="../../org.eclipse.ocl.pivot/model/Pivot.ecore#T-pivot-Element"> + <eOperations name="validatePartsIncludesContainer" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"> + <eAnnotations source="http://www.eclipse.org/uml2/2.0.0/UML"> + <details key="originalName" value="PartsIncludesContainer"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> + <details key="body" value="			-- see Bugzilla 512532 discussion
	part.opposite?->exists(isComposite) or oppositePart->exists(isComposite)

"/> + </eAnnotations> + <eParameters name="diagnostics" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDiagnosticChain"/> + <eParameters name="context"> + <eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EMap"> + <eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"/> + <eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"/> + </eGenericType> + </eParameters> + </eOperations> <eOperations name="validateIdentifiesIsNotAbstract" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"> <eAnnotations source="http://www.eclipse.org/uml2/2.0.0/UML"> <details key="originalName" value="IdentifiesIsNotAbstract"/> diff --git a/plugins/org.eclipse.qvtd.pivot.qvtrelation/model/QVTrelation.genmodel b/plugins/org.eclipse.qvtd.pivot.qvtrelation/model/QVTrelation.genmodel index 62dcd5e46..ef2bb003e 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtrelation/model/QVTrelation.genmodel +++ b/plugins/org.eclipse.qvtd.pivot.qvtrelation/model/QVTrelation.genmodel @@ -25,6 +25,10 @@ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTrelation.ecore#F-qvtrelation-Key-oppositePart"/> <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTrelation.ecore#F-qvtrelation-Key-part"/> <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference QVTrelation.ecore#F-qvtrelation-Key-transformation"/> + <genOperations ecoreOperation="QVTrelation.ecore#//Key/validatePartsIncludesContainer"> + <genParameters ecoreParameter="QVTrelation.ecore#//Key/validatePartsIncludesContainer/diagnostics"/> + <genParameters ecoreParameter="QVTrelation.ecore#//Key/validatePartsIncludesContainer/context"/> + </genOperations> <genOperations ecoreOperation="QVTrelation.ecore#//Key/validateIdentifiesIsNotAbstract"> <genParameters ecoreParameter="QVTrelation.ecore#//Key/validateIdentifiesIsNotAbstract/diagnostics"/> <genParameters ecoreParameter="QVTrelation.ecore#//Key/validateIdentifiesIsNotAbstract/context"/> diff --git a/plugins/org.eclipse.qvtd.pivot.qvtrelation/model/QVTrelation.ocl b/plugins/org.eclipse.qvtd.pivot.qvtrelation/model/QVTrelation.ocl index a1978b82e..d25fa0c3e 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtrelation/model/QVTrelation.ocl +++ b/plugins/org.eclipse.qvtd.pivot.qvtrelation/model/QVTrelation.ocl @@ -5,6 +5,9 @@ package qvtrelation context Key --def: resolvedParts : Set(ocl::Property) = part->union(oppositePart.opposite) +inv PartsIncludesContainer: -- see Bugzilla 512532 discussion + part.opposite?->exists(isComposite) or oppositePart->exists(isComposite) + inv IdentifiesIsNotAbstract: -- see Bugzilla 512532 discussion not identifies.isAbstract |