diff options
author | Ed Willink | 2016-12-14 16:57:40 +0000 |
---|---|---|
committer | Ed Willink | 2016-12-14 17:18:30 +0000 |
commit | 994ec97159a74b56b38d8dd1f89af218d1a48296 (patch) | |
tree | 807c32354fbb3e53ea69774824a4b3aa2912591e | |
parent | 0733d92f89163d75524eeec9d1678bb0ce149b30 (diff) | |
download | org.eclipse.qvtd-994ec97159a74b56b38d8dd1f89af218d1a48296.tar.gz org.eclipse.qvtd-994ec97159a74b56b38d8dd1f89af218d1a48296.tar.xz org.eclipse.qvtd-994ec97159a74b56b38d8dd1f89af218d1a48296.zip |
24 files changed, 1923 insertions, 141 deletions
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/CoreVariableAnalysis.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/CoreVariableAnalysis.java index 7bc560717..edac3682e 100644 --- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/CoreVariableAnalysis.java +++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/CoreVariableAnalysis.java @@ -27,7 +27,7 @@ public class CoreVariableAnalysis extends AbstractVariableAnalysis public CoreVariableAnalysis(@NonNull VariablesAnalysis variablesAnalysis, @NonNull String name, @NonNull Type type, @Nullable OCLExpression initValue) { super(variablesAnalysis, name); - this.cVariable = variablesAnalysis.createBottomVariable(this.name, type, true, initValue); + this.cVariable = variablesAnalysis.createGuardVariable(this.name, type, true, initValue); } public CoreVariableAnalysis(@NonNull VariablesAnalysis variablesAnalysis, @NonNull String name, @NonNull Type type) { diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/RelationVariableAnalysis.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/RelationVariableAnalysis.java index 3aa562557..e532c392b 100644 --- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/RelationVariableAnalysis.java +++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/RelationVariableAnalysis.java @@ -29,6 +29,7 @@ import org.eclipse.qvtd.pivot.qvtcore.Assignment; import org.eclipse.qvtd.pivot.qvtcore.BottomPattern; import org.eclipse.qvtd.pivot.qvtcore.CoreDomain; import org.eclipse.qvtd.pivot.qvtcore.CorePattern; +import org.eclipse.qvtd.pivot.qvtcore.GuardPattern; import org.eclipse.qvtd.pivot.qvtcore.NavigationAssignment; import org.eclipse.qvtd.pivot.qvtcore.RealizedVariable; import org.eclipse.qvtd.pivot.qvtcore.VariableAssignment; @@ -299,7 +300,12 @@ public class RelationVariableAnalysis extends AbstractVariableAnalysis cPattern.getVariable().add(cVariable2); } else if (!isRealized) { - cVariable2 = variablesAnalysis.createBottomVariable(name, type, rVariable.isIsRequired(), null); + if (cPattern instanceof GuardPattern) { + cVariable2 = variablesAnalysis.createGuardVariable(name, type, rVariable.isIsRequired(), null); + } + else { + cVariable2 = variablesAnalysis.createBottomVariable(name, type, rVariable.isIsRequired(), null); + } cPattern.getVariable().add(cVariable2); } else { diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/BottomPattern.java b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/BottomPattern.java index 39935c757..3537cb7b7 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/BottomPattern.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/BottomPattern.java @@ -14,6 +14,8 @@ */ package org.eclipse.qvtd.pivot.qvtcore; +import java.util.Map; +import org.eclipse.emf.common.util.DiagnosticChain; import org.eclipse.emf.common.util.EList; /** @@ -121,4 +123,13 @@ public interface BottomPattern extends CorePattern { */ EList<RealizedVariable> getRealizedVariable(); + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model annotation="http://www.eclipse.org/uml2/2.0.0/UML originalName='VariablesAreBottomVariables'" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='/**\n *\n * inv VariablesAreBottomVariables:\n * let\n * severity : Integer[1] = \'BottomPattern::VariablesAreBottomVariables\'.getSeverity()\n * in\n * if severity <= 0\n * then true\n * else\n * let\n * status : OclAny[?] = variable->forAll(\n * oclIsKindOf(BottomVariable))\n * in\n * \'BottomPattern::VariablesAreBottomVariables\'.logDiagnostic(self, null, diagnostics, context, null, severity, status, 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.qvtcore.QVTcoreTables%>.STR_BottomPattern_c_c_VariablesAreBottomVariables);\nfinal /*@NonInvalid\052/ boolean le = <%org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation%>.INSTANCE.evaluate(executor, severity_0, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.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.NonNull%> <%java.lang.Object%> CAUGHT_status;\n\ttry {\n\t\t@SuppressWarnings(\"null\")\n\t\tfinal /*@Thrown\052/ java.util.@<%org.eclipse.jdt.annotation.NonNull%> List<<%org.eclipse.ocl.pivot.Variable%>> variable = this.getVariable();\n\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.values.@<%org.eclipse.jdt.annotation.NonNull%> SetValue BOXED_variable = idResolver.createSetOfAll(<%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.SET_CLSSid_Variable, variable);\n\t\t/*@Thrown\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> Object accumulator = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE;\n\t\t@<%org.eclipse.jdt.annotation.NonNull%> <%java.util.Iterator%><<%java.lang.Object%>> ITERATOR__1 = BOXED_variable.iterator();\n\t\t/*@Thrown\052/ boolean status;\n\t\twhile (true) {\n\t\t\tif (!ITERATOR__1.hasNext()) {\n\t\t\t\tif (accumulator == <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE) {\n\t\t\t\t\tstatus = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthrow (<%org.eclipse.ocl.pivot.values.InvalidValueException%>)accumulator;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t@SuppressWarnings(\"null\")\n\t\t\t/*@NonInvalid\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> Variable _1 = (<%org.eclipse.ocl.pivot.Variable%>)ITERATOR__1.next();\n\t\t\t/**\n\t\t\t * oclIsKindOf(BottomVariable)\n\t\t\t \052/\n\t\t\tfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> Class TYP_qvtcore_c_c_BottomVariable = idResolver.getClass(<%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.CLSSid_BottomVariable, null);\n\t\t\tfinal /*@NonInvalid\052/ boolean oclIsKindOf = <%org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsKindOfOperation%>.INSTANCE.evaluate(executor, _1, TYP_qvtcore_c_c_BottomVariable).booleanValue();\n\t\t\t//\n\t\t\tif (oclIsKindOf == <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.FALSE_VALUE) {\t\t\t\t\t// Normal unsuccessful body evaluation result\n\t\t\t\tstatus = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.FALSE_VALUE;\n\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Stop immediately\n\t\t\t}\n\t\t\telse if (oclIsKindOf == <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE) {\t\t\t\t// Normal successful body evaluation result\n\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}\n\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\taccumulator = new <%org.eclipse.ocl.pivot.values.InvalidValueException%>(<%org.eclipse.ocl.pivot.messages.PivotMessages%>.NonBooleanBody, \"forAll\");\n\t\t\t}\n\t\t}\n\t\tCAUGHT_status = status;\n\t}\n\tcatch (<%java.lang.Exception%> e) {\n\t\tCAUGHT_status = <%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.qvtcore.QVTcoreTables%>.STR_BottomPattern_c_c_VariablesAreBottomVariables, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_status, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.INT_0).booleanValue();\n\tsymbol_0 = logDiagnostic;\n}\nreturn Boolean.TRUE == symbol_0;'" + * @generated + */ + boolean validateVariablesAreBottomVariables(DiagnosticChain diagnostics, Map<Object, Object> context); + } // BottomPattern diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/GuardPattern.java b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/GuardPattern.java index a3ba95881..28c62c542 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/GuardPattern.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/GuardPattern.java @@ -14,6 +14,9 @@ */ package org.eclipse.qvtd.pivot.qvtcore; +import java.util.Map; +import org.eclipse.emf.common.util.DiagnosticChain; + /** * <!-- begin-user-doc --> @@ -62,4 +65,13 @@ public interface GuardPattern extends CorePattern { */ void setArea(Area value); + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model annotation="http://www.eclipse.org/uml2/2.0.0/UML originalName='VariablesAreGuardVariables'" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='/**\n *\n * inv VariablesAreGuardVariables:\n * let\n * severity : Integer[1] = \'GuardPattern::VariablesAreGuardVariables\'.getSeverity()\n * in\n * if severity <= 0\n * then true\n * else\n * let\n * status : OclAny[?] = variable->forAll(\n * oclIsKindOf(GuardVariable))\n * in\n * \'GuardPattern::VariablesAreGuardVariables\'.logDiagnostic(self, null, diagnostics, context, null, severity, status, 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.qvtcore.QVTcoreTables%>.STR_GuardPattern_c_c_VariablesAreGuardVariables);\nfinal /*@NonInvalid\052/ boolean le = <%org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation%>.INSTANCE.evaluate(executor, severity_0, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.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.NonNull%> <%java.lang.Object%> CAUGHT_status;\n\ttry {\n\t\t@SuppressWarnings(\"null\")\n\t\tfinal /*@Thrown\052/ java.util.@<%org.eclipse.jdt.annotation.NonNull%> List<<%org.eclipse.ocl.pivot.Variable%>> variable = this.getVariable();\n\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.values.@<%org.eclipse.jdt.annotation.NonNull%> SetValue BOXED_variable = idResolver.createSetOfAll(<%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.SET_CLSSid_Variable, variable);\n\t\t/*@Thrown\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> Object accumulator = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE;\n\t\t@<%org.eclipse.jdt.annotation.NonNull%> <%java.util.Iterator%><<%java.lang.Object%>> ITERATOR__1 = BOXED_variable.iterator();\n\t\t/*@Thrown\052/ boolean status;\n\t\twhile (true) {\n\t\t\tif (!ITERATOR__1.hasNext()) {\n\t\t\t\tif (accumulator == <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE) {\n\t\t\t\t\tstatus = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthrow (<%org.eclipse.ocl.pivot.values.InvalidValueException%>)accumulator;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t@SuppressWarnings(\"null\")\n\t\t\t/*@NonInvalid\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> Variable _1 = (<%org.eclipse.ocl.pivot.Variable%>)ITERATOR__1.next();\n\t\t\t/**\n\t\t\t * oclIsKindOf(GuardVariable)\n\t\t\t \052/\n\t\t\tfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> Class TYP_qvtcore_c_c_GuardVariable = idResolver.getClass(<%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.CLSSid_GuardVariable, null);\n\t\t\tfinal /*@NonInvalid\052/ boolean oclIsKindOf = <%org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsKindOfOperation%>.INSTANCE.evaluate(executor, _1, TYP_qvtcore_c_c_GuardVariable).booleanValue();\n\t\t\t//\n\t\t\tif (oclIsKindOf == <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.FALSE_VALUE) {\t\t\t\t\t// Normal unsuccessful body evaluation result\n\t\t\t\tstatus = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.FALSE_VALUE;\n\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Stop immediately\n\t\t\t}\n\t\t\telse if (oclIsKindOf == <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE) {\t\t\t\t// Normal successful body evaluation result\n\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}\n\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\taccumulator = new <%org.eclipse.ocl.pivot.values.InvalidValueException%>(<%org.eclipse.ocl.pivot.messages.PivotMessages%>.NonBooleanBody, \"forAll\");\n\t\t\t}\n\t\t}\n\t\tCAUGHT_status = status;\n\t}\n\tcatch (<%java.lang.Exception%> e) {\n\t\tCAUGHT_status = <%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.qvtcore.QVTcoreTables%>.STR_GuardPattern_c_c_VariablesAreGuardVariables, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_status, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.INT_0).booleanValue();\n\tsymbol_0 = logDiagnostic;\n}\nreturn Boolean.TRUE == symbol_0;'" + * @generated + */ + boolean validateVariablesAreGuardVariables(DiagnosticChain diagnostics, Map<Object, Object> context); + } // GuardPattern diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/Mapping.java b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/Mapping.java index 8981b5323..84d4eb8a8 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/Mapping.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/Mapping.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.qvtd.pivot.qvtcore; +import java.util.Map; +import org.eclipse.emf.common.util.DiagnosticChain; import org.eclipse.emf.common.util.EList; import org.eclipse.qvtd.pivot.qvtbase.Rule; @@ -82,6 +84,33 @@ public interface Mapping extends Rule, Area { EList<Mapping> getSpecification(); /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model annotation="http://www.eclipse.org/uml2/2.0.0/UML originalName='DomainsAreCoreDomains'" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='/**\n *\n * inv DomainsAreCoreDomains:\n * let severity : Integer[1] = \'Mapping::DomainsAreCoreDomains\'.getSeverity()\n * in\n * if severity <= 0\n * then true\n * else\n * let\n * status : OclAny[?] = domain->forAll(oclIsKindOf(CoreDomain))\n * in\n * \'Mapping::DomainsAreCoreDomains\'.logDiagnostic(self, null, diagnostics, context, null, severity, status, 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.qvtcore.QVTcoreTables%>.STR_Mapping_c_c_DomainsAreCoreDomains);\nfinal /*@NonInvalid\052/ boolean le = <%org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation%>.INSTANCE.evaluate(executor, severity_0, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.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.NonNull%> <%java.lang.Object%> CAUGHT_status;\n\ttry {\n\t\t@SuppressWarnings(\"null\")\n\t\tfinal /*@Thrown\052/ java.util.@<%org.eclipse.jdt.annotation.NonNull%> List<<%org.eclipse.qvtd.pivot.qvtbase.Domain%>> domain = this.getDomain();\n\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.values.@<%org.eclipse.jdt.annotation.NonNull%> OrderedSetValue BOXED_domain = idResolver.createOrderedSetOfAll(<%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.ORD_CLSSid_Domain, domain);\n\t\t/*@Thrown\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> Object accumulator = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE;\n\t\t@<%org.eclipse.jdt.annotation.NonNull%> <%java.util.Iterator%><<%java.lang.Object%>> ITERATOR__1 = BOXED_domain.iterator();\n\t\t/*@Thrown\052/ boolean status;\n\t\twhile (true) {\n\t\t\tif (!ITERATOR__1.hasNext()) {\n\t\t\t\tif (accumulator == <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE) {\n\t\t\t\t\tstatus = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthrow (<%org.eclipse.ocl.pivot.values.InvalidValueException%>)accumulator;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t@SuppressWarnings(\"null\")\n\t\t\t/*@NonInvalid\052/ org.eclipse.qvtd.pivot.qvtbase.@<%org.eclipse.jdt.annotation.NonNull%> Domain _1 = (<%org.eclipse.qvtd.pivot.qvtbase.Domain%>)ITERATOR__1.next();\n\t\t\t/**\n\t\t\t * oclIsKindOf(CoreDomain)\n\t\t\t \052/\n\t\t\tfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> Class TYP_qvtcore_c_c_CoreDomain = idResolver.getClass(<%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.CLSSid_CoreDomain, null);\n\t\t\tfinal /*@NonInvalid\052/ boolean oclIsKindOf = <%org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsKindOfOperation%>.INSTANCE.evaluate(executor, _1, TYP_qvtcore_c_c_CoreDomain).booleanValue();\n\t\t\t//\n\t\t\tif (oclIsKindOf == <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.FALSE_VALUE) {\t\t\t\t\t// Normal unsuccessful body evaluation result\n\t\t\t\tstatus = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.FALSE_VALUE;\n\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Stop immediately\n\t\t\t}\n\t\t\telse if (oclIsKindOf == <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE) {\t\t\t\t// Normal successful body evaluation result\n\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}\n\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\taccumulator = new <%org.eclipse.ocl.pivot.values.InvalidValueException%>(<%org.eclipse.ocl.pivot.messages.PivotMessages%>.NonBooleanBody, \"forAll\");\n\t\t\t}\n\t\t}\n\t\tCAUGHT_status = status;\n\t}\n\tcatch (<%java.lang.Exception%> e) {\n\t\tCAUGHT_status = <%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.qvtcore.QVTcoreTables%>.STR_Mapping_c_c_DomainsAreCoreDomains, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_status, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.INT_0).booleanValue();\n\tsymbol_0 = logDiagnostic;\n}\nreturn Boolean.TRUE == symbol_0;'" + * @generated + */ + boolean validateDomainsAreCoreDomains(DiagnosticChain diagnostics, Map<Object, Object> context); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model annotation="http://www.eclipse.org/uml2/2.0.0/UML originalName='NestedNameIsNull'" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='/**\n *\n * inv NestedNameIsNull:\n * let severity : Integer[1] = \'Mapping::NestedNameIsNull\'.getSeverity()\n * in\n * if severity <= 0\n * then true\n * else\n * let status : OclAny[?] = transformation = null implies name = null\n * in\n * \'Mapping::NestedNameIsNull\'.logDiagnostic(self, null, diagnostics, context, null, severity, status, 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.qvtcore.QVTcoreTables%>.STR_Mapping_c_c_NestedNameIsNull);\nfinal /*@NonInvalid\052/ boolean le = <%org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation%>.INSTANCE.evaluate(executor, severity_0, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.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_status;\n\ttry {\n\t\t/*@Caught\052/ @<%org.eclipse.jdt.annotation.NonNull%> <%java.lang.Object%> CAUGHT_eq;\n\t\ttry {\n\t\t\tfinal /*@Thrown\052/ org.eclipse.qvtd.pivot.qvtbase.@<%org.eclipse.jdt.annotation.Nullable%> Transformation transformation = this.getTransformation();\n\t\t\tfinal /*@Thrown\052/ boolean eq = transformation == null;\n\t\t\tCAUGHT_eq = eq;\n\t\t}\n\t\tcatch (<%java.lang.Exception%> e) {\n\t\t\tCAUGHT_eq = <%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_eq_0;\n\t\ttry {\n\t\t\tfinal /*@Thrown\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> String name = this.getName();\n\t\t\tfinal /*@Thrown\052/ boolean eq_0 = name == null;\n\t\t\tCAUGHT_eq_0 = eq_0;\n\t\t}\n\t\tcatch (<%java.lang.Exception%> e) {\n\t\t\tCAUGHT_eq_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 status = <%org.eclipse.ocl.pivot.library.logical.BooleanImpliesOperation%>.INSTANCE.evaluate(CAUGHT_eq, CAUGHT_eq_0);\n\t\tCAUGHT_status = status;\n\t}\n\tcatch (<%java.lang.Exception%> e) {\n\t\tCAUGHT_status = <%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.qvtcore.QVTcoreTables%>.STR_Mapping_c_c_NestedNameIsNull, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_status, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.INT_0).booleanValue();\n\tsymbol_0 = logDiagnostic;\n}\nreturn Boolean.TRUE == symbol_0;'" + * @generated + */ + boolean validateNestedNameIsNull(DiagnosticChain diagnostics, Map<Object, Object> context); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model annotation="http://www.eclipse.org/uml2/2.0.0/UML originalName='RootNameIsNotNull'" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='/**\n *\n * inv RootNameIsNotNull:\n * let severity : Integer[1] = \'Mapping::RootNameIsNotNull\'.getSeverity()\n * in\n * if severity <= 0\n * then true\n * else\n * let status : OclAny[?] = transformation <> null implies name <> null\n * in\n * \'Mapping::RootNameIsNotNull\'.logDiagnostic(self, null, diagnostics, context, null, severity, status, 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.qvtcore.QVTcoreTables%>.STR_Mapping_c_c_RootNameIsNotNull);\nfinal /*@NonInvalid\052/ boolean le = <%org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation%>.INSTANCE.evaluate(executor, severity_0, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.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_status;\n\ttry {\n\t\t/*@Caught\052/ @<%org.eclipse.jdt.annotation.NonNull%> <%java.lang.Object%> CAUGHT_ne;\n\t\ttry {\n\t\t\tfinal /*@Thrown\052/ org.eclipse.qvtd.pivot.qvtbase.@<%org.eclipse.jdt.annotation.Nullable%> Transformation transformation = this.getTransformation();\n\t\t\tfinal /*@Thrown\052/ boolean ne = transformation != null;\n\t\t\tCAUGHT_ne = ne;\n\t\t}\n\t\tcatch (<%java.lang.Exception%> e) {\n\t\t\tCAUGHT_ne = <%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_ne_0;\n\t\ttry {\n\t\t\tfinal /*@Thrown\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> String name = this.getName();\n\t\t\tfinal /*@Thrown\052/ boolean ne_0 = name != null;\n\t\t\tCAUGHT_ne_0 = ne_0;\n\t\t}\n\t\tcatch (<%java.lang.Exception%> e) {\n\t\t\tCAUGHT_ne_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 status = <%org.eclipse.ocl.pivot.library.logical.BooleanImpliesOperation%>.INSTANCE.evaluate(CAUGHT_ne, CAUGHT_ne_0);\n\t\tCAUGHT_status = status;\n\t}\n\tcatch (<%java.lang.Exception%> e) {\n\t\tCAUGHT_status = <%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.qvtcore.QVTcoreTables%>.STR_Mapping_c_c_RootNameIsNotNull, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_status, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.INT_0).booleanValue();\n\tsymbol_0 = logDiagnostic;\n}\nreturn Boolean.TRUE == symbol_0;'" + * @generated + */ + boolean validateRootNameIsNotNull(DiagnosticChain diagnostics, Map<Object, Object> context); + + /** * Returns the value of the '<em><b>Local</b></em>' containment reference list. * The list contents are of type {@link org.eclipse.qvtd.pivot.qvtcore.Mapping}. * It is bidirectional and its opposite is '{@link org.eclipse.qvtd.pivot.qvtcore.Mapping#getContext <em>Context</em>}'. diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/OppositePropertyAssignment.java b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/OppositePropertyAssignment.java index 04d3e0244..42a8aac03 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/OppositePropertyAssignment.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/OppositePropertyAssignment.java @@ -75,6 +75,15 @@ public interface OppositePropertyAssignment extends NavigationAssignment { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * @model annotation="http://www.eclipse.org/uml2/2.0.0/UML originalName='CompatibleTypeForValue'" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='/**\n *\n * inv CompatibleTypeForValue:\n * let\n * severity : Integer[1] = \'OppositePropertyAssignment::CompatibleTypeForValue\'.getSeverity()\n * in\n * if severity <= 0\n * then true\n * else\n * let\n * status : OclAny[?] = let\n * propertyType : Type[?] = getReferredTargetProperty().type\n * in\n * let valueType : Type[?] = value.type\n * in\n * valueType.conformsTo(propertyType) or\n * propertyType.conformsTo(valueType)\n * in\n * let\n * message : String[?] = if status <> true\n * then \'OppositePropertyAssignment::CompatibleTypeForValue: \' + value.type.name + \' must conform to \' +\n * getReferredTargetProperty().type.name + \' or vice-versa\'\n * else null\n * endif\n * in\n * \'OppositePropertyAssignment::CompatibleTypeForValue\'.logDiagnostic(self, null, diagnostics, context, message, severity, status, 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.qvtcore.QVTcoreTables%>.STR_OppositePropertyAssignment_c_c_CompatibleTypeForValue);\nfinal /*@NonInvalid\052/ boolean le = <%org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation%>.INSTANCE.evaluate(executor, severity_0, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.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_or;\n\ttry {\n\t\t/*@Caught\052/ @<%org.eclipse.jdt.annotation.Nullable%> <%java.lang.Object%> CAUGHT_propertyType;\n\t\ttry {\n\t\t\t@SuppressWarnings(\"null\")\n\t\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> Property getReferredTargetProperty = this.getReferredTargetProperty();\n\t\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.Nullable%> Type propertyType = getReferredTargetProperty.getType();\n\t\t\tCAUGHT_propertyType = propertyType;\n\t\t}\n\t\tcatch (<%java.lang.Exception%> e) {\n\t\t\tCAUGHT_propertyType = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.createInvalidValue(e);\n\t\t}\n\t\t/*@Caught\052/ @<%org.eclipse.jdt.annotation.Nullable%> <%java.lang.Object%> CAUGHT_valueType;\n\t\ttry {\n\t\t\t@SuppressWarnings(\"null\")\n\t\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> OCLExpression value = this.getValue();\n\t\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.Nullable%> Type valueType = value.getType();\n\t\t\tCAUGHT_valueType = valueType;\n\t\t}\n\t\tcatch (<%java.lang.Exception%> e) {\n\t\t\tCAUGHT_valueType = <%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_conformsTo;\n\t\ttry {\n\t\t\tif (CAUGHT_valueType instanceof <%org.eclipse.ocl.pivot.values.InvalidValueException%>) {\n\t\t\t\tthrow (<%org.eclipse.ocl.pivot.values.InvalidValueException%>)CAUGHT_valueType;\n\t\t\t}\n\t\t\tif (CAUGHT_propertyType instanceof <%org.eclipse.ocl.pivot.values.InvalidValueException%>) {\n\t\t\t\tthrow (<%org.eclipse.ocl.pivot.values.InvalidValueException%>)CAUGHT_propertyType;\n\t\t\t}\n\t\t\tfinal /*@Thrown\052/ boolean conformsTo = <%org.eclipse.ocl.pivot.library.classifier.OclTypeConformsToOperation%>.INSTANCE.evaluate(executor, CAUGHT_valueType, CAUGHT_propertyType).booleanValue();\n\t\t\tCAUGHT_conformsTo = conformsTo;\n\t\t}\n\t\tcatch (<%java.lang.Exception%> e) {\n\t\t\tCAUGHT_conformsTo = <%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_conformsTo_0;\n\t\ttry {\n\t\t\tif (CAUGHT_propertyType instanceof <%org.eclipse.ocl.pivot.values.InvalidValueException%>) {\n\t\t\t\tthrow (<%org.eclipse.ocl.pivot.values.InvalidValueException%>)CAUGHT_propertyType;\n\t\t\t}\n\t\t\tif (CAUGHT_valueType instanceof <%org.eclipse.ocl.pivot.values.InvalidValueException%>) {\n\t\t\t\tthrow (<%org.eclipse.ocl.pivot.values.InvalidValueException%>)CAUGHT_valueType;\n\t\t\t}\n\t\t\tfinal /*@Thrown\052/ boolean conformsTo_0 = <%org.eclipse.ocl.pivot.library.classifier.OclTypeConformsToOperation%>.INSTANCE.evaluate(executor, CAUGHT_propertyType, CAUGHT_valueType).booleanValue();\n\t\t\tCAUGHT_conformsTo_0 = conformsTo_0;\n\t\t}\n\t\tcatch (<%java.lang.Exception%> e) {\n\t\t\tCAUGHT_conformsTo_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 or = <%org.eclipse.ocl.pivot.library.logical.BooleanOrOperation%>.INSTANCE.evaluate(CAUGHT_conformsTo, CAUGHT_conformsTo_0);\n\t\tCAUGHT_or = or;\n\t}\n\tcatch (<%java.lang.Exception%> e) {\n\t\tCAUGHT_or = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.createInvalidValue(e);\n\t}\n\tif (CAUGHT_or instanceof <%org.eclipse.ocl.pivot.values.InvalidValueException%>) {\n\t\tthrow (<%org.eclipse.ocl.pivot.values.InvalidValueException%>)CAUGHT_or;\n\t}\n\tfinal /*@Thrown\052/ boolean ne = CAUGHT_or == Boolean.FALSE;\n\t/*@NonInvalid\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> String message_0;\n\tif (ne) {\n\t\t@SuppressWarnings(\"null\")\n\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> OCLExpression value_0 = this.getValue();\n\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.Nullable%> Type type = value_0.getType();\n\t\tif (type == null) {\n\t\t\tthrow new <%org.eclipse.ocl.pivot.values.InvalidValueException%>(\"Null source for \\\'NamedElement::name\\\'\");\n\t\t}\n\t\tfinal /*@Thrown\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> String name = type.getName();\n\t\tfinal /*@NonInvalid\052/ java.lang.@<%org.eclipse.jdt.annotation.NonNull%> String sum = <%org.eclipse.ocl.pivot.library.string.StringConcatOperation%>.INSTANCE.evaluate(<%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.STR_OppositePropertyAssignment_c_c_CompatibleTypeForValue_c_32, name);\n\t\tfinal /*@NonInvalid\052/ java.lang.@<%org.eclipse.jdt.annotation.NonNull%> String sum_0 = <%org.eclipse.ocl.pivot.library.string.StringConcatOperation%>.INSTANCE.evaluate(sum, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.STR__32_must_32_conform_32_to_32);\n\t\t@SuppressWarnings(\"null\")\n\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> Property getReferredTargetProperty_0 = this.getReferredTargetProperty();\n\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.Nullable%> Type type_0 = getReferredTargetProperty_0.getType();\n\t\tif (type_0 == null) {\n\t\t\tthrow new <%org.eclipse.ocl.pivot.values.InvalidValueException%>(\"Null source for \\\'NamedElement::name\\\'\");\n\t\t}\n\t\tfinal /*@Thrown\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> String name_0 = type_0.getName();\n\t\tfinal /*@NonInvalid\052/ java.lang.@<%org.eclipse.jdt.annotation.NonNull%> String sum_1 = <%org.eclipse.ocl.pivot.library.string.StringConcatOperation%>.INSTANCE.evaluate(sum_0, name_0);\n\t\tfinal /*@NonInvalid\052/ java.lang.@<%org.eclipse.jdt.annotation.NonNull%> String sum_2 = <%org.eclipse.ocl.pivot.library.string.StringConcatOperation%>.INSTANCE.evaluate(sum_1, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.STR__32_or_32_vice_m_versa);\n\t\tmessage_0 = sum_2;\n\t}\n\telse {\n\t\tmessage_0 = null;\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.qvtcore.QVTcoreTables%>.STR_OppositePropertyAssignment_c_c_CompatibleTypeForValue, this, (Object)null, diagnostics, context, message_0, severity_0, CAUGHT_or, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.INT_0).booleanValue();\n\tsymbol_0 = logDiagnostic;\n}\nreturn Boolean.TRUE == symbol_0;'" + * @generated + */ + boolean validateCompatibleTypeForValue(DiagnosticChain diagnostics, Map<Object, Object> context); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> * @model annotation="http://www.eclipse.org/uml2/2.0.0/UML originalName='OppositePropertyIsImplicit'" * annotation="http://www.eclipse.org/emf/2002/GenModel body='/**\n *\n * inv OppositePropertyIsImplicit:\n * let\n * severity : Integer[1] = \'OppositePropertyAssignment::OppositePropertyIsImplicit\'.getSeverity()\n * in\n * if severity <= 0\n * then true\n * else\n * let status : OclAny[?] = targetProperty.isImplicit\n * in\n * \'OppositePropertyAssignment::OppositePropertyIsImplicit\'.logDiagnostic(self, null, diagnostics, context, null, severity, status, 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.qvtcore.QVTcoreTables%>.STR_OppositePropertyAssignment_c_c_OppositePropertyIsImplicit);\nfinal /*@NonInvalid\052/ boolean le = <%org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation%>.INSTANCE.evaluate(executor, severity_0, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.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_status;\n\ttry {\n\t\t@SuppressWarnings(\"null\")\n\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> Property targetProperty = this.getTargetProperty();\n\t\tfinal /*@Thrown\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> Boolean status = targetProperty.isIsImplicit();\n\t\tCAUGHT_status = status;\n\t}\n\tcatch (<%java.lang.Exception%> e) {\n\t\tCAUGHT_status = <%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.qvtcore.QVTcoreTables%>.STR_OppositePropertyAssignment_c_c_OppositePropertyIsImplicit, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_status, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.INT_0).booleanValue();\n\tsymbol_0 = logDiagnostic;\n}\nreturn Boolean.TRUE == symbol_0;'" * @generated diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/PropertyAssignment.java b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/PropertyAssignment.java index dcf57518b..fcdd24823 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/PropertyAssignment.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/PropertyAssignment.java @@ -75,6 +75,15 @@ public interface PropertyAssignment extends NavigationAssignment { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * @model annotation="http://www.eclipse.org/uml2/2.0.0/UML originalName='CompatibleTypeForValue'" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='/**\n *\n * inv CompatibleTypeForValue:\n * let\n * severity : Integer[1] = \'PropertyAssignment::CompatibleTypeForValue\'.getSeverity()\n * in\n * if severity <= 0\n * then true\n * else\n * let\n * status : OclAny[?] = let\n * propertyType : Type[?] = getReferredTargetProperty().type\n * in\n * let valueType : Type[?] = value.type\n * in\n * valueType.conformsTo(propertyType) or\n * propertyType.conformsTo(valueType)\n * in\n * let\n * message : String[?] = if status <> true\n * then \'PropertyAssignment::CompatibleTypeForValue: \' + value.type.name + \' must conform to \' +\n * getReferredTargetProperty().type.name + \' or vice-versa\'\n * else null\n * endif\n * in\n * \'PropertyAssignment::CompatibleTypeForValue\'.logDiagnostic(self, null, diagnostics, context, message, severity, status, 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.qvtcore.QVTcoreTables%>.STR_PropertyAssignment_c_c_CompatibleTypeForValue);\nfinal /*@NonInvalid\052/ boolean le = <%org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation%>.INSTANCE.evaluate(executor, severity_0, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.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_or;\n\ttry {\n\t\t/*@Caught\052/ @<%org.eclipse.jdt.annotation.Nullable%> <%java.lang.Object%> CAUGHT_propertyType;\n\t\ttry {\n\t\t\t@SuppressWarnings(\"null\")\n\t\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> Property getReferredTargetProperty = this.getReferredTargetProperty();\n\t\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.Nullable%> Type propertyType = getReferredTargetProperty.getType();\n\t\t\tCAUGHT_propertyType = propertyType;\n\t\t}\n\t\tcatch (<%java.lang.Exception%> e) {\n\t\t\tCAUGHT_propertyType = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.createInvalidValue(e);\n\t\t}\n\t\t/*@Caught\052/ @<%org.eclipse.jdt.annotation.Nullable%> <%java.lang.Object%> CAUGHT_valueType;\n\t\ttry {\n\t\t\t@SuppressWarnings(\"null\")\n\t\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> OCLExpression value = this.getValue();\n\t\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.Nullable%> Type valueType = value.getType();\n\t\t\tCAUGHT_valueType = valueType;\n\t\t}\n\t\tcatch (<%java.lang.Exception%> e) {\n\t\t\tCAUGHT_valueType = <%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_conformsTo;\n\t\ttry {\n\t\t\tif (CAUGHT_valueType instanceof <%org.eclipse.ocl.pivot.values.InvalidValueException%>) {\n\t\t\t\tthrow (<%org.eclipse.ocl.pivot.values.InvalidValueException%>)CAUGHT_valueType;\n\t\t\t}\n\t\t\tif (CAUGHT_propertyType instanceof <%org.eclipse.ocl.pivot.values.InvalidValueException%>) {\n\t\t\t\tthrow (<%org.eclipse.ocl.pivot.values.InvalidValueException%>)CAUGHT_propertyType;\n\t\t\t}\n\t\t\tfinal /*@Thrown\052/ boolean conformsTo = <%org.eclipse.ocl.pivot.library.classifier.OclTypeConformsToOperation%>.INSTANCE.evaluate(executor, CAUGHT_valueType, CAUGHT_propertyType).booleanValue();\n\t\t\tCAUGHT_conformsTo = conformsTo;\n\t\t}\n\t\tcatch (<%java.lang.Exception%> e) {\n\t\t\tCAUGHT_conformsTo = <%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_conformsTo_0;\n\t\ttry {\n\t\t\tif (CAUGHT_propertyType instanceof <%org.eclipse.ocl.pivot.values.InvalidValueException%>) {\n\t\t\t\tthrow (<%org.eclipse.ocl.pivot.values.InvalidValueException%>)CAUGHT_propertyType;\n\t\t\t}\n\t\t\tif (CAUGHT_valueType instanceof <%org.eclipse.ocl.pivot.values.InvalidValueException%>) {\n\t\t\t\tthrow (<%org.eclipse.ocl.pivot.values.InvalidValueException%>)CAUGHT_valueType;\n\t\t\t}\n\t\t\tfinal /*@Thrown\052/ boolean conformsTo_0 = <%org.eclipse.ocl.pivot.library.classifier.OclTypeConformsToOperation%>.INSTANCE.evaluate(executor, CAUGHT_propertyType, CAUGHT_valueType).booleanValue();\n\t\t\tCAUGHT_conformsTo_0 = conformsTo_0;\n\t\t}\n\t\tcatch (<%java.lang.Exception%> e) {\n\t\t\tCAUGHT_conformsTo_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 or = <%org.eclipse.ocl.pivot.library.logical.BooleanOrOperation%>.INSTANCE.evaluate(CAUGHT_conformsTo, CAUGHT_conformsTo_0);\n\t\tCAUGHT_or = or;\n\t}\n\tcatch (<%java.lang.Exception%> e) {\n\t\tCAUGHT_or = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.createInvalidValue(e);\n\t}\n\tif (CAUGHT_or instanceof <%org.eclipse.ocl.pivot.values.InvalidValueException%>) {\n\t\tthrow (<%org.eclipse.ocl.pivot.values.InvalidValueException%>)CAUGHT_or;\n\t}\n\tfinal /*@Thrown\052/ boolean ne = CAUGHT_or == Boolean.FALSE;\n\t/*@NonInvalid\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> String message_0;\n\tif (ne) {\n\t\t@SuppressWarnings(\"null\")\n\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> OCLExpression value_0 = this.getValue();\n\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.Nullable%> Type type = value_0.getType();\n\t\tif (type == null) {\n\t\t\tthrow new <%org.eclipse.ocl.pivot.values.InvalidValueException%>(\"Null source for \\\'NamedElement::name\\\'\");\n\t\t}\n\t\tfinal /*@Thrown\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> String name = type.getName();\n\t\tfinal /*@NonInvalid\052/ java.lang.@<%org.eclipse.jdt.annotation.NonNull%> String sum = <%org.eclipse.ocl.pivot.library.string.StringConcatOperation%>.INSTANCE.evaluate(<%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.STR_PropertyAssignment_c_c_CompatibleTypeForValue_c_32, name);\n\t\tfinal /*@NonInvalid\052/ java.lang.@<%org.eclipse.jdt.annotation.NonNull%> String sum_0 = <%org.eclipse.ocl.pivot.library.string.StringConcatOperation%>.INSTANCE.evaluate(sum, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.STR__32_must_32_conform_32_to_32);\n\t\t@SuppressWarnings(\"null\")\n\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> Property getReferredTargetProperty_0 = this.getReferredTargetProperty();\n\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.Nullable%> Type type_0 = getReferredTargetProperty_0.getType();\n\t\tif (type_0 == null) {\n\t\t\tthrow new <%org.eclipse.ocl.pivot.values.InvalidValueException%>(\"Null source for \\\'NamedElement::name\\\'\");\n\t\t}\n\t\tfinal /*@Thrown\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> String name_0 = type_0.getName();\n\t\tfinal /*@NonInvalid\052/ java.lang.@<%org.eclipse.jdt.annotation.NonNull%> String sum_1 = <%org.eclipse.ocl.pivot.library.string.StringConcatOperation%>.INSTANCE.evaluate(sum_0, name_0);\n\t\tfinal /*@NonInvalid\052/ java.lang.@<%org.eclipse.jdt.annotation.NonNull%> String sum_2 = <%org.eclipse.ocl.pivot.library.string.StringConcatOperation%>.INSTANCE.evaluate(sum_1, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.STR__32_or_32_vice_m_versa);\n\t\tmessage_0 = sum_2;\n\t}\n\telse {\n\t\tmessage_0 = null;\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.qvtcore.QVTcoreTables%>.STR_PropertyAssignment_c_c_CompatibleTypeForValue, this, (Object)null, diagnostics, context, message_0, severity_0, CAUGHT_or, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.INT_0).booleanValue();\n\tsymbol_0 = logDiagnostic;\n}\nreturn Boolean.TRUE == symbol_0;'" + * @generated + */ + boolean validateCompatibleTypeForValue(DiagnosticChain diagnostics, Map<Object, Object> context); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> * @model annotation="http://www.eclipse.org/uml2/2.0.0/UML originalName='PropertyIsNotImplicit'" * annotation="http://www.eclipse.org/emf/2002/GenModel body='/**\n *\n * inv PropertyIsNotImplicit:\n * let\n * severity : Integer[1] = \'PropertyAssignment::PropertyIsNotImplicit\'.getSeverity()\n * in\n * if severity <= 0\n * then true\n * else\n * let status : OclAny[?] = not targetProperty.isImplicit\n * in\n * \'PropertyAssignment::PropertyIsNotImplicit\'.logDiagnostic(self, null, diagnostics, context, null, severity, status, 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.qvtcore.QVTcoreTables%>.STR_PropertyAssignment_c_c_PropertyIsNotImplicit);\nfinal /*@NonInvalid\052/ boolean le = <%org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation%>.INSTANCE.evaluate(executor, severity_0, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.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_status;\n\ttry {\n\t\t/*@Caught\052/ @<%org.eclipse.jdt.annotation.Nullable%> <%java.lang.Object%> CAUGHT_isImplicit;\n\t\ttry {\n\t\t\t@SuppressWarnings(\"null\")\n\t\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> Property targetProperty = this.getTargetProperty();\n\t\t\tfinal /*@Thrown\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> Boolean isImplicit = targetProperty.isIsImplicit();\n\t\t\tCAUGHT_isImplicit = isImplicit;\n\t\t}\n\t\tcatch (<%java.lang.Exception%> e) {\n\t\t\tCAUGHT_isImplicit = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.createInvalidValue(e);\n\t\t}\n\t\tfinal /*@Thrown\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> Boolean status = <%org.eclipse.ocl.pivot.library.logical.BooleanNotOperation%>.INSTANCE.evaluate(CAUGHT_isImplicit);\n\t\tCAUGHT_status = status;\n\t}\n\tcatch (<%java.lang.Exception%> e) {\n\t\tCAUGHT_status = <%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.qvtcore.QVTcoreTables%>.STR_PropertyAssignment_c_c_PropertyIsNotImplicit, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_status, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.INT_0).booleanValue();\n\tsymbol_0 = logDiagnostic;\n}\nreturn Boolean.TRUE == symbol_0;'" * @generated diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/QVTcorePackage.java b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/QVTcorePackage.java index 9d8869541..fd95ed003 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/QVTcorePackage.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/QVTcorePackage.java @@ -549,13 +549,22 @@ public interface QVTcorePackage extends EPackage { int BOTTOM_PATTERN___GET_AREA = CORE_PATTERN___GET_AREA; /** + * The operation id for the '<em>Validate Variables Are Bottom Variables</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int BOTTOM_PATTERN___VALIDATE_VARIABLES_ARE_BOTTOM_VARIABLES__DIAGNOSTICCHAIN_MAP = CORE_PATTERN_OPERATION_COUNT + 0; + + /** * The number of operations of the '<em>Bottom Pattern</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - int BOTTOM_PATTERN_OPERATION_COUNT = CORE_PATTERN_OPERATION_COUNT + 0; + int BOTTOM_PATTERN_OPERATION_COUNT = CORE_PATTERN_OPERATION_COUNT + 1; /** * The meta object id for the '{@link org.eclipse.qvtd.pivot.qvtcore.impl.BottomVariableImpl <em>Bottom Variable</em>}' class. @@ -1283,13 +1292,22 @@ public interface QVTcorePackage extends EPackage { int GUARD_PATTERN___GET_AREA = CORE_PATTERN___GET_AREA; /** + * The operation id for the '<em>Validate Variables Are Guard Variables</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int GUARD_PATTERN___VALIDATE_VARIABLES_ARE_GUARD_VARIABLES__DIAGNOSTICCHAIN_MAP = CORE_PATTERN_OPERATION_COUNT + 0; + + /** * The number of operations of the '<em>Guard Pattern</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - int GUARD_PATTERN_OPERATION_COUNT = CORE_PATTERN_OPERATION_COUNT + 0; + int GUARD_PATTERN_OPERATION_COUNT = CORE_PATTERN_OPERATION_COUNT + 1; /** * The meta object id for the '{@link org.eclipse.qvtd.pivot.qvtcore.impl.GuardVariableImpl <em>Guard Variable</em>}' class. @@ -1699,13 +1717,40 @@ public interface QVTcorePackage extends EPackage { int MAPPING___VALIDATE_OVERRIDES_RULE_OVERRIDES_ALL_DOMAINS__DIAGNOSTICCHAIN_MAP = QVTbasePackage.RULE___VALIDATE_OVERRIDES_RULE_OVERRIDES_ALL_DOMAINS__DIAGNOSTICCHAIN_MAP; /** + * The operation id for the '<em>Validate Domains Are Core Domains</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MAPPING___VALIDATE_DOMAINS_ARE_CORE_DOMAINS__DIAGNOSTICCHAIN_MAP = QVTbasePackage.RULE_OPERATION_COUNT + 0; + + /** + * The operation id for the '<em>Validate Nested Name Is Null</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MAPPING___VALIDATE_NESTED_NAME_IS_NULL__DIAGNOSTICCHAIN_MAP = QVTbasePackage.RULE_OPERATION_COUNT + 1; + + /** + * The operation id for the '<em>Validate Root Name Is Not Null</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MAPPING___VALIDATE_ROOT_NAME_IS_NOT_NULL__DIAGNOSTICCHAIN_MAP = QVTbasePackage.RULE_OPERATION_COUNT + 2; + + /** * The number of operations of the '<em>Mapping</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - int MAPPING_OPERATION_COUNT = QVTbasePackage.RULE_OPERATION_COUNT + 0; + int MAPPING_OPERATION_COUNT = QVTbasePackage.RULE_OPERATION_COUNT + 3; /** * The meta object id for the '{@link org.eclipse.qvtd.pivot.qvtcore.impl.NavigationAssignmentImpl <em>Navigation Assignment</em>}' class. @@ -1953,13 +1998,22 @@ public interface QVTcorePackage extends EPackage { int OPPOSITE_PROPERTY_ASSIGNMENT___GET_REFERRED_TARGET_PROPERTY = NAVIGATION_ASSIGNMENT_OPERATION_COUNT + 0; /** + * The operation id for the '<em>Validate Compatible Type For Value</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int OPPOSITE_PROPERTY_ASSIGNMENT___VALIDATE_COMPATIBLE_TYPE_FOR_VALUE__DIAGNOSTICCHAIN_MAP = NAVIGATION_ASSIGNMENT_OPERATION_COUNT + 1; + + /** * The operation id for the '<em>Validate Opposite Property Is Implicit</em>' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - int OPPOSITE_PROPERTY_ASSIGNMENT___VALIDATE_OPPOSITE_PROPERTY_IS_IMPLICIT__DIAGNOSTICCHAIN_MAP = NAVIGATION_ASSIGNMENT_OPERATION_COUNT + 1; + int OPPOSITE_PROPERTY_ASSIGNMENT___VALIDATE_OPPOSITE_PROPERTY_IS_IMPLICIT__DIAGNOSTICCHAIN_MAP = NAVIGATION_ASSIGNMENT_OPERATION_COUNT + 2; /** * The operation id for the '<em>Validate Target Propety Is Slot Property</em>' operation. @@ -1968,7 +2022,7 @@ public interface QVTcorePackage extends EPackage { * @generated * @ordered */ - int OPPOSITE_PROPERTY_ASSIGNMENT___VALIDATE_TARGET_PROPETY_IS_SLOT_PROPERTY__DIAGNOSTICCHAIN_MAP = NAVIGATION_ASSIGNMENT_OPERATION_COUNT + 2; + int OPPOSITE_PROPERTY_ASSIGNMENT___VALIDATE_TARGET_PROPETY_IS_SLOT_PROPERTY__DIAGNOSTICCHAIN_MAP = NAVIGATION_ASSIGNMENT_OPERATION_COUNT + 3; /** * The number of operations of the '<em>Opposite Property Assignment</em>' class. @@ -1977,7 +2031,7 @@ public interface QVTcorePackage extends EPackage { * @generated * @ordered */ - int OPPOSITE_PROPERTY_ASSIGNMENT_OPERATION_COUNT = NAVIGATION_ASSIGNMENT_OPERATION_COUNT + 3; + int OPPOSITE_PROPERTY_ASSIGNMENT_OPERATION_COUNT = NAVIGATION_ASSIGNMENT_OPERATION_COUNT + 4; /** * The meta object id for the '{@link org.eclipse.qvtd.pivot.qvtcore.impl.PropertyAssignmentImpl <em>Property Assignment</em>}' class. @@ -2107,13 +2161,22 @@ public interface QVTcorePackage extends EPackage { int PROPERTY_ASSIGNMENT___GET_REFERRED_TARGET_PROPERTY = NAVIGATION_ASSIGNMENT_OPERATION_COUNT + 0; /** + * The operation id for the '<em>Validate Compatible Type For Value</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PROPERTY_ASSIGNMENT___VALIDATE_COMPATIBLE_TYPE_FOR_VALUE__DIAGNOSTICCHAIN_MAP = NAVIGATION_ASSIGNMENT_OPERATION_COUNT + 1; + + /** * The operation id for the '<em>Validate Property Is Not Implicit</em>' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - int PROPERTY_ASSIGNMENT___VALIDATE_PROPERTY_IS_NOT_IMPLICIT__DIAGNOSTICCHAIN_MAP = NAVIGATION_ASSIGNMENT_OPERATION_COUNT + 1; + int PROPERTY_ASSIGNMENT___VALIDATE_PROPERTY_IS_NOT_IMPLICIT__DIAGNOSTICCHAIN_MAP = NAVIGATION_ASSIGNMENT_OPERATION_COUNT + 2; /** * The operation id for the '<em>Validate Target Propety Is Slot Property</em>' operation. @@ -2122,7 +2185,7 @@ public interface QVTcorePackage extends EPackage { * @generated * @ordered */ - int PROPERTY_ASSIGNMENT___VALIDATE_TARGET_PROPETY_IS_SLOT_PROPERTY__DIAGNOSTICCHAIN_MAP = NAVIGATION_ASSIGNMENT_OPERATION_COUNT + 2; + int PROPERTY_ASSIGNMENT___VALIDATE_TARGET_PROPETY_IS_SLOT_PROPERTY__DIAGNOSTICCHAIN_MAP = NAVIGATION_ASSIGNMENT_OPERATION_COUNT + 3; /** * The number of operations of the '<em>Property Assignment</em>' class. @@ -2131,7 +2194,7 @@ public interface QVTcorePackage extends EPackage { * @generated * @ordered */ - int PROPERTY_ASSIGNMENT_OPERATION_COUNT = NAVIGATION_ASSIGNMENT_OPERATION_COUNT + 3; + int PROPERTY_ASSIGNMENT_OPERATION_COUNT = NAVIGATION_ASSIGNMENT_OPERATION_COUNT + 4; /** * The meta object id for the '{@link org.eclipse.qvtd.pivot.qvtcore.impl.RealizedVariableImpl <em>Realized Variable</em>}' class. @@ -2442,13 +2505,22 @@ public interface QVTcorePackage extends EPackage { int VARIABLE_ASSIGNMENT___GET_VALUE__TYPE_STRING = ASSIGNMENT___GET_VALUE__TYPE_STRING; /** + * The operation id for the '<em>Validate Compatible Type For Value</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int VARIABLE_ASSIGNMENT___VALIDATE_COMPATIBLE_TYPE_FOR_VALUE__DIAGNOSTICCHAIN_MAP = ASSIGNMENT_OPERATION_COUNT + 0; + + /** * The number of operations of the '<em>Variable Assignment</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - int VARIABLE_ASSIGNMENT_OPERATION_COUNT = ASSIGNMENT_OPERATION_COUNT + 0; + int VARIABLE_ASSIGNMENT_OPERATION_COUNT = ASSIGNMENT_OPERATION_COUNT + 1; /** * The meta object id for the '{@link org.eclipse.qvtd.pivot.qvtcore.EnforcementMode <em>Enforcement Mode</em>}' enum. @@ -2590,6 +2662,16 @@ public interface QVTcorePackage extends EPackage { EReference getBottomPattern_RealizedVariable(); /** + * Returns the meta object for the '{@link org.eclipse.qvtd.pivot.qvtcore.BottomPattern#validateVariablesAreBottomVariables(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Variables Are Bottom Variables</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Validate Variables Are Bottom Variables</em>' operation. + * @see org.eclipse.qvtd.pivot.qvtcore.BottomPattern#validateVariablesAreBottomVariables(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * @generated + */ + EOperation getBottomPattern__ValidateVariablesAreBottomVariables__DiagnosticChain_Map(); + + /** * Returns the meta object for class '{@link org.eclipse.qvtd.pivot.qvtcore.BottomVariable <em>Bottom Variable</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -2715,6 +2797,16 @@ public interface QVTcorePackage extends EPackage { EReference getGuardPattern_Area(); /** + * Returns the meta object for the '{@link org.eclipse.qvtd.pivot.qvtcore.GuardPattern#validateVariablesAreGuardVariables(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Variables Are Guard Variables</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Validate Variables Are Guard Variables</em>' operation. + * @see org.eclipse.qvtd.pivot.qvtcore.GuardPattern#validateVariablesAreGuardVariables(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * @generated + */ + EOperation getGuardPattern__ValidateVariablesAreGuardVariables__DiagnosticChain_Map(); + + /** * Returns the meta object for class '{@link org.eclipse.qvtd.pivot.qvtcore.GuardVariable <em>Guard Variable</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -2757,6 +2849,36 @@ public interface QVTcorePackage extends EPackage { EReference getMapping_Specification(); /** + * Returns the meta object for the '{@link org.eclipse.qvtd.pivot.qvtcore.Mapping#validateDomainsAreCoreDomains(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Domains Are Core Domains</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Validate Domains Are Core Domains</em>' operation. + * @see org.eclipse.qvtd.pivot.qvtcore.Mapping#validateDomainsAreCoreDomains(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * @generated + */ + EOperation getMapping__ValidateDomainsAreCoreDomains__DiagnosticChain_Map(); + + /** + * Returns the meta object for the '{@link org.eclipse.qvtd.pivot.qvtcore.Mapping#validateNestedNameIsNull(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Nested Name Is Null</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Validate Nested Name Is Null</em>' operation. + * @see org.eclipse.qvtd.pivot.qvtcore.Mapping#validateNestedNameIsNull(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * @generated + */ + EOperation getMapping__ValidateNestedNameIsNull__DiagnosticChain_Map(); + + /** + * Returns the meta object for the '{@link org.eclipse.qvtd.pivot.qvtcore.Mapping#validateRootNameIsNotNull(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Root Name Is Not Null</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Validate Root Name Is Not Null</em>' operation. + * @see org.eclipse.qvtd.pivot.qvtcore.Mapping#validateRootNameIsNotNull(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * @generated + */ + EOperation getMapping__ValidateRootNameIsNotNull__DiagnosticChain_Map(); + + /** * Returns the meta object for class '{@link org.eclipse.qvtd.pivot.qvtcore.NavigationAssignment <em>Navigation Assignment</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -2809,6 +2931,16 @@ public interface QVTcorePackage extends EPackage { EOperation getOppositePropertyAssignment__GetReferredTargetProperty(); /** + * Returns the meta object for the '{@link org.eclipse.qvtd.pivot.qvtcore.OppositePropertyAssignment#validateCompatibleTypeForValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Compatible Type For Value</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Validate Compatible Type For Value</em>' operation. + * @see org.eclipse.qvtd.pivot.qvtcore.OppositePropertyAssignment#validateCompatibleTypeForValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * @generated + */ + EOperation getOppositePropertyAssignment__ValidateCompatibleTypeForValue__DiagnosticChain_Map(); + + /** * Returns the meta object for the '{@link org.eclipse.qvtd.pivot.qvtcore.OppositePropertyAssignment#validateOppositePropertyIsImplicit(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Opposite Property Is Implicit</em>}' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -2860,6 +2992,16 @@ public interface QVTcorePackage extends EPackage { EOperation getPropertyAssignment__GetReferredTargetProperty(); /** + * Returns the meta object for the '{@link org.eclipse.qvtd.pivot.qvtcore.PropertyAssignment#validateCompatibleTypeForValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Compatible Type For Value</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Validate Compatible Type For Value</em>' operation. + * @see org.eclipse.qvtd.pivot.qvtcore.PropertyAssignment#validateCompatibleTypeForValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * @generated + */ + EOperation getPropertyAssignment__ValidateCompatibleTypeForValue__DiagnosticChain_Map(); + + /** * Returns the meta object for the '{@link org.eclipse.qvtd.pivot.qvtcore.PropertyAssignment#validatePropertyIsNotImplicit(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Property Is Not Implicit</em>}' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -2911,6 +3053,16 @@ public interface QVTcorePackage extends EPackage { EReference getVariableAssignment_TargetVariable(); /** + * Returns the meta object for the '{@link org.eclipse.qvtd.pivot.qvtcore.VariableAssignment#validateCompatibleTypeForValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Compatible Type For Value</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Validate Compatible Type For Value</em>' operation. + * @see org.eclipse.qvtd.pivot.qvtcore.VariableAssignment#validateCompatibleTypeForValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * @generated + */ + EOperation getVariableAssignment__ValidateCompatibleTypeForValue__DiagnosticChain_Map(); + + /** * Returns the meta object for enum '{@link org.eclipse.qvtd.pivot.qvtcore.EnforcementMode <em>Enforcement Mode</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -3067,6 +3219,14 @@ public interface QVTcorePackage extends EPackage { EReference BOTTOM_PATTERN__REALIZED_VARIABLE = eINSTANCE.getBottomPattern_RealizedVariable(); /** + * The meta object literal for the '<em><b>Validate Variables Are Bottom Variables</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation BOTTOM_PATTERN___VALIDATE_VARIABLES_ARE_BOTTOM_VARIABLES__DIAGNOSTICCHAIN_MAP = eINSTANCE.getBottomPattern__ValidateVariablesAreBottomVariables__DiagnosticChain_Map(); + + /** * The meta object literal for the '{@link org.eclipse.qvtd.pivot.qvtcore.impl.BottomVariableImpl <em>Bottom Variable</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -3175,6 +3335,14 @@ public interface QVTcorePackage extends EPackage { EReference GUARD_PATTERN__AREA = eINSTANCE.getGuardPattern_Area(); /** + * The meta object literal for the '<em><b>Validate Variables Are Guard Variables</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation GUARD_PATTERN___VALIDATE_VARIABLES_ARE_GUARD_VARIABLES__DIAGNOSTICCHAIN_MAP = eINSTANCE.getGuardPattern__ValidateVariablesAreGuardVariables__DiagnosticChain_Map(); + + /** * The meta object literal for the '{@link org.eclipse.qvtd.pivot.qvtcore.impl.GuardVariableImpl <em>Guard Variable</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -3211,6 +3379,30 @@ public interface QVTcorePackage extends EPackage { EReference MAPPING__SPECIFICATION = eINSTANCE.getMapping_Specification(); /** + * The meta object literal for the '<em><b>Validate Domains Are Core Domains</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation MAPPING___VALIDATE_DOMAINS_ARE_CORE_DOMAINS__DIAGNOSTICCHAIN_MAP = eINSTANCE.getMapping__ValidateDomainsAreCoreDomains__DiagnosticChain_Map(); + + /** + * The meta object literal for the '<em><b>Validate Nested Name Is Null</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation MAPPING___VALIDATE_NESTED_NAME_IS_NULL__DIAGNOSTICCHAIN_MAP = eINSTANCE.getMapping__ValidateNestedNameIsNull__DiagnosticChain_Map(); + + /** + * The meta object literal for the '<em><b>Validate Root Name Is Not Null</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation MAPPING___VALIDATE_ROOT_NAME_IS_NOT_NULL__DIAGNOSTICCHAIN_MAP = eINSTANCE.getMapping__ValidateRootNameIsNotNull__DiagnosticChain_Map(); + + /** * The meta object literal for the '{@link org.eclipse.qvtd.pivot.qvtcore.impl.NavigationAssignmentImpl <em>Navigation Assignment</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -3255,6 +3447,14 @@ public interface QVTcorePackage extends EPackage { EOperation OPPOSITE_PROPERTY_ASSIGNMENT___GET_REFERRED_TARGET_PROPERTY = eINSTANCE.getOppositePropertyAssignment__GetReferredTargetProperty(); /** + * The meta object literal for the '<em><b>Validate Compatible Type For Value</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation OPPOSITE_PROPERTY_ASSIGNMENT___VALIDATE_COMPATIBLE_TYPE_FOR_VALUE__DIAGNOSTICCHAIN_MAP = eINSTANCE.getOppositePropertyAssignment__ValidateCompatibleTypeForValue__DiagnosticChain_Map(); + + /** * The meta object literal for the '<em><b>Validate Opposite Property Is Implicit</b></em>' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -3297,6 +3497,14 @@ public interface QVTcorePackage extends EPackage { EOperation PROPERTY_ASSIGNMENT___GET_REFERRED_TARGET_PROPERTY = eINSTANCE.getPropertyAssignment__GetReferredTargetProperty(); /** + * The meta object literal for the '<em><b>Validate Compatible Type For Value</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation PROPERTY_ASSIGNMENT___VALIDATE_COMPATIBLE_TYPE_FOR_VALUE__DIAGNOSTICCHAIN_MAP = eINSTANCE.getPropertyAssignment__ValidateCompatibleTypeForValue__DiagnosticChain_Map(); + + /** * The meta object literal for the '<em><b>Validate Property Is Not Implicit</b></em>' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -3341,6 +3549,14 @@ public interface QVTcorePackage extends EPackage { EReference VARIABLE_ASSIGNMENT__TARGET_VARIABLE = eINSTANCE.getVariableAssignment_TargetVariable(); /** + * The meta object literal for the '<em><b>Validate Compatible Type For Value</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation VARIABLE_ASSIGNMENT___VALIDATE_COMPATIBLE_TYPE_FOR_VALUE__DIAGNOSTICCHAIN_MAP = eINSTANCE.getVariableAssignment__ValidateCompatibleTypeForValue__DiagnosticChain_Map(); + + /** * The meta object literal for the '{@link org.eclipse.qvtd.pivot.qvtcore.EnforcementMode <em>Enforcement Mode</em>}' enum. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/QVTcoreTables.java b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/QVTcoreTables.java index 85f751b67..3c387137f 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/QVTcoreTables.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/QVTcoreTables.java @@ -70,13 +70,18 @@ public class QVTcoreTables * Constants used by auto-generated code. */ public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull RootPackageId PACKid_$metamodel$ = org.eclipse.ocl.pivot.ids.IdManager.getRootPackageId("$metamodel$"); + public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull NsURIPackageId PACKid_http_c_s_s_www_eclipse_org_s_qvt_s_2015_s_QVTbase = org.eclipse.ocl.pivot.ids.IdManager.getNsURIPackageId("http://www.eclipse.org/qvt/2015/QVTbase", null, org.eclipse.qvtd.pivot.qvtbase.QVTbasePackage.eINSTANCE); public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull NsURIPackageId PACKid_http_c_s_s_www_eclipse_org_s_qvt_s_2015_s_QVTcore = org.eclipse.ocl.pivot.ids.IdManager.getNsURIPackageId("http://www.eclipse.org/qvt/2015/QVTcore", null, org.eclipse.qvtd.pivot.qvtcore.QVTcorePackage.eINSTANCE); public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_Area = org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.PACKid_http_c_s_s_www_eclipse_org_s_qvt_s_2015_s_QVTcore.getClassId("Area", 0); public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_Assignment = org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.PACKid_http_c_s_s_www_eclipse_org_s_qvt_s_2015_s_QVTcore.getClassId("Assignment", 0); public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_BottomPattern = org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.PACKid_http_c_s_s_www_eclipse_org_s_qvt_s_2015_s_QVTcore.getClassId("BottomPattern", 0); + public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_BottomVariable = org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.PACKid_http_c_s_s_www_eclipse_org_s_qvt_s_2015_s_QVTcore.getClassId("BottomVariable", 0); public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_Class = org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.PACKid_$metamodel$.getClassId("Class", 0); + public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_CoreDomain = org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.PACKid_http_c_s_s_www_eclipse_org_s_qvt_s_2015_s_QVTcore.getClassId("CoreDomain", 0); + public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_Domain = org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.PACKid_http_c_s_s_www_eclipse_org_s_qvt_s_2015_s_QVTbase.getClassId("Domain", 0); public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_EnforcementOperation = org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.PACKid_http_c_s_s_www_eclipse_org_s_qvt_s_2015_s_QVTcore.getClassId("EnforcementOperation", 0); public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_GuardPattern = org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.PACKid_http_c_s_s_www_eclipse_org_s_qvt_s_2015_s_QVTcore.getClassId("GuardPattern", 0); + public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_GuardVariable = org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.PACKid_http_c_s_s_www_eclipse_org_s_qvt_s_2015_s_QVTcore.getClassId("GuardVariable", 0); public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_Mapping = org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.PACKid_http_c_s_s_www_eclipse_org_s_qvt_s_2015_s_QVTcore.getClassId("Mapping", 0); public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_OCLExpression = org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.PACKid_$metamodel$.getClassId("OCLExpression", 0); public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_OperationCallExp = org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.PACKid_$metamodel$.getClassId("OperationCallExp", 0); @@ -84,14 +89,30 @@ public class QVTcoreTables public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_Property = org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.PACKid_$metamodel$.getClassId("Property", 0); public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_PropertyAssignment = org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.PACKid_http_c_s_s_www_eclipse_org_s_qvt_s_2015_s_QVTcore.getClassId("PropertyAssignment", 0); public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_RealizedVariable = org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.PACKid_http_c_s_s_www_eclipse_org_s_qvt_s_2015_s_QVTcore.getClassId("RealizedVariable", 0); + public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_Transformation = org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.PACKid_http_c_s_s_www_eclipse_org_s_qvt_s_2015_s_QVTbase.getClassId("Transformation", 0); public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_Type = org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.PACKid_$metamodel$.getClassId("Type", 0); public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_Variable = org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.PACKid_$metamodel$.getClassId("Variable", 0); + public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_VariableAssignment = org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.PACKid_http_c_s_s_www_eclipse_org_s_qvt_s_2015_s_QVTcore.getClassId("VariableAssignment", 0); public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull EnumerationId ENUMid_EnforcementMode = org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.PACKid_http_c_s_s_www_eclipse_org_s_qvt_s_2015_s_QVTcore.getEnumerationId("EnforcementMode"); public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.values.@org.eclipse.jdt.annotation.NonNull IntegerValue INT_0 = org.eclipse.ocl.pivot.utilities.ValueUtil.integerValueOf("0"); + public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_BottomPattern_c_c_VariablesAreBottomVariables = "BottomPattern::VariablesAreBottomVariables"; + public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_GuardPattern_c_c_VariablesAreGuardVariables = "GuardPattern::VariablesAreGuardVariables"; + public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_Mapping_c_c_DomainsAreCoreDomains = "Mapping::DomainsAreCoreDomains"; + public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_Mapping_c_c_NestedNameIsNull = "Mapping::NestedNameIsNull"; + public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_Mapping_c_c_RootNameIsNotNull = "Mapping::RootNameIsNotNull"; + public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_OppositePropertyAssignment_c_c_CompatibleTypeForValue = "OppositePropertyAssignment::CompatibleTypeForValue"; + public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_OppositePropertyAssignment_c_c_CompatibleTypeForValue_c_32 = "OppositePropertyAssignment::CompatibleTypeForValue: "; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_OppositePropertyAssignment_c_c_OppositePropertyIsImplicit = "OppositePropertyAssignment::OppositePropertyIsImplicit"; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_OppositePropertyAssignment_c_c_TargetPropetyIsSlotProperty = "OppositePropertyAssignment::TargetPropetyIsSlotProperty"; + public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_PropertyAssignment_c_c_CompatibleTypeForValue = "PropertyAssignment::CompatibleTypeForValue"; + public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_PropertyAssignment_c_c_CompatibleTypeForValue_c_32 = "PropertyAssignment::CompatibleTypeForValue: "; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_PropertyAssignment_c_c_PropertyIsNotImplicit = "PropertyAssignment::PropertyIsNotImplicit"; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_PropertyAssignment_c_c_TargetPropetyIsSlotProperty = "PropertyAssignment::TargetPropetyIsSlotProperty"; + public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_VariableAssignment_c_c_CompatibleTypeForValue = "VariableAssignment::CompatibleTypeForValue"; + public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_VariableAssignment_c_c_CompatibleTypeForValue_c_32 = "VariableAssignment::CompatibleTypeForValue: "; + public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR__32_must_32_conform_32_to_32 = " must conform to "; + public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR__32_or_32_vice_m_versa = " or vice-versa"; + public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull CollectionTypeId ORD_CLSSid_Domain = org.eclipse.ocl.pivot.ids.TypeId.ORDERED_SET.getSpecializedId(org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.CLSSid_Domain); public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull CollectionTypeId SET_CLSSid_Assignment = org.eclipse.ocl.pivot.ids.TypeId.SET.getSpecializedId(org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.CLSSid_Assignment); public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull CollectionTypeId SET_CLSSid_EnforcementOperation = org.eclipse.ocl.pivot.ids.TypeId.SET.getSpecializedId(org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.CLSSid_EnforcementOperation); public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull CollectionTypeId SET_CLSSid_Mapping = org.eclipse.ocl.pivot.ids.TypeId.SET.getSpecializedId(org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables.CLSSid_Mapping); diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/VariableAssignment.java b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/VariableAssignment.java index 8ce2e3d41..af0f02382 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/VariableAssignment.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/VariableAssignment.java @@ -14,6 +14,8 @@ */ package org.eclipse.qvtd.pivot.qvtcore; +import java.util.Map; +import org.eclipse.emf.common.util.DiagnosticChain; import org.eclipse.ocl.pivot.Variable; /** @@ -61,4 +63,13 @@ public interface VariableAssignment extends Assignment { */ void setTargetVariable(Variable value); + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model annotation="http://www.eclipse.org/uml2/2.0.0/UML originalName='CompatibleTypeForValue'" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='/**\n *\n * inv CompatibleTypeForValue:\n * let\n * severity : Integer[1] = \'VariableAssignment::CompatibleTypeForValue\'.getSeverity()\n * in\n * if severity <= 0\n * then true\n * else\n * let\n * status : OclAny[?] = targetVariable.type.conformsTo(value.type) or\n * value.type.conformsTo(targetVariable.type)\n * in\n * let\n * message : String[?] = if status <> true\n * then \'VariableAssignment::CompatibleTypeForValue: \' + value.type.name + \' must conform to \' + targetVariable.type.name + \' or vice-versa\'\n * else null\n * endif\n * in\n * \'VariableAssignment::CompatibleTypeForValue\'.logDiagnostic(self, null, diagnostics, context, message, severity, status, 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.qvtcore.QVTcoreTables%>.STR_VariableAssignment_c_c_CompatibleTypeForValue);\nfinal /*@NonInvalid\052/ boolean le = <%org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation%>.INSTANCE.evaluate(executor, severity_0, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.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_status;\n\ttry {\n\t\t/*@Caught\052/ @<%org.eclipse.jdt.annotation.NonNull%> <%java.lang.Object%> CAUGHT_conformsTo;\n\t\ttry {\n\t\t\t@SuppressWarnings(\"null\")\n\t\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> Variable targetVariable = this.getTargetVariable();\n\t\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.Nullable%> Type type = targetVariable.getType();\n\t\t\t@SuppressWarnings(\"null\")\n\t\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> OCLExpression value = this.getValue();\n\t\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.Nullable%> Type type_0 = value.getType();\n\t\t\tfinal /*@Thrown\052/ boolean conformsTo = <%org.eclipse.ocl.pivot.library.classifier.OclTypeConformsToOperation%>.INSTANCE.evaluate(executor, type, type_0).booleanValue();\n\t\t\tCAUGHT_conformsTo = conformsTo;\n\t\t}\n\t\tcatch (<%java.lang.Exception%> e) {\n\t\t\tCAUGHT_conformsTo = <%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_conformsTo_0;\n\t\ttry {\n\t\t\t@SuppressWarnings(\"null\")\n\t\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> OCLExpression value_0 = this.getValue();\n\t\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.Nullable%> Type type_1 = value_0.getType();\n\t\t\t@SuppressWarnings(\"null\")\n\t\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> Variable targetVariable_0 = this.getTargetVariable();\n\t\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.Nullable%> Type type_2 = targetVariable_0.getType();\n\t\t\tfinal /*@Thrown\052/ boolean conformsTo_0 = <%org.eclipse.ocl.pivot.library.classifier.OclTypeConformsToOperation%>.INSTANCE.evaluate(executor, type_1, type_2).booleanValue();\n\t\t\tCAUGHT_conformsTo_0 = conformsTo_0;\n\t\t}\n\t\tcatch (<%java.lang.Exception%> e) {\n\t\t\tCAUGHT_conformsTo_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 status = <%org.eclipse.ocl.pivot.library.logical.BooleanOrOperation%>.INSTANCE.evaluate(CAUGHT_conformsTo, CAUGHT_conformsTo_0);\n\t\tCAUGHT_status = status;\n\t}\n\tcatch (<%java.lang.Exception%> e) {\n\t\tCAUGHT_status = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.createInvalidValue(e);\n\t}\n\tif (CAUGHT_status instanceof <%org.eclipse.ocl.pivot.values.InvalidValueException%>) {\n\t\tthrow (<%org.eclipse.ocl.pivot.values.InvalidValueException%>)CAUGHT_status;\n\t}\n\tfinal /*@Thrown\052/ boolean ne = CAUGHT_status == Boolean.FALSE;\n\t/*@NonInvalid\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> String message_0;\n\tif (ne) {\n\t\t@SuppressWarnings(\"null\")\n\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> OCLExpression value_1 = this.getValue();\n\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.Nullable%> Type type_3 = value_1.getType();\n\t\tif (type_3 == null) {\n\t\t\tthrow new <%org.eclipse.ocl.pivot.values.InvalidValueException%>(\"Null source for \\\'NamedElement::name\\\'\");\n\t\t}\n\t\tfinal /*@Thrown\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> String name = type_3.getName();\n\t\tfinal /*@NonInvalid\052/ java.lang.@<%org.eclipse.jdt.annotation.NonNull%> String sum = <%org.eclipse.ocl.pivot.library.string.StringConcatOperation%>.INSTANCE.evaluate(<%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.STR_VariableAssignment_c_c_CompatibleTypeForValue_c_32, name);\n\t\tfinal /*@NonInvalid\052/ java.lang.@<%org.eclipse.jdt.annotation.NonNull%> String sum_0 = <%org.eclipse.ocl.pivot.library.string.StringConcatOperation%>.INSTANCE.evaluate(sum, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.STR__32_must_32_conform_32_to_32);\n\t\t@SuppressWarnings(\"null\")\n\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> Variable targetVariable_1 = this.getTargetVariable();\n\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.Nullable%> Type type_4 = targetVariable_1.getType();\n\t\tif (type_4 == null) {\n\t\t\tthrow new <%org.eclipse.ocl.pivot.values.InvalidValueException%>(\"Null source for \\\'NamedElement::name\\\'\");\n\t\t}\n\t\tfinal /*@Thrown\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> String name_0 = type_4.getName();\n\t\tfinal /*@NonInvalid\052/ java.lang.@<%org.eclipse.jdt.annotation.NonNull%> String sum_1 = <%org.eclipse.ocl.pivot.library.string.StringConcatOperation%>.INSTANCE.evaluate(sum_0, name_0);\n\t\tfinal /*@NonInvalid\052/ java.lang.@<%org.eclipse.jdt.annotation.NonNull%> String sum_2 = <%org.eclipse.ocl.pivot.library.string.StringConcatOperation%>.INSTANCE.evaluate(sum_1, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.STR__32_or_32_vice_m_versa);\n\t\tmessage_0 = sum_2;\n\t}\n\telse {\n\t\tmessage_0 = null;\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.qvtcore.QVTcoreTables%>.STR_VariableAssignment_c_c_CompatibleTypeForValue, this, (Object)null, diagnostics, context, message_0, severity_0, CAUGHT_status, <%org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables%>.INT_0).booleanValue();\n\tsymbol_0 = logDiagnostic;\n}\nreturn Boolean.TRUE == symbol_0;'" + * @generated + */ + boolean validateCompatibleTypeForValue(DiagnosticChain diagnostics, Map<Object, Object> context); + } // VariableAssignment diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/BottomPatternImpl.java b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/BottomPatternImpl.java index 766a96fb5..bed3e430e 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/BottomPatternImpl.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/BottomPatternImpl.java @@ -14,11 +14,15 @@ */ package org.eclipse.qvtd.pivot.qvtcore.impl; +import java.lang.reflect.InvocationTargetException; import java.util.Collection; +import java.util.Iterator; +import java.util.Map; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.DiagnosticChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; @@ -33,13 +37,25 @@ import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.ocl.pivot.Variable; +import org.eclipse.ocl.pivot.ids.TypeId; +import org.eclipse.ocl.pivot.internal.utilities.PivotUtilInternal; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsKindOfOperation; +import org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation; +import org.eclipse.ocl.pivot.library.string.CGStringGetSeverityOperation; +import org.eclipse.ocl.pivot.library.string.CGStringLogDiagnosticOperation; +import org.eclipse.ocl.pivot.messages.PivotMessages; import org.eclipse.ocl.pivot.util.Visitor; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; import org.eclipse.qvtd.pivot.qvtcore.Area; import org.eclipse.qvtd.pivot.qvtcore.Assignment; import org.eclipse.qvtd.pivot.qvtcore.BottomPattern; import org.eclipse.qvtd.pivot.qvtcore.EnforcementOperation; import org.eclipse.qvtd.pivot.qvtcore.QVTcorePackage; +import org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables; import org.eclipse.qvtd.pivot.qvtcore.RealizedVariable; import org.eclipse.qvtd.pivot.qvtcore.util.QVTcoreVisitor; @@ -197,6 +213,86 @@ public class BottomPatternImpl extends CorePatternImpl implements BottomPattern * <!-- end-user-doc --> * @generated */ + @Override + public boolean validateVariablesAreBottomVariables(final DiagnosticChain diagnostics, final Map<Object, Object> context) { + /** + * + * inv VariablesAreBottomVariables: + * let + * severity : Integer[1] = 'BottomPattern::VariablesAreBottomVariables'.getSeverity() + * in + * if severity <= 0 + * then true + * else + * let + * status : OclAny[?] = variable->forAll( + * oclIsKindOf(BottomVariable)) + * in + * 'BottomPattern::VariablesAreBottomVariables'.logDiagnostic(self, null, diagnostics, context, null, severity, status, 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, QVTcoreTables.STR_BottomPattern_c_c_VariablesAreBottomVariables); + final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, QVTcoreTables.INT_0).booleanValue(); + /*@NonInvalid*/ boolean symbol_0; + if (le) { + symbol_0 = ValueUtil.TRUE_VALUE; + } + else { + /*@Caught*/ @NonNull Object CAUGHT_status; + try { + @SuppressWarnings("null") + final /*@Thrown*/ java.util.@NonNull List<Variable> variable = this.getVariable(); + final /*@Thrown*/ org.eclipse.ocl.pivot.values.@NonNull SetValue BOXED_variable = idResolver.createSetOfAll(QVTcoreTables.SET_CLSSid_Variable, variable); + /*@Thrown*/ java.lang.@Nullable Object accumulator = ValueUtil.TRUE_VALUE; + @NonNull Iterator<Object> ITERATOR__1 = BOXED_variable.iterator(); + /*@Thrown*/ boolean status; + while (true) { + if (!ITERATOR__1.hasNext()) { + if (accumulator == ValueUtil.TRUE_VALUE) { + status = ValueUtil.TRUE_VALUE; + } + else { + throw (InvalidValueException)accumulator; + } + break; + } + @SuppressWarnings("null") + /*@NonInvalid*/ org.eclipse.ocl.pivot.@NonNull Variable _1 = (Variable)ITERATOR__1.next(); + /** + * oclIsKindOf(BottomVariable) + */ + final /*@NonInvalid*/ org.eclipse.ocl.pivot.@NonNull Class TYP_qvtcore_c_c_BottomVariable = idResolver.getClass(QVTcoreTables.CLSSid_BottomVariable, null); + final /*@NonInvalid*/ boolean oclIsKindOf = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, _1, TYP_qvtcore_c_c_BottomVariable).booleanValue(); + // + if (oclIsKindOf == ValueUtil.FALSE_VALUE) { // Normal unsuccessful body evaluation result + status = ValueUtil.FALSE_VALUE; + break; // Stop immediately + } + else if (oclIsKindOf == ValueUtil.TRUE_VALUE) { // Normal successful body evaluation result + ; // Carry on + } + else { // Impossible badly typed result + accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "forAll"); + } + } + CAUGHT_status = status; + } + catch (Exception e) { + CAUGHT_status = ValueUtil.createInvalidValue(e); + } + final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, QVTcoreTables.STR_BottomPattern_c_c_VariablesAreBottomVariables, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_status, QVTcoreTables.INT_0).booleanValue(); + symbol_0 = logDiagnostic; + } + return Boolean.TRUE == symbol_0; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ @SuppressWarnings("unchecked") @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { @@ -340,6 +436,21 @@ public class BottomPatternImpl extends CorePatternImpl implements BottomPattern } /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + @SuppressWarnings("unchecked") + public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException { + switch (operationID) { + case QVTcorePackage.BOTTOM_PATTERN___VALIDATE_VARIABLES_ARE_BOTTOM_VARIABLES__DIAGNOSTICCHAIN_MAP: + return validateVariablesAreBottomVariables((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); + } + return super.eInvoke(operationID, arguments); + } + + /** * {@inheritDoc} * @generated */ diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/GuardPatternImpl.java b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/GuardPatternImpl.java index 0a0ea251b..a54244a5c 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/GuardPatternImpl.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/GuardPatternImpl.java @@ -14,9 +14,14 @@ */ package org.eclipse.qvtd.pivot.qvtcore.impl; +import java.lang.reflect.InvocationTargetException; +import java.util.Iterator; +import java.util.Map; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.DiagnosticChain; +import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; @@ -26,12 +31,24 @@ import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.ocl.pivot.Variable; +import org.eclipse.ocl.pivot.ids.TypeId; +import org.eclipse.ocl.pivot.internal.utilities.PivotUtilInternal; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsKindOfOperation; +import org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation; +import org.eclipse.ocl.pivot.library.string.CGStringGetSeverityOperation; +import org.eclipse.ocl.pivot.library.string.CGStringLogDiagnosticOperation; +import org.eclipse.ocl.pivot.messages.PivotMessages; import org.eclipse.ocl.pivot.util.Visitor; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; import org.eclipse.qvtd.pivot.qvtcore.Area; import org.eclipse.qvtd.pivot.qvtcore.GuardPattern; import org.eclipse.qvtd.pivot.qvtcore.QVTcorePackage; +import org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables; import org.eclipse.qvtd.pivot.qvtcore.util.QVTcoreVisitor; /** @@ -116,6 +133,86 @@ public class GuardPatternImpl extends CorePatternImpl implements GuardPattern { * @generated */ @Override + public boolean validateVariablesAreGuardVariables(final DiagnosticChain diagnostics, final Map<Object, Object> context) { + /** + * + * inv VariablesAreGuardVariables: + * let + * severity : Integer[1] = 'GuardPattern::VariablesAreGuardVariables'.getSeverity() + * in + * if severity <= 0 + * then true + * else + * let + * status : OclAny[?] = variable->forAll( + * oclIsKindOf(GuardVariable)) + * in + * 'GuardPattern::VariablesAreGuardVariables'.logDiagnostic(self, null, diagnostics, context, null, severity, status, 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, QVTcoreTables.STR_GuardPattern_c_c_VariablesAreGuardVariables); + final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, QVTcoreTables.INT_0).booleanValue(); + /*@NonInvalid*/ boolean symbol_0; + if (le) { + symbol_0 = ValueUtil.TRUE_VALUE; + } + else { + /*@Caught*/ @NonNull Object CAUGHT_status; + try { + @SuppressWarnings("null") + final /*@Thrown*/ java.util.@NonNull List<Variable> variable = this.getVariable(); + final /*@Thrown*/ org.eclipse.ocl.pivot.values.@NonNull SetValue BOXED_variable = idResolver.createSetOfAll(QVTcoreTables.SET_CLSSid_Variable, variable); + /*@Thrown*/ java.lang.@Nullable Object accumulator = ValueUtil.TRUE_VALUE; + @NonNull Iterator<Object> ITERATOR__1 = BOXED_variable.iterator(); + /*@Thrown*/ boolean status; + while (true) { + if (!ITERATOR__1.hasNext()) { + if (accumulator == ValueUtil.TRUE_VALUE) { + status = ValueUtil.TRUE_VALUE; + } + else { + throw (InvalidValueException)accumulator; + } + break; + } + @SuppressWarnings("null") + /*@NonInvalid*/ org.eclipse.ocl.pivot.@NonNull Variable _1 = (Variable)ITERATOR__1.next(); + /** + * oclIsKindOf(GuardVariable) + */ + final /*@NonInvalid*/ org.eclipse.ocl.pivot.@NonNull Class TYP_qvtcore_c_c_GuardVariable = idResolver.getClass(QVTcoreTables.CLSSid_GuardVariable, null); + final /*@NonInvalid*/ boolean oclIsKindOf = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, _1, TYP_qvtcore_c_c_GuardVariable).booleanValue(); + // + if (oclIsKindOf == ValueUtil.FALSE_VALUE) { // Normal unsuccessful body evaluation result + status = ValueUtil.FALSE_VALUE; + break; // Stop immediately + } + else if (oclIsKindOf == ValueUtil.TRUE_VALUE) { // Normal successful body evaluation result + ; // Carry on + } + else { // Impossible badly typed result + accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "forAll"); + } + } + CAUGHT_status = status; + } + catch (Exception e) { + CAUGHT_status = ValueUtil.createInvalidValue(e); + } + final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, QVTcoreTables.STR_GuardPattern_c_c_VariablesAreGuardVariables, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_status, QVTcoreTables.INT_0).booleanValue(); + symbol_0 = logDiagnostic; + } + return Boolean.TRUE == symbol_0; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case QVTcorePackage.GUARD_PATTERN__AREA: @@ -213,6 +310,21 @@ public class GuardPatternImpl extends CorePatternImpl implements GuardPattern { } /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + @SuppressWarnings("unchecked") + public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException { + switch (operationID) { + case QVTcorePackage.GUARD_PATTERN___VALIDATE_VARIABLES_ARE_GUARD_VARIABLES__DIAGNOSTICCHAIN_MAP: + return validateVariablesAreGuardVariables((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); + } + return super.eInvoke(operationID, arguments); + } + + /** * {@inheritDoc} * @generated */ diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/MappingImpl.java b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/MappingImpl.java index 066e3ade7..7e8a42faa 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/MappingImpl.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/MappingImpl.java @@ -10,10 +10,14 @@ *******************************************************************************/ package org.eclipse.qvtd.pivot.qvtcore.impl; +import java.lang.reflect.InvocationTargetException; import java.util.Collection; +import java.util.Iterator; +import java.util.Map; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.DiagnosticChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; @@ -23,13 +27,26 @@ import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.ocl.pivot.ids.TypeId; +import org.eclipse.ocl.pivot.internal.utilities.PivotUtilInternal; +import org.eclipse.ocl.pivot.library.logical.BooleanImpliesOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsKindOfOperation; +import org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation; +import org.eclipse.ocl.pivot.library.string.CGStringGetSeverityOperation; +import org.eclipse.ocl.pivot.library.string.CGStringLogDiagnosticOperation; +import org.eclipse.ocl.pivot.messages.PivotMessages; import org.eclipse.ocl.pivot.util.Visitor; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.qvtd.pivot.qvtbase.Domain; import org.eclipse.qvtd.pivot.qvtbase.impl.RuleImpl; import org.eclipse.qvtd.pivot.qvtcore.Area; import org.eclipse.qvtd.pivot.qvtcore.BottomPattern; import org.eclipse.qvtd.pivot.qvtcore.GuardPattern; import org.eclipse.qvtd.pivot.qvtcore.Mapping; import org.eclipse.qvtd.pivot.qvtcore.QVTcorePackage; +import org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables; import org.eclipse.qvtd.pivot.qvtcore.util.QVTcoreVisitor; /** @@ -229,6 +246,204 @@ public class MappingImpl extends RuleImpl implements Mapping { * @generated */ @Override + public boolean validateDomainsAreCoreDomains(final DiagnosticChain diagnostics, final Map<Object, Object> context) { + /** + * + * inv DomainsAreCoreDomains: + * let severity : Integer[1] = 'Mapping::DomainsAreCoreDomains'.getSeverity() + * in + * if severity <= 0 + * then true + * else + * let + * status : OclAny[?] = domain->forAll(oclIsKindOf(CoreDomain)) + * in + * 'Mapping::DomainsAreCoreDomains'.logDiagnostic(self, null, diagnostics, context, null, severity, status, 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, QVTcoreTables.STR_Mapping_c_c_DomainsAreCoreDomains); + final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, QVTcoreTables.INT_0).booleanValue(); + /*@NonInvalid*/ boolean symbol_0; + if (le) { + symbol_0 = ValueUtil.TRUE_VALUE; + } + else { + /*@Caught*/ @NonNull Object CAUGHT_status; + try { + @SuppressWarnings("null") + final /*@Thrown*/ java.util.@NonNull List<Domain> domain = this.getDomain(); + final /*@Thrown*/ org.eclipse.ocl.pivot.values.@NonNull OrderedSetValue BOXED_domain = idResolver.createOrderedSetOfAll(QVTcoreTables.ORD_CLSSid_Domain, domain); + /*@Thrown*/ java.lang.@Nullable Object accumulator = ValueUtil.TRUE_VALUE; + @NonNull Iterator<Object> ITERATOR__1 = BOXED_domain.iterator(); + /*@Thrown*/ boolean status; + while (true) { + if (!ITERATOR__1.hasNext()) { + if (accumulator == ValueUtil.TRUE_VALUE) { + status = ValueUtil.TRUE_VALUE; + } + else { + throw (InvalidValueException)accumulator; + } + break; + } + @SuppressWarnings("null") + /*@NonInvalid*/ org.eclipse.qvtd.pivot.qvtbase.@NonNull Domain _1 = (Domain)ITERATOR__1.next(); + /** + * oclIsKindOf(CoreDomain) + */ + final /*@NonInvalid*/ org.eclipse.ocl.pivot.@NonNull Class TYP_qvtcore_c_c_CoreDomain = idResolver.getClass(QVTcoreTables.CLSSid_CoreDomain, null); + final /*@NonInvalid*/ boolean oclIsKindOf = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, _1, TYP_qvtcore_c_c_CoreDomain).booleanValue(); + // + if (oclIsKindOf == ValueUtil.FALSE_VALUE) { // Normal unsuccessful body evaluation result + status = ValueUtil.FALSE_VALUE; + break; // Stop immediately + } + else if (oclIsKindOf == ValueUtil.TRUE_VALUE) { // Normal successful body evaluation result + ; // Carry on + } + else { // Impossible badly typed result + accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "forAll"); + } + } + CAUGHT_status = status; + } + catch (Exception e) { + CAUGHT_status = ValueUtil.createInvalidValue(e); + } + final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, QVTcoreTables.STR_Mapping_c_c_DomainsAreCoreDomains, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_status, QVTcoreTables.INT_0).booleanValue(); + symbol_0 = logDiagnostic; + } + return Boolean.TRUE == symbol_0; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean validateNestedNameIsNull(final DiagnosticChain diagnostics, final Map<Object, Object> context) { + /** + * + * inv NestedNameIsNull: + * let severity : Integer[1] = 'Mapping::NestedNameIsNull'.getSeverity() + * in + * if severity <= 0 + * then true + * else + * let status : OclAny[?] = transformation = null implies name = null + * in + * 'Mapping::NestedNameIsNull'.logDiagnostic(self, null, diagnostics, context, null, severity, status, 0) + * endif + */ + final /*@NonInvalid*/ org.eclipse.ocl.pivot.evaluation.@NonNull Executor executor = PivotUtilInternal.getExecutor(this); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.values.@NonNull IntegerValue severity_0 = CGStringGetSeverityOperation.INSTANCE.evaluate(executor, QVTcoreTables.STR_Mapping_c_c_NestedNameIsNull); + final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, QVTcoreTables.INT_0).booleanValue(); + /*@NonInvalid*/ boolean symbol_0; + if (le) { + symbol_0 = ValueUtil.TRUE_VALUE; + } + else { + /*@Caught*/ @Nullable Object CAUGHT_status; + try { + /*@Caught*/ @NonNull Object CAUGHT_eq; + try { + final /*@Thrown*/ org.eclipse.qvtd.pivot.qvtbase.@Nullable Transformation transformation = this.getTransformation(); + final /*@Thrown*/ boolean eq = transformation == null; + CAUGHT_eq = eq; + } + catch (Exception e) { + CAUGHT_eq = ValueUtil.createInvalidValue(e); + } + /*@Caught*/ @NonNull Object CAUGHT_eq_0; + try { + final /*@Thrown*/ java.lang.@Nullable String name = this.getName(); + final /*@Thrown*/ boolean eq_0 = name == null; + CAUGHT_eq_0 = eq_0; + } + catch (Exception e) { + CAUGHT_eq_0 = ValueUtil.createInvalidValue(e); + } + final /*@Thrown*/ java.lang.@Nullable Boolean status = BooleanImpliesOperation.INSTANCE.evaluate(CAUGHT_eq, CAUGHT_eq_0); + CAUGHT_status = status; + } + catch (Exception e) { + CAUGHT_status = ValueUtil.createInvalidValue(e); + } + final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, QVTcoreTables.STR_Mapping_c_c_NestedNameIsNull, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_status, QVTcoreTables.INT_0).booleanValue(); + symbol_0 = logDiagnostic; + } + return Boolean.TRUE == symbol_0; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean validateRootNameIsNotNull(final DiagnosticChain diagnostics, final Map<Object, Object> context) { + /** + * + * inv RootNameIsNotNull: + * let severity : Integer[1] = 'Mapping::RootNameIsNotNull'.getSeverity() + * in + * if severity <= 0 + * then true + * else + * let status : OclAny[?] = transformation <> null implies name <> null + * in + * 'Mapping::RootNameIsNotNull'.logDiagnostic(self, null, diagnostics, context, null, severity, status, 0) + * endif + */ + final /*@NonInvalid*/ org.eclipse.ocl.pivot.evaluation.@NonNull Executor executor = PivotUtilInternal.getExecutor(this); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.values.@NonNull IntegerValue severity_0 = CGStringGetSeverityOperation.INSTANCE.evaluate(executor, QVTcoreTables.STR_Mapping_c_c_RootNameIsNotNull); + final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, QVTcoreTables.INT_0).booleanValue(); + /*@NonInvalid*/ boolean symbol_0; + if (le) { + symbol_0 = ValueUtil.TRUE_VALUE; + } + else { + /*@Caught*/ @Nullable Object CAUGHT_status; + try { + /*@Caught*/ @NonNull Object CAUGHT_ne; + try { + final /*@Thrown*/ org.eclipse.qvtd.pivot.qvtbase.@Nullable Transformation transformation = this.getTransformation(); + final /*@Thrown*/ boolean ne = transformation != null; + CAUGHT_ne = ne; + } + catch (Exception e) { + CAUGHT_ne = ValueUtil.createInvalidValue(e); + } + /*@Caught*/ @NonNull Object CAUGHT_ne_0; + try { + final /*@Thrown*/ java.lang.@Nullable String name = this.getName(); + final /*@Thrown*/ boolean ne_0 = name != null; + CAUGHT_ne_0 = ne_0; + } + catch (Exception e) { + CAUGHT_ne_0 = ValueUtil.createInvalidValue(e); + } + final /*@Thrown*/ java.lang.@Nullable Boolean status = BooleanImpliesOperation.INSTANCE.evaluate(CAUGHT_ne, CAUGHT_ne_0); + CAUGHT_status = status; + } + catch (Exception e) { + CAUGHT_status = ValueUtil.createInvalidValue(e); + } + final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, QVTcoreTables.STR_Mapping_c_c_RootNameIsNotNull, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_status, QVTcoreTables.INT_0).booleanValue(); + symbol_0 = logDiagnostic; + } + return Boolean.TRUE == symbol_0; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override public EList<Mapping> getLocal() { if (local == null) { local = new EObjectContainmentWithInverseEList<Mapping>(Mapping.class, this, QVTcorePackage.MAPPING__LOCAL, QVTcorePackage.MAPPING__CONTEXT); @@ -512,6 +727,25 @@ public class MappingImpl extends RuleImpl implements Mapping { * <!-- end-user-doc --> * @generated */ + @Override + @SuppressWarnings("unchecked") + public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException { + switch (operationID) { + case QVTcorePackage.MAPPING___VALIDATE_DOMAINS_ARE_CORE_DOMAINS__DIAGNOSTICCHAIN_MAP: + return validateDomainsAreCoreDomains((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); + case QVTcorePackage.MAPPING___VALIDATE_NESTED_NAME_IS_NULL__DIAGNOSTICCHAIN_MAP: + return validateNestedNameIsNull((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); + case QVTcorePackage.MAPPING___VALIDATE_ROOT_NAME_IS_NOT_NULL__DIAGNOSTICCHAIN_MAP: + return validateRootNameIsNotNull((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); + } + return super.eInvoke(operationID, arguments); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ @SuppressWarnings("unchecked") @Override public <R> R accept(@NonNull Visitor<R> visitor) { diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/OppositePropertyAssignmentImpl.java b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/OppositePropertyAssignmentImpl.java index 515fa0bfd..728eb01ab 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/OppositePropertyAssignmentImpl.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/OppositePropertyAssignmentImpl.java @@ -33,9 +33,11 @@ import org.eclipse.ocl.pivot.Property; import org.eclipse.ocl.pivot.ids.TypeId; import org.eclipse.ocl.pivot.internal.utilities.PivotUtilInternal; import org.eclipse.ocl.pivot.library.classifier.OclTypeConformsToOperation; +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; +import org.eclipse.ocl.pivot.library.string.StringConcatOperation; import org.eclipse.ocl.pivot.util.Visitor; import org.eclipse.ocl.pivot.utilities.ValueUtil; @@ -154,6 +156,140 @@ public class OppositePropertyAssignmentImpl extends NavigationAssignmentImpl imp * @generated */ @Override + public boolean validateCompatibleTypeForValue(final DiagnosticChain diagnostics, final Map<Object, Object> context) { + /** + * + * inv CompatibleTypeForValue: + * let + * severity : Integer[1] = 'OppositePropertyAssignment::CompatibleTypeForValue'.getSeverity() + * in + * if severity <= 0 + * then true + * else + * let + * status : OclAny[?] = let + * propertyType : Type[?] = getReferredTargetProperty().type + * in + * let valueType : Type[?] = value.type + * in + * valueType.conformsTo(propertyType) or + * propertyType.conformsTo(valueType) + * in + * let + * message : String[?] = if status <> true + * then 'OppositePropertyAssignment::CompatibleTypeForValue: ' + value.type.name + ' must conform to ' + + * getReferredTargetProperty().type.name + ' or vice-versa' + * else null + * endif + * in + * 'OppositePropertyAssignment::CompatibleTypeForValue'.logDiagnostic(self, null, diagnostics, context, message, severity, status, 0) + * endif + */ + final /*@NonInvalid*/ org.eclipse.ocl.pivot.evaluation.@NonNull Executor executor = PivotUtilInternal.getExecutor(this); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.values.@NonNull IntegerValue severity_0 = CGStringGetSeverityOperation.INSTANCE.evaluate(executor, QVTcoreTables.STR_OppositePropertyAssignment_c_c_CompatibleTypeForValue); + final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, QVTcoreTables.INT_0).booleanValue(); + /*@NonInvalid*/ boolean symbol_0; + if (le) { + symbol_0 = ValueUtil.TRUE_VALUE; + } + else { + /*@Caught*/ @Nullable Object CAUGHT_or; + try { + /*@Caught*/ @Nullable Object CAUGHT_propertyType; + try { + @SuppressWarnings("null") + final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull Property getReferredTargetProperty = this.getReferredTargetProperty(); + final /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Type propertyType = getReferredTargetProperty.getType(); + CAUGHT_propertyType = propertyType; + } + catch (Exception e) { + CAUGHT_propertyType = ValueUtil.createInvalidValue(e); + } + /*@Caught*/ @Nullable Object CAUGHT_valueType; + try { + @SuppressWarnings("null") + final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull OCLExpression value = this.getValue(); + final /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Type valueType = value.getType(); + CAUGHT_valueType = valueType; + } + catch (Exception e) { + CAUGHT_valueType = ValueUtil.createInvalidValue(e); + } + /*@Caught*/ @NonNull Object CAUGHT_conformsTo; + try { + if (CAUGHT_valueType instanceof InvalidValueException) { + throw (InvalidValueException)CAUGHT_valueType; + } + if (CAUGHT_propertyType instanceof InvalidValueException) { + throw (InvalidValueException)CAUGHT_propertyType; + } + final /*@Thrown*/ boolean conformsTo = OclTypeConformsToOperation.INSTANCE.evaluate(executor, CAUGHT_valueType, CAUGHT_propertyType).booleanValue(); + CAUGHT_conformsTo = conformsTo; + } + catch (Exception e) { + CAUGHT_conformsTo = ValueUtil.createInvalidValue(e); + } + /*@Caught*/ @NonNull Object CAUGHT_conformsTo_0; + try { + if (CAUGHT_propertyType instanceof InvalidValueException) { + throw (InvalidValueException)CAUGHT_propertyType; + } + if (CAUGHT_valueType instanceof InvalidValueException) { + throw (InvalidValueException)CAUGHT_valueType; + } + final /*@Thrown*/ boolean conformsTo_0 = OclTypeConformsToOperation.INSTANCE.evaluate(executor, CAUGHT_propertyType, CAUGHT_valueType).booleanValue(); + CAUGHT_conformsTo_0 = conformsTo_0; + } + catch (Exception e) { + CAUGHT_conformsTo_0 = ValueUtil.createInvalidValue(e); + } + final /*@Thrown*/ java.lang.@Nullable Boolean or = BooleanOrOperation.INSTANCE.evaluate(CAUGHT_conformsTo, CAUGHT_conformsTo_0); + CAUGHT_or = or; + } + catch (Exception e) { + CAUGHT_or = ValueUtil.createInvalidValue(e); + } + if (CAUGHT_or instanceof InvalidValueException) { + throw (InvalidValueException)CAUGHT_or; + } + final /*@Thrown*/ boolean ne = CAUGHT_or == Boolean.FALSE; + /*@NonInvalid*/ java.lang.@Nullable String message_0; + if (ne) { + @SuppressWarnings("null") + final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull OCLExpression value_0 = this.getValue(); + final /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Type type = value_0.getType(); + if (type == null) { + throw new InvalidValueException("Null source for \'NamedElement::name\'"); + } + final /*@Thrown*/ java.lang.@Nullable String name = type.getName(); + final /*@NonInvalid*/ java.lang.@NonNull String sum = StringConcatOperation.INSTANCE.evaluate(QVTcoreTables.STR_OppositePropertyAssignment_c_c_CompatibleTypeForValue_c_32, name); + final /*@NonInvalid*/ java.lang.@NonNull String sum_0 = StringConcatOperation.INSTANCE.evaluate(sum, QVTcoreTables.STR__32_must_32_conform_32_to_32); + @SuppressWarnings("null") + final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull Property getReferredTargetProperty_0 = this.getReferredTargetProperty(); + final /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Type type_0 = getReferredTargetProperty_0.getType(); + if (type_0 == null) { + throw new InvalidValueException("Null source for \'NamedElement::name\'"); + } + final /*@Thrown*/ java.lang.@Nullable String name_0 = type_0.getName(); + final /*@NonInvalid*/ java.lang.@NonNull String sum_1 = StringConcatOperation.INSTANCE.evaluate(sum_0, name_0); + final /*@NonInvalid*/ java.lang.@NonNull String sum_2 = StringConcatOperation.INSTANCE.evaluate(sum_1, QVTcoreTables.STR__32_or_32_vice_m_versa); + message_0 = sum_2; + } + else { + message_0 = null; + } + final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, QVTcoreTables.STR_OppositePropertyAssignment_c_c_CompatibleTypeForValue, this, (Object)null, diagnostics, context, message_0, severity_0, CAUGHT_or, QVTcoreTables.INT_0).booleanValue(); + symbol_0 = logDiagnostic; + } + return Boolean.TRUE == symbol_0; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override public boolean validateOppositePropertyIsImplicit(final DiagnosticChain diagnostics, final Map<Object, Object> context) { /** * @@ -314,6 +450,8 @@ public class OppositePropertyAssignmentImpl extends NavigationAssignmentImpl imp switch (operationID) { case QVTcorePackage.OPPOSITE_PROPERTY_ASSIGNMENT___GET_REFERRED_TARGET_PROPERTY: return getReferredTargetProperty(); + case QVTcorePackage.OPPOSITE_PROPERTY_ASSIGNMENT___VALIDATE_COMPATIBLE_TYPE_FOR_VALUE__DIAGNOSTICCHAIN_MAP: + return validateCompatibleTypeForValue((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); case QVTcorePackage.OPPOSITE_PROPERTY_ASSIGNMENT___VALIDATE_OPPOSITE_PROPERTY_IS_IMPLICIT__DIAGNOSTICCHAIN_MAP: return validateOppositePropertyIsImplicit((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); case QVTcorePackage.OPPOSITE_PROPERTY_ASSIGNMENT___VALIDATE_TARGET_PROPETY_IS_SLOT_PROPERTY__DIAGNOSTICCHAIN_MAP: diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/PropertyAssignmentImpl.java b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/PropertyAssignmentImpl.java index 73b761047..a7606780b 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/PropertyAssignmentImpl.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/PropertyAssignmentImpl.java @@ -34,12 +34,15 @@ import org.eclipse.ocl.pivot.ids.TypeId; import org.eclipse.ocl.pivot.internal.utilities.PivotUtilInternal; import org.eclipse.ocl.pivot.library.classifier.OclTypeConformsToOperation; 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; +import org.eclipse.ocl.pivot.library.string.StringConcatOperation; import org.eclipse.ocl.pivot.util.Visitor; import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; import org.eclipse.qvtd.pivot.qvtcore.PropertyAssignment; import org.eclipse.qvtd.pivot.qvtcore.QVTcorePackage; @@ -150,6 +153,140 @@ public class PropertyAssignmentImpl extends NavigationAssignmentImpl implements * @generated */ @Override + public boolean validateCompatibleTypeForValue(final DiagnosticChain diagnostics, final Map<Object, Object> context) { + /** + * + * inv CompatibleTypeForValue: + * let + * severity : Integer[1] = 'PropertyAssignment::CompatibleTypeForValue'.getSeverity() + * in + * if severity <= 0 + * then true + * else + * let + * status : OclAny[?] = let + * propertyType : Type[?] = getReferredTargetProperty().type + * in + * let valueType : Type[?] = value.type + * in + * valueType.conformsTo(propertyType) or + * propertyType.conformsTo(valueType) + * in + * let + * message : String[?] = if status <> true + * then 'PropertyAssignment::CompatibleTypeForValue: ' + value.type.name + ' must conform to ' + + * getReferredTargetProperty().type.name + ' or vice-versa' + * else null + * endif + * in + * 'PropertyAssignment::CompatibleTypeForValue'.logDiagnostic(self, null, diagnostics, context, message, severity, status, 0) + * endif + */ + final /*@NonInvalid*/ org.eclipse.ocl.pivot.evaluation.@NonNull Executor executor = PivotUtilInternal.getExecutor(this); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.values.@NonNull IntegerValue severity_0 = CGStringGetSeverityOperation.INSTANCE.evaluate(executor, QVTcoreTables.STR_PropertyAssignment_c_c_CompatibleTypeForValue); + final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, QVTcoreTables.INT_0).booleanValue(); + /*@NonInvalid*/ boolean symbol_0; + if (le) { + symbol_0 = ValueUtil.TRUE_VALUE; + } + else { + /*@Caught*/ @Nullable Object CAUGHT_or; + try { + /*@Caught*/ @Nullable Object CAUGHT_propertyType; + try { + @SuppressWarnings("null") + final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull Property getReferredTargetProperty = this.getReferredTargetProperty(); + final /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Type propertyType = getReferredTargetProperty.getType(); + CAUGHT_propertyType = propertyType; + } + catch (Exception e) { + CAUGHT_propertyType = ValueUtil.createInvalidValue(e); + } + /*@Caught*/ @Nullable Object CAUGHT_valueType; + try { + @SuppressWarnings("null") + final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull OCLExpression value = this.getValue(); + final /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Type valueType = value.getType(); + CAUGHT_valueType = valueType; + } + catch (Exception e) { + CAUGHT_valueType = ValueUtil.createInvalidValue(e); + } + /*@Caught*/ @NonNull Object CAUGHT_conformsTo; + try { + if (CAUGHT_valueType instanceof InvalidValueException) { + throw (InvalidValueException)CAUGHT_valueType; + } + if (CAUGHT_propertyType instanceof InvalidValueException) { + throw (InvalidValueException)CAUGHT_propertyType; + } + final /*@Thrown*/ boolean conformsTo = OclTypeConformsToOperation.INSTANCE.evaluate(executor, CAUGHT_valueType, CAUGHT_propertyType).booleanValue(); + CAUGHT_conformsTo = conformsTo; + } + catch (Exception e) { + CAUGHT_conformsTo = ValueUtil.createInvalidValue(e); + } + /*@Caught*/ @NonNull Object CAUGHT_conformsTo_0; + try { + if (CAUGHT_propertyType instanceof InvalidValueException) { + throw (InvalidValueException)CAUGHT_propertyType; + } + if (CAUGHT_valueType instanceof InvalidValueException) { + throw (InvalidValueException)CAUGHT_valueType; + } + final /*@Thrown*/ boolean conformsTo_0 = OclTypeConformsToOperation.INSTANCE.evaluate(executor, CAUGHT_propertyType, CAUGHT_valueType).booleanValue(); + CAUGHT_conformsTo_0 = conformsTo_0; + } + catch (Exception e) { + CAUGHT_conformsTo_0 = ValueUtil.createInvalidValue(e); + } + final /*@Thrown*/ java.lang.@Nullable Boolean or = BooleanOrOperation.INSTANCE.evaluate(CAUGHT_conformsTo, CAUGHT_conformsTo_0); + CAUGHT_or = or; + } + catch (Exception e) { + CAUGHT_or = ValueUtil.createInvalidValue(e); + } + if (CAUGHT_or instanceof InvalidValueException) { + throw (InvalidValueException)CAUGHT_or; + } + final /*@Thrown*/ boolean ne = CAUGHT_or == Boolean.FALSE; + /*@NonInvalid*/ java.lang.@Nullable String message_0; + if (ne) { + @SuppressWarnings("null") + final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull OCLExpression value_0 = this.getValue(); + final /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Type type = value_0.getType(); + if (type == null) { + throw new InvalidValueException("Null source for \'NamedElement::name\'"); + } + final /*@Thrown*/ java.lang.@Nullable String name = type.getName(); + final /*@NonInvalid*/ java.lang.@NonNull String sum = StringConcatOperation.INSTANCE.evaluate(QVTcoreTables.STR_PropertyAssignment_c_c_CompatibleTypeForValue_c_32, name); + final /*@NonInvalid*/ java.lang.@NonNull String sum_0 = StringConcatOperation.INSTANCE.evaluate(sum, QVTcoreTables.STR__32_must_32_conform_32_to_32); + @SuppressWarnings("null") + final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull Property getReferredTargetProperty_0 = this.getReferredTargetProperty(); + final /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Type type_0 = getReferredTargetProperty_0.getType(); + if (type_0 == null) { + throw new InvalidValueException("Null source for \'NamedElement::name\'"); + } + final /*@Thrown*/ java.lang.@Nullable String name_0 = type_0.getName(); + final /*@NonInvalid*/ java.lang.@NonNull String sum_1 = StringConcatOperation.INSTANCE.evaluate(sum_0, name_0); + final /*@NonInvalid*/ java.lang.@NonNull String sum_2 = StringConcatOperation.INSTANCE.evaluate(sum_1, QVTcoreTables.STR__32_or_32_vice_m_versa); + message_0 = sum_2; + } + else { + message_0 = null; + } + final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, QVTcoreTables.STR_PropertyAssignment_c_c_CompatibleTypeForValue, this, (Object)null, diagnostics, context, message_0, severity_0, CAUGHT_or, QVTcoreTables.INT_0).booleanValue(); + symbol_0 = logDiagnostic; + } + return Boolean.TRUE == symbol_0; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override public boolean validatePropertyIsNotImplicit(final DiagnosticChain diagnostics, final Map<Object, Object> context) { /** * @@ -318,6 +455,8 @@ public class PropertyAssignmentImpl extends NavigationAssignmentImpl implements switch (operationID) { case QVTcorePackage.PROPERTY_ASSIGNMENT___GET_REFERRED_TARGET_PROPERTY: return getReferredTargetProperty(); + case QVTcorePackage.PROPERTY_ASSIGNMENT___VALIDATE_COMPATIBLE_TYPE_FOR_VALUE__DIAGNOSTICCHAIN_MAP: + return validateCompatibleTypeForValue((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); case QVTcorePackage.PROPERTY_ASSIGNMENT___VALIDATE_PROPERTY_IS_NOT_IMPLICIT__DIAGNOSTICCHAIN_MAP: return validatePropertyIsNotImplicit((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); case QVTcorePackage.PROPERTY_ASSIGNMENT___VALIDATE_TARGET_PROPETY_IS_SLOT_PROPERTY__DIAGNOSTICCHAIN_MAP: diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/QVTcorePackageImpl.java b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/QVTcorePackageImpl.java index b274f1878..1520b66e5 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/QVTcorePackageImpl.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/QVTcorePackageImpl.java @@ -181,7 +181,7 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { /** * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. - * + * * <p>This method is used to initialize {@link QVTcorePackage#eINSTANCE} when that field is accessed. * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. * <!-- begin-user-doc --> @@ -211,17 +211,18 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { // Register package validator EValidator.Registry.INSTANCE.put - (theQVTcorePackage, - new EValidator.Descriptor() { - public EValidator getEValidator() { - return QVTcoreValidator.INSTANCE; - } - }); + (theQVTcorePackage, + new EValidator.Descriptor() { + @Override + public EValidator getEValidator() { + return QVTcoreValidator.INSTANCE; + } + }); // Mark meta-data to indicate it can't be changed theQVTcorePackage.freeze(); - + // Update the registry and return the package EPackage.Registry.INSTANCE.put(QVTcorePackage.eNS_URI, theQVTcorePackage); return theQVTcorePackage; @@ -353,6 +354,16 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { * @generated */ @Override + public EOperation getBottomPattern__ValidateVariablesAreBottomVariables__DiagnosticChain_Map() { + return bottomPatternEClass.getEOperations().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override public EClass getBottomVariable() { return bottomVariableEClass; } @@ -473,6 +484,16 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { * @generated */ @Override + public EOperation getGuardPattern__ValidateVariablesAreGuardVariables__DiagnosticChain_Map() { + return guardPatternEClass.getEOperations().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override public EClass getGuardVariable() { return guardVariableEClass; } @@ -513,6 +534,36 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { * @generated */ @Override + public EOperation getMapping__ValidateDomainsAreCoreDomains__DiagnosticChain_Map() { + return mappingEClass.getEOperations().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public EOperation getMapping__ValidateNestedNameIsNull__DiagnosticChain_Map() { + return mappingEClass.getEOperations().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public EOperation getMapping__ValidateRootNameIsNotNull__DiagnosticChain_Map() { + return mappingEClass.getEOperations().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override public EClass getNavigationAssignment() { return navigationAssignmentEClass; } @@ -563,7 +614,7 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { * @generated */ @Override - public EOperation getOppositePropertyAssignment__ValidateOppositePropertyIsImplicit__DiagnosticChain_Map() { + public EOperation getOppositePropertyAssignment__ValidateCompatibleTypeForValue__DiagnosticChain_Map() { return oppositePropertyAssignmentEClass.getEOperations().get(1); } @@ -573,7 +624,7 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { * @generated */ @Override - public EOperation getOppositePropertyAssignment__ValidateTargetPropetyIsSlotProperty__DiagnosticChain_Map() { + public EOperation getOppositePropertyAssignment__ValidateOppositePropertyIsImplicit__DiagnosticChain_Map() { return oppositePropertyAssignmentEClass.getEOperations().get(2); } @@ -583,6 +634,16 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { * @generated */ @Override + public EOperation getOppositePropertyAssignment__ValidateTargetPropetyIsSlotProperty__DiagnosticChain_Map() { + return oppositePropertyAssignmentEClass.getEOperations().get(3); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override public EClass getPropertyAssignment() { return propertyAssignmentEClass; } @@ -613,7 +674,7 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { * @generated */ @Override - public EOperation getPropertyAssignment__ValidatePropertyIsNotImplicit__DiagnosticChain_Map() { + public EOperation getPropertyAssignment__ValidateCompatibleTypeForValue__DiagnosticChain_Map() { return propertyAssignmentEClass.getEOperations().get(1); } @@ -623,7 +684,7 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { * @generated */ @Override - public EOperation getPropertyAssignment__ValidateTargetPropetyIsSlotProperty__DiagnosticChain_Map() { + public EOperation getPropertyAssignment__ValidatePropertyIsNotImplicit__DiagnosticChain_Map() { return propertyAssignmentEClass.getEOperations().get(2); } @@ -633,6 +694,16 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { * @generated */ @Override + public EOperation getPropertyAssignment__ValidateTargetPropetyIsSlotProperty__DiagnosticChain_Map() { + return propertyAssignmentEClass.getEOperations().get(3); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override public EClass getRealizedVariable() { return realizedVariableEClass; } @@ -663,6 +734,16 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { * @generated */ @Override + public EOperation getVariableAssignment__ValidateCompatibleTypeForValue__DiagnosticChain_Map() { + return variableAssignmentEClass.getEOperations().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override public EEnum getEnforcementMode() { return enforcementModeEEnum; } @@ -730,6 +811,7 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { createEReference(bottomPatternEClass, BOTTOM_PATTERN__ASSIGNMENT); createEReference(bottomPatternEClass, BOTTOM_PATTERN__ENFORCEMENT_OPERATION); createEReference(bottomPatternEClass, BOTTOM_PATTERN__REALIZED_VARIABLE); + createEOperation(bottomPatternEClass, BOTTOM_PATTERN___VALIDATE_VARIABLES_ARE_BOTTOM_VARIABLES__DIAGNOSTICCHAIN_MAP); bottomVariableEClass = createEClass(BOTTOM_VARIABLE); @@ -748,6 +830,7 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { guardPatternEClass = createEClass(GUARD_PATTERN); createEReference(guardPatternEClass, GUARD_PATTERN__AREA); + createEOperation(guardPatternEClass, GUARD_PATTERN___VALIDATE_VARIABLES_ARE_GUARD_VARIABLES__DIAGNOSTICCHAIN_MAP); guardVariableEClass = createEClass(GUARD_VARIABLE); @@ -756,6 +839,9 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { createEReference(mappingEClass, MAPPING__LOCAL); createEReference(mappingEClass, MAPPING__REFINEMENT); createEReference(mappingEClass, MAPPING__SPECIFICATION); + createEOperation(mappingEClass, MAPPING___VALIDATE_DOMAINS_ARE_CORE_DOMAINS__DIAGNOSTICCHAIN_MAP); + createEOperation(mappingEClass, MAPPING___VALIDATE_NESTED_NAME_IS_NULL__DIAGNOSTICCHAIN_MAP); + createEOperation(mappingEClass, MAPPING___VALIDATE_ROOT_NAME_IS_NOT_NULL__DIAGNOSTICCHAIN_MAP); navigationAssignmentEClass = createEClass(NAVIGATION_ASSIGNMENT); createEReference(navigationAssignmentEClass, NAVIGATION_ASSIGNMENT__SLOT_EXPRESSION); @@ -763,12 +849,14 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { oppositePropertyAssignmentEClass = createEClass(OPPOSITE_PROPERTY_ASSIGNMENT); createEReference(oppositePropertyAssignmentEClass, OPPOSITE_PROPERTY_ASSIGNMENT__TARGET_PROPERTY); createEOperation(oppositePropertyAssignmentEClass, OPPOSITE_PROPERTY_ASSIGNMENT___GET_REFERRED_TARGET_PROPERTY); + createEOperation(oppositePropertyAssignmentEClass, OPPOSITE_PROPERTY_ASSIGNMENT___VALIDATE_COMPATIBLE_TYPE_FOR_VALUE__DIAGNOSTICCHAIN_MAP); createEOperation(oppositePropertyAssignmentEClass, OPPOSITE_PROPERTY_ASSIGNMENT___VALIDATE_OPPOSITE_PROPERTY_IS_IMPLICIT__DIAGNOSTICCHAIN_MAP); createEOperation(oppositePropertyAssignmentEClass, OPPOSITE_PROPERTY_ASSIGNMENT___VALIDATE_TARGET_PROPETY_IS_SLOT_PROPERTY__DIAGNOSTICCHAIN_MAP); propertyAssignmentEClass = createEClass(PROPERTY_ASSIGNMENT); createEReference(propertyAssignmentEClass, PROPERTY_ASSIGNMENT__TARGET_PROPERTY); createEOperation(propertyAssignmentEClass, PROPERTY_ASSIGNMENT___GET_REFERRED_TARGET_PROPERTY); + createEOperation(propertyAssignmentEClass, PROPERTY_ASSIGNMENT___VALIDATE_COMPATIBLE_TYPE_FOR_VALUE__DIAGNOSTICCHAIN_MAP); createEOperation(propertyAssignmentEClass, PROPERTY_ASSIGNMENT___VALIDATE_PROPERTY_IS_NOT_IMPLICIT__DIAGNOSTICCHAIN_MAP); createEOperation(propertyAssignmentEClass, PROPERTY_ASSIGNMENT___VALIDATE_TARGET_PROPETY_IS_SLOT_PROPERTY__DIAGNOSTICCHAIN_MAP); @@ -776,6 +864,7 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { variableAssignmentEClass = createEClass(VARIABLE_ASSIGNMENT); createEReference(variableAssignmentEClass, VARIABLE_ASSIGNMENT__TARGET_VARIABLE); + createEOperation(variableAssignmentEClass, VARIABLE_ASSIGNMENT___VALIDATE_COMPATIBLE_TYPE_FOR_VALUE__DIAGNOSTICCHAIN_MAP); // Create enums enforcementModeEEnum = createEEnum(ENFORCEMENT_MODE); @@ -848,6 +937,15 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { initEReference(getBottomPattern_EnforcementOperation(), this.getEnforcementOperation(), this.getEnforcementOperation_BottomPattern(), "enforcementOperation", null, 0, -1, BottomPattern.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); initEReference(getBottomPattern_RealizedVariable(), this.getRealizedVariable(), null, "realizedVariable", null, 0, -1, BottomPattern.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + EOperation op = initEOperation(getBottomPattern__ValidateVariablesAreBottomVariables__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "validateVariablesAreBottomVariables", 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()); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(ecorePackage.getEJavaObject()); + g1.getETypeArguments().add(g2); + addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED); + initEClass(bottomVariableEClass, BottomVariable.class, "BottomVariable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(coreDomainEClass, CoreDomain.class, "CoreDomain", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -867,6 +965,15 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { initEClass(guardPatternEClass, GuardPattern.class, "GuardPattern", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getGuardPattern_Area(), this.getArea(), this.getArea_GuardPattern(), "area", null, 1, 1, GuardPattern.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + op = initEOperation(getGuardPattern__ValidateVariablesAreGuardVariables__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "validateVariablesAreGuardVariables", 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); + initEClass(guardVariableEClass, GuardVariable.class, "GuardVariable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(mappingEClass, Mapping.class, "Mapping", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -875,6 +982,33 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { initEReference(getMapping_Refinement(), this.getMapping(), this.getMapping_Specification(), "refinement", null, 0, -1, Mapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); initEReference(getMapping_Specification(), this.getMapping(), this.getMapping_Refinement(), "specification", null, 0, -1, Mapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + op = initEOperation(getMapping__ValidateDomainsAreCoreDomains__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "validateDomainsAreCoreDomains", 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(getMapping__ValidateNestedNameIsNull__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "validateNestedNameIsNull", 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(getMapping__ValidateRootNameIsNotNull__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "validateRootNameIsNotNull", 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); + initEClass(navigationAssignmentEClass, NavigationAssignment.class, "NavigationAssignment", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getNavigationAssignment_SlotExpression(), thePivotPackage.getOCLExpression(), null, "slotExpression", null, 1, 1, NavigationAssignment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); @@ -883,10 +1017,19 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { initEOperation(getOppositePropertyAssignment__GetReferredTargetProperty(), thePivotPackage.getProperty(), "getReferredTargetProperty", 1, 1, IS_UNIQUE, IS_ORDERED); - EOperation op = initEOperation(getOppositePropertyAssignment__ValidateOppositePropertyIsImplicit__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "validateOppositePropertyIsImplicit", 0, 1, IS_UNIQUE, IS_ORDERED); + op = initEOperation(getOppositePropertyAssignment__ValidateCompatibleTypeForValue__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "validateCompatibleTypeForValue", 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()); + 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(getOppositePropertyAssignment__ValidateOppositePropertyIsImplicit__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "validateOppositePropertyIsImplicit", 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); @@ -906,6 +1049,15 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { initEOperation(getPropertyAssignment__GetReferredTargetProperty(), thePivotPackage.getProperty(), "getReferredTargetProperty", 1, 1, IS_UNIQUE, IS_ORDERED); + op = initEOperation(getPropertyAssignment__ValidateCompatibleTypeForValue__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "validateCompatibleTypeForValue", 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(getPropertyAssignment__ValidatePropertyIsNotImplicit__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "validatePropertyIsNotImplicit", 0, 1, IS_UNIQUE, IS_ORDERED); addEParameter(op, ecorePackage.getEDiagnosticChain(), "diagnostics", 0, 1, IS_UNIQUE, IS_ORDERED); g1 = createEGenericType(ecorePackage.getEMap()); @@ -929,6 +1081,15 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { initEClass(variableAssignmentEClass, VariableAssignment.class, "VariableAssignment", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getVariableAssignment_TargetVariable(), thePivotPackage.getVariable(), null, "targetVariable", null, 1, 1, VariableAssignment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + op = initEOperation(getVariableAssignment__ValidateCompatibleTypeForValue__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "validateCompatibleTypeForValue", 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); + // Initialize enums and add enum literals initEEnum(enforcementModeEEnum, EnforcementMode.class, "EnforcementMode"); addEEnumLiteral(enforcementModeEEnum, EnforcementMode.CREATION); @@ -953,12 +1114,12 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { * @generated */ protected void createEcoreAnnotations() { - String source = "http://www.eclipse.org/emf/2002/Ecore"; + String source = "http://www.eclipse.org/emf/2002/Ecore"; addAnnotation - (this, - source, - new String[] { - }); + (this, + source, + new String[] { + }); } /** @@ -968,37 +1129,37 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { * @generated */ protected void createEmofAnnotations() { - String source = "http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeRoleName"; + String source = "http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeRoleName"; addAnnotation - (getAssignment_Value(), - source, - new String[] { - "body", "valueAssignment" - }); + (getAssignment_Value(), + source, + new String[] { + "body", "valueAssignment" + }); addAnnotation - (getNavigationAssignment_SlotExpression(), - source, - new String[] { - "body", "slotAssignment" - }); + (getNavigationAssignment_SlotExpression(), + source, + new String[] { + "body", "slotAssignment" + }); addAnnotation - (getOppositePropertyAssignment_TargetProperty(), - source, - new String[] { - "body", "assignment" - }); + (getOppositePropertyAssignment_TargetProperty(), + source, + new String[] { + "body", "assignment" + }); addAnnotation - (getPropertyAssignment_TargetProperty(), - source, - new String[] { - "body", "assignment" - }); + (getPropertyAssignment_TargetProperty(), + source, + new String[] { + "body", "assignment" + }); addAnnotation - (getVariableAssignment_TargetVariable(), - source, - new String[] { - "body", "assignment" - }); + (getVariableAssignment_TargetVariable(), + source, + new String[] { + "body", "assignment" + }); } /** @@ -1008,31 +1169,79 @@ public class QVTcorePackageImpl extends EPackageImpl implements QVTcorePackage { * @generated */ protected void createUMLAnnotations() { - String source = "http://www.eclipse.org/uml2/2.0.0/UML"; + String source = "http://www.eclipse.org/uml2/2.0.0/UML"; + addAnnotation + (getBottomPattern__ValidateVariablesAreBottomVariables__DiagnosticChain_Map(), + source, + new String[] { + "originalName", "VariablesAreBottomVariables" + }); + addAnnotation + (getGuardPattern__ValidateVariablesAreGuardVariables__DiagnosticChain_Map(), + source, + new String[] { + "originalName", "VariablesAreGuardVariables" + }); + addAnnotation + (getMapping__ValidateDomainsAreCoreDomains__DiagnosticChain_Map(), + source, + new String[] { + "originalName", "DomainsAreCoreDomains" + }); + addAnnotation + (getMapping__ValidateNestedNameIsNull__DiagnosticChain_Map(), + source, + new String[] { + "originalName", "NestedNameIsNull" + }); + addAnnotation + (getMapping__ValidateRootNameIsNotNull__DiagnosticChain_Map(), + source, + new String[] { + "originalName", "RootNameIsNotNull" + }); + addAnnotation + (getOppositePropertyAssignment__ValidateCompatibleTypeForValue__DiagnosticChain_Map(), + source, + new String[] { + "originalName", "CompatibleTypeForValue" + }); + addAnnotation + (getOppositePropertyAssignment__ValidateOppositePropertyIsImplicit__DiagnosticChain_Map(), + source, + new String[] { + "originalName", "OppositePropertyIsImplicit" + }); + addAnnotation + (getOppositePropertyAssignment__ValidateTargetPropetyIsSlotProperty__DiagnosticChain_Map(), + source, + new String[] { + "originalName", "TargetPropetyIsSlotProperty" + }); addAnnotation - (getOppositePropertyAssignment__ValidateOppositePropertyIsImplicit__DiagnosticChain_Map(), - source, - new String[] { - "originalName", "OppositePropertyIsImplicit" - }); + (getPropertyAssignment__ValidateCompatibleTypeForValue__DiagnosticChain_Map(), + source, + new String[] { + "originalName", "CompatibleTypeForValue" + }); addAnnotation - (getOppositePropertyAssignment__ValidateTargetPropetyIsSlotProperty__DiagnosticChain_Map(), - source, - new String[] { - "originalName", "TargetPropetyIsSlotProperty" - }); + (getPropertyAssignment__ValidatePropertyIsNotImplicit__DiagnosticChain_Map(), + source, + new String[] { + "originalName", "PropertyIsNotImplicit" + }); addAnnotation - (getPropertyAssignment__ValidatePropertyIsNotImplicit__DiagnosticChain_Map(), - source, - new String[] { - "originalName", "PropertyIsNotImplicit" - }); + (getPropertyAssignment__ValidateTargetPropetyIsSlotProperty__DiagnosticChain_Map(), + source, + new String[] { + "originalName", "TargetPropetyIsSlotProperty" + }); addAnnotation - (getPropertyAssignment__ValidateTargetPropetyIsSlotProperty__DiagnosticChain_Map(), - source, - new String[] { - "originalName", "TargetPropetyIsSlotProperty" - }); + (getVariableAssignment__ValidateCompatibleTypeForValue__DiagnosticChain_Map(), + source, + new String[] { + "originalName", "CompatibleTypeForValue" + }); } } //QVTcorePackageImpl diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/VariableAssignmentImpl.java b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/VariableAssignmentImpl.java index ca52c9f50..cd53ae43a 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/VariableAssignmentImpl.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/impl/VariableAssignmentImpl.java @@ -14,8 +14,12 @@ */ package org.eclipse.qvtd.pivot.qvtcore.impl; +import java.lang.reflect.InvocationTargetException; +import java.util.Map; import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.DiagnosticChain; +import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; @@ -23,11 +27,23 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.ocl.pivot.Variable; +import org.eclipse.ocl.pivot.ids.TypeId; +import org.eclipse.ocl.pivot.internal.utilities.PivotUtilInternal; +import org.eclipse.ocl.pivot.library.classifier.OclTypeConformsToOperation; +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; +import org.eclipse.ocl.pivot.library.string.StringConcatOperation; import org.eclipse.ocl.pivot.util.Visitor; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; import org.eclipse.qvtd.pivot.qvtcore.QVTcorePackage; +import org.eclipse.qvtd.pivot.qvtcore.QVTcoreTables; import org.eclipse.qvtd.pivot.qvtcore.VariableAssignment; import org.eclipse.qvtd.pivot.qvtcore.util.QVTcoreVisitor; @@ -121,6 +137,114 @@ public class VariableAssignmentImpl extends AssignmentImpl implements VariableAs * @generated */ @Override + public boolean validateCompatibleTypeForValue(final DiagnosticChain diagnostics, final Map<Object, Object> context) { + /** + * + * inv CompatibleTypeForValue: + * let + * severity : Integer[1] = 'VariableAssignment::CompatibleTypeForValue'.getSeverity() + * in + * if severity <= 0 + * then true + * else + * let + * status : OclAny[?] = targetVariable.type.conformsTo(value.type) or + * value.type.conformsTo(targetVariable.type) + * in + * let + * message : String[?] = if status <> true + * then 'VariableAssignment::CompatibleTypeForValue: ' + value.type.name + ' must conform to ' + targetVariable.type.name + ' or vice-versa' + * else null + * endif + * in + * 'VariableAssignment::CompatibleTypeForValue'.logDiagnostic(self, null, diagnostics, context, message, severity, status, 0) + * endif + */ + final /*@NonInvalid*/ org.eclipse.ocl.pivot.evaluation.@NonNull Executor executor = PivotUtilInternal.getExecutor(this); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.values.@NonNull IntegerValue severity_0 = CGStringGetSeverityOperation.INSTANCE.evaluate(executor, QVTcoreTables.STR_VariableAssignment_c_c_CompatibleTypeForValue); + final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, QVTcoreTables.INT_0).booleanValue(); + /*@NonInvalid*/ boolean symbol_0; + if (le) { + symbol_0 = ValueUtil.TRUE_VALUE; + } + else { + /*@Caught*/ @Nullable Object CAUGHT_status; + try { + /*@Caught*/ @NonNull Object CAUGHT_conformsTo; + try { + @SuppressWarnings("null") + final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull Variable targetVariable = this.getTargetVariable(); + final /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Type type = targetVariable.getType(); + @SuppressWarnings("null") + final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull OCLExpression value = this.getValue(); + final /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Type type_0 = value.getType(); + final /*@Thrown*/ boolean conformsTo = OclTypeConformsToOperation.INSTANCE.evaluate(executor, type, type_0).booleanValue(); + CAUGHT_conformsTo = conformsTo; + } + catch (Exception e) { + CAUGHT_conformsTo = ValueUtil.createInvalidValue(e); + } + /*@Caught*/ @NonNull Object CAUGHT_conformsTo_0; + try { + @SuppressWarnings("null") + final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull OCLExpression value_0 = this.getValue(); + final /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Type type_1 = value_0.getType(); + @SuppressWarnings("null") + final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull Variable targetVariable_0 = this.getTargetVariable(); + final /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Type type_2 = targetVariable_0.getType(); + final /*@Thrown*/ boolean conformsTo_0 = OclTypeConformsToOperation.INSTANCE.evaluate(executor, type_1, type_2).booleanValue(); + CAUGHT_conformsTo_0 = conformsTo_0; + } + catch (Exception e) { + CAUGHT_conformsTo_0 = ValueUtil.createInvalidValue(e); + } + final /*@Thrown*/ java.lang.@Nullable Boolean status = BooleanOrOperation.INSTANCE.evaluate(CAUGHT_conformsTo, CAUGHT_conformsTo_0); + CAUGHT_status = status; + } + catch (Exception e) { + CAUGHT_status = ValueUtil.createInvalidValue(e); + } + if (CAUGHT_status instanceof InvalidValueException) { + throw (InvalidValueException)CAUGHT_status; + } + final /*@Thrown*/ boolean ne = CAUGHT_status == Boolean.FALSE; + /*@NonInvalid*/ java.lang.@Nullable String message_0; + if (ne) { + @SuppressWarnings("null") + final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull OCLExpression value_1 = this.getValue(); + final /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Type type_3 = value_1.getType(); + if (type_3 == null) { + throw new InvalidValueException("Null source for \'NamedElement::name\'"); + } + final /*@Thrown*/ java.lang.@Nullable String name = type_3.getName(); + final /*@NonInvalid*/ java.lang.@NonNull String sum = StringConcatOperation.INSTANCE.evaluate(QVTcoreTables.STR_VariableAssignment_c_c_CompatibleTypeForValue_c_32, name); + final /*@NonInvalid*/ java.lang.@NonNull String sum_0 = StringConcatOperation.INSTANCE.evaluate(sum, QVTcoreTables.STR__32_must_32_conform_32_to_32); + @SuppressWarnings("null") + final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull Variable targetVariable_1 = this.getTargetVariable(); + final /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Type type_4 = targetVariable_1.getType(); + if (type_4 == null) { + throw new InvalidValueException("Null source for \'NamedElement::name\'"); + } + final /*@Thrown*/ java.lang.@Nullable String name_0 = type_4.getName(); + final /*@NonInvalid*/ java.lang.@NonNull String sum_1 = StringConcatOperation.INSTANCE.evaluate(sum_0, name_0); + final /*@NonInvalid*/ java.lang.@NonNull String sum_2 = StringConcatOperation.INSTANCE.evaluate(sum_1, QVTcoreTables.STR__32_or_32_vice_m_versa); + message_0 = sum_2; + } + else { + message_0 = null; + } + final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, QVTcoreTables.STR_VariableAssignment_c_c_CompatibleTypeForValue, this, (Object)null, diagnostics, context, message_0, severity_0, CAUGHT_status, QVTcoreTables.INT_0).booleanValue(); + symbol_0 = logDiagnostic; + } + return Boolean.TRUE == symbol_0; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case QVTcorePackage.VARIABLE_ASSIGNMENT__TARGET_VARIABLE: @@ -175,6 +299,21 @@ public class VariableAssignmentImpl extends AssignmentImpl implements VariableAs } /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + @SuppressWarnings("unchecked") + public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException { + switch (operationID) { + case QVTcorePackage.VARIABLE_ASSIGNMENT___VALIDATE_COMPATIBLE_TYPE_FOR_VALUE__DIAGNOSTICCHAIN_MAP: + return validateCompatibleTypeForValue((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); + } + return super.eInvoke(operationID, arguments); + } + + /** * {@inheritDoc} * @generated */ diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/util/QVTcoreValidator.java b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/util/QVTcoreValidator.java index 52bca1a65..f4012215f 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/util/QVTcoreValidator.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/util/QVTcoreValidator.java @@ -55,12 +55,60 @@ public class QVTcoreValidator extends EObjectValidator { public static final String DIAGNOSTIC_SOURCE = "org.eclipse.qvtd.pivot.qvtcore"; /** + * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Variables Are Bottom Variables' of 'Bottom Pattern'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final int BOTTOM_PATTERN__VALIDATE_VARIABLES_ARE_BOTTOM_VARIABLES = 1; + + /** + * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Variables Are Guard Variables' of 'Guard Pattern'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final int GUARD_PATTERN__VALIDATE_VARIABLES_ARE_GUARD_VARIABLES = 2; + + /** + * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Domains Are Core Domains' of 'Mapping'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final int MAPPING__VALIDATE_DOMAINS_ARE_CORE_DOMAINS = 3; + + /** + * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Nested Name Is Null' of 'Mapping'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final int MAPPING__VALIDATE_NESTED_NAME_IS_NULL = 4; + + /** + * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Root Name Is Not Null' of 'Mapping'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final int MAPPING__VALIDATE_ROOT_NAME_IS_NOT_NULL = 5; + + /** + * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Compatible Type For Value' of 'Opposite Property Assignment'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final int OPPOSITE_PROPERTY_ASSIGNMENT__VALIDATE_COMPATIBLE_TYPE_FOR_VALUE = 6; + + /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Opposite Property Is Implicit' of 'Opposite Property Assignment'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ - public static final int OPPOSITE_PROPERTY_ASSIGNMENT__VALIDATE_OPPOSITE_PROPERTY_IS_IMPLICIT = 1; + public static final int OPPOSITE_PROPERTY_ASSIGNMENT__VALIDATE_OPPOSITE_PROPERTY_IS_IMPLICIT = 7; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Target Propety Is Slot Property' of 'Opposite Property Assignment'. @@ -68,7 +116,15 @@ public class QVTcoreValidator extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int OPPOSITE_PROPERTY_ASSIGNMENT__VALIDATE_TARGET_PROPETY_IS_SLOT_PROPERTY = 2; + public static final int OPPOSITE_PROPERTY_ASSIGNMENT__VALIDATE_TARGET_PROPETY_IS_SLOT_PROPERTY = 8; + + /** + * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Compatible Type For Value' of 'Property Assignment'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final int PROPERTY_ASSIGNMENT__VALIDATE_COMPATIBLE_TYPE_FOR_VALUE = 9; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Property Is Not Implicit' of 'Property Assignment'. @@ -76,7 +132,7 @@ public class QVTcoreValidator extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int PROPERTY_ASSIGNMENT__VALIDATE_PROPERTY_IS_NOT_IMPLICIT = 3; + public static final int PROPERTY_ASSIGNMENT__VALIDATE_PROPERTY_IS_NOT_IMPLICIT = 10; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Target Propety Is Slot Property' of 'Property Assignment'. @@ -84,7 +140,15 @@ public class QVTcoreValidator extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int PROPERTY_ASSIGNMENT__VALIDATE_TARGET_PROPETY_IS_SLOT_PROPERTY = 4; + public static final int PROPERTY_ASSIGNMENT__VALIDATE_TARGET_PROPETY_IS_SLOT_PROPERTY = 11; + + /** + * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Compatible Type For Value' of 'Variable Assignment'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final int VARIABLE_ASSIGNMENT__VALIDATE_COMPATIBLE_TYPE_FOR_VALUE = 12; /** * A constant with a fixed name that can be used as the base value for additional hand written constants. @@ -92,7 +156,7 @@ public class QVTcoreValidator extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 4; + private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 12; /** * A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class. @@ -138,7 +202,7 @@ public class QVTcoreValidator extends EObjectValidator { */ @Override protected EPackage getEPackage() { - return QVTcorePackage.eINSTANCE; + return QVTcorePackage.eINSTANCE; } /** @@ -213,7 +277,27 @@ public class QVTcoreValidator extends EObjectValidator { * @generated */ public boolean validateBottomPattern(BottomPattern bottomPattern, DiagnosticChain diagnostics, Map<Object, Object> context) { - return validate_EveryDefaultConstraint(bottomPattern, diagnostics, context); + if (!validate_NoCircularContainment(bottomPattern, diagnostics, context)) return false; + boolean result = validate_EveryMultiplicityConforms(bottomPattern, diagnostics, context); + if (result || diagnostics != null) result &= validate_EveryDataValueConforms(bottomPattern, diagnostics, context); + if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(bottomPattern, diagnostics, context); + if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(bottomPattern, diagnostics, context); + if (result || diagnostics != null) result &= validate_EveryProxyResolves(bottomPattern, diagnostics, context); + if (result || diagnostics != null) result &= validate_UniqueID(bottomPattern, diagnostics, context); + if (result || diagnostics != null) result &= validate_EveryKeyUnique(bottomPattern, diagnostics, context); + if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(bottomPattern, diagnostics, context); + if (result || diagnostics != null) result &= validateBottomPattern_validateVariablesAreBottomVariables(bottomPattern, diagnostics, context); + return result; + } + + /** + * Validates the validateVariablesAreBottomVariables constraint of '<em>Bottom Pattern</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateBottomPattern_validateVariablesAreBottomVariables(BottomPattern bottomPattern, DiagnosticChain diagnostics, Map<Object, Object> context) { + return bottomPattern.validateVariablesAreBottomVariables(diagnostics, context); } /** @@ -291,7 +375,27 @@ public class QVTcoreValidator extends EObjectValidator { * @generated */ public boolean validateGuardPattern(GuardPattern guardPattern, DiagnosticChain diagnostics, Map<Object, Object> context) { - return validate_EveryDefaultConstraint(guardPattern, diagnostics, context); + if (!validate_NoCircularContainment(guardPattern, diagnostics, context)) return false; + boolean result = validate_EveryMultiplicityConforms(guardPattern, diagnostics, context); + if (result || diagnostics != null) result &= validate_EveryDataValueConforms(guardPattern, diagnostics, context); + if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(guardPattern, diagnostics, context); + if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(guardPattern, diagnostics, context); + if (result || diagnostics != null) result &= validate_EveryProxyResolves(guardPattern, diagnostics, context); + if (result || diagnostics != null) result &= validate_UniqueID(guardPattern, diagnostics, context); + if (result || diagnostics != null) result &= validate_EveryKeyUnique(guardPattern, diagnostics, context); + if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(guardPattern, diagnostics, context); + if (result || diagnostics != null) result &= validateGuardPattern_validateVariablesAreGuardVariables(guardPattern, diagnostics, context); + return result; + } + + /** + * Validates the validateVariablesAreGuardVariables constraint of '<em>Guard Pattern</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateGuardPattern_validateVariablesAreGuardVariables(GuardPattern guardPattern, DiagnosticChain diagnostics, Map<Object, Object> context) { + return guardPattern.validateVariablesAreGuardVariables(diagnostics, context); } /** @@ -334,10 +438,43 @@ public class QVTcoreValidator extends EObjectValidator { if (result || diagnostics != null) result &= qvTbaseValidator.validateRule_validateDomainNameIsUnique(mapping, diagnostics, context); if (result || diagnostics != null) result &= qvTbaseValidator.validateRule_validateOverridesRuleIsExtendedRule(mapping, diagnostics, context); if (result || diagnostics != null) result &= qvTbaseValidator.validateRule_validateOverridesRuleOverridesAllDomains(mapping, diagnostics, context); + if (result || diagnostics != null) result &= validateMapping_validateDomainsAreCoreDomains(mapping, diagnostics, context); + if (result || diagnostics != null) result &= validateMapping_validateNestedNameIsNull(mapping, diagnostics, context); + if (result || diagnostics != null) result &= validateMapping_validateRootNameIsNotNull(mapping, diagnostics, context); return result; } /** + * Validates the validateDomainsAreCoreDomains constraint of '<em>Mapping</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateMapping_validateDomainsAreCoreDomains(Mapping mapping, DiagnosticChain diagnostics, Map<Object, Object> context) { + return mapping.validateDomainsAreCoreDomains(diagnostics, context); + } + + /** + * Validates the validateNestedNameIsNull constraint of '<em>Mapping</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateMapping_validateNestedNameIsNull(Mapping mapping, DiagnosticChain diagnostics, Map<Object, Object> context) { + return mapping.validateNestedNameIsNull(diagnostics, context); + } + + /** + * Validates the validateRootNameIsNotNull constraint of '<em>Mapping</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateMapping_validateRootNameIsNotNull(Mapping mapping, DiagnosticChain diagnostics, Map<Object, Object> context) { + return mapping.validateRootNameIsNotNull(diagnostics, context); + } + + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated @@ -361,12 +498,23 @@ public class QVTcoreValidator extends EObjectValidator { if (result || diagnostics != null) result &= validate_UniqueID(oppositePropertyAssignment, diagnostics, context); if (result || diagnostics != null) result &= validate_EveryKeyUnique(oppositePropertyAssignment, diagnostics, context); if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(oppositePropertyAssignment, diagnostics, context); + if (result || diagnostics != null) result &= validateOppositePropertyAssignment_validateCompatibleTypeForValue(oppositePropertyAssignment, diagnostics, context); if (result || diagnostics != null) result &= validateOppositePropertyAssignment_validateOppositePropertyIsImplicit(oppositePropertyAssignment, diagnostics, context); if (result || diagnostics != null) result &= validateOppositePropertyAssignment_validateTargetPropetyIsSlotProperty(oppositePropertyAssignment, diagnostics, context); return result; } /** + * Validates the validateCompatibleTypeForValue constraint of '<em>Opposite Property Assignment</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateOppositePropertyAssignment_validateCompatibleTypeForValue(OppositePropertyAssignment oppositePropertyAssignment, DiagnosticChain diagnostics, Map<Object, Object> context) { + return oppositePropertyAssignment.validateCompatibleTypeForValue(diagnostics, context); + } + + /** * Validates the validateOppositePropertyIsImplicit constraint of '<em>Opposite Property Assignment</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -401,12 +549,23 @@ public class QVTcoreValidator extends EObjectValidator { if (result || diagnostics != null) result &= validate_UniqueID(propertyAssignment, diagnostics, context); if (result || diagnostics != null) result &= validate_EveryKeyUnique(propertyAssignment, diagnostics, context); if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(propertyAssignment, diagnostics, context); + if (result || diagnostics != null) result &= validatePropertyAssignment_validateCompatibleTypeForValue(propertyAssignment, diagnostics, context); if (result || diagnostics != null) result &= validatePropertyAssignment_validatePropertyIsNotImplicit(propertyAssignment, diagnostics, context); if (result || diagnostics != null) result &= validatePropertyAssignment_validateTargetPropetyIsSlotProperty(propertyAssignment, diagnostics, context); return result; } /** + * Validates the validateCompatibleTypeForValue constraint of '<em>Property Assignment</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validatePropertyAssignment_validateCompatibleTypeForValue(PropertyAssignment propertyAssignment, DiagnosticChain diagnostics, Map<Object, Object> context) { + return propertyAssignment.validateCompatibleTypeForValue(diagnostics, context); + } + + /** * Validates the validatePropertyIsNotImplicit constraint of '<em>Property Assignment</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -454,7 +613,27 @@ public class QVTcoreValidator extends EObjectValidator { * @generated */ public boolean validateVariableAssignment(VariableAssignment variableAssignment, DiagnosticChain diagnostics, Map<Object, Object> context) { - return validate_EveryDefaultConstraint(variableAssignment, diagnostics, context); + if (!validate_NoCircularContainment(variableAssignment, diagnostics, context)) return false; + boolean result = validate_EveryMultiplicityConforms(variableAssignment, diagnostics, context); + if (result || diagnostics != null) result &= validate_EveryDataValueConforms(variableAssignment, diagnostics, context); + if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(variableAssignment, diagnostics, context); + if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(variableAssignment, diagnostics, context); + if (result || diagnostics != null) result &= validate_EveryProxyResolves(variableAssignment, diagnostics, context); + if (result || diagnostics != null) result &= validate_UniqueID(variableAssignment, diagnostics, context); + if (result || diagnostics != null) result &= validate_EveryKeyUnique(variableAssignment, diagnostics, context); + if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(variableAssignment, diagnostics, context); + if (result || diagnostics != null) result &= validateVariableAssignment_validateCompatibleTypeForValue(variableAssignment, diagnostics, context); + return result; + } + + /** + * Validates the validateCompatibleTypeForValue constraint of '<em>Variable Assignment</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateVariableAssignment_validateCompatibleTypeForValue(VariableAssignment variableAssignment, DiagnosticChain diagnostics, Map<Object, Object> context) { + return variableAssignment.validateCompatibleTypeForValue(diagnostics, context); } /** diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcore/model/QVTcore.ecore b/plugins/org.eclipse.qvtd.pivot.qvtcore/model/QVTcore.ecore index 259aefcaa..4371a7ed0 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtcore/model/QVTcore.ecore +++ b/plugins/org.eclipse.qvtd.pivot.qvtcore/model/QVTcore.ecore @@ -34,6 +34,21 @@ </eClassifiers> <eClassifiers xsi:type="ecore:EClass" xmi:id="T-qvtcore-BottomPattern" name="BottomPattern" eSuperTypes="#T-qvtcore-CorePattern"> + <eOperations name="validateVariablesAreBottomVariables" 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="VariablesAreBottomVariables"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> + <details key="body" value="
	variable->forAll(oclIsKindOf(BottomVariable))

"/> + </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> <eStructuralFeatures xsi:type="ecore:EReference" xmi:id="F-qvtcore-BottomPattern-area" name="area" lowerBound="1" eType="#T-qvtcore-Area" transient="true" eOpposite="#F-qvtcore-Area-bottomPattern"/> <eStructuralFeatures xsi:type="ecore:EReference" xmi:id="F-qvtcore-BottomPattern-assignment" @@ -71,6 +86,21 @@ </eClassifiers> <eClassifiers xsi:type="ecore:EClass" xmi:id="T-qvtcore-GuardPattern" name="GuardPattern" eSuperTypes="#T-qvtcore-CorePattern"> + <eOperations name="validateVariablesAreGuardVariables" 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="VariablesAreGuardVariables"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> + <details key="body" value="
	variable->forAll(oclIsKindOf(GuardVariable))

"/> + </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> <eStructuralFeatures xsi:type="ecore:EReference" xmi:id="F-qvtcore-GuardPattern-area" name="area" lowerBound="1" eType="#T-qvtcore-Area" transient="true" eOpposite="#F-qvtcore-Area-guardPattern"/> </eClassifiers> @@ -78,6 +108,51 @@ eSuperTypes="../../org.eclipse.ocl.pivot/model/Pivot.ecore#T-pivot-Variable"/> <eClassifiers xsi:type="ecore:EClass" xmi:id="T-qvtcore-Mapping" name="Mapping" eSuperTypes="../../org.eclipse.qvtd.pivot.qvtbase/model/QVTbase.ecore#T-qvtbase-Rule #T-qvtcore-Area"> + <eOperations name="validateDomainsAreCoreDomains" 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="DomainsAreCoreDomains"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> + <details key="body" value="
	domain->forAll(oclIsKindOf(CoreDomain))

"/> + </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="validateNestedNameIsNull" 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="NestedNameIsNull"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> + <details key="body" value="
--	_context <> null implies name = null
	transformation = null implies name = null

"/> + </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="validateRootNameIsNotNull" 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="RootNameIsNotNull"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> + <details key="body" value="
	transformation <> null implies name <> null

"/> + </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> <eStructuralFeatures xsi:type="ecore:EReference" xmi:id="F-qvtcore-Mapping-context" name="context" eType="#T-qvtcore-Mapping" eOpposite="#F-qvtcore-Mapping-local"/> <eStructuralFeatures xsi:type="ecore:EReference" xmi:id="F-qvtcore-Mapping-local" @@ -104,15 +179,30 @@ name="OppositePropertyAssignment" eSuperTypes="#T-qvtcore-NavigationAssignment"> <eOperations name="getReferredTargetProperty" lowerBound="1" eType="ecore:EClass ../../org.eclipse.ocl.pivot/model/Pivot.ecore#T-pivot-Property"> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="body" value="targetProperty.opposite
"/> + <details key="body" value="targetProperty.opposite

"/> </eAnnotations> </eOperations> + <eOperations name="validateCompatibleTypeForValue" 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="CompatibleTypeForValue"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> + <details key="body" value="Tuple {
	message : String = 'OppositePropertyAssignment::CompatibleTypeForValue: ' + value.type.name + ' must conform to ' + getReferredTargetProperty().type.name + ' or vice-versa',
	status : Boolean = 
	let propertyType = getReferredTargetProperty().type in
	let valueType = value.type in
		valueType.conformsTo(propertyType)
		or propertyType.conformsTo(valueType)


}.status"/> + </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="validateOppositePropertyIsImplicit" 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="OppositePropertyIsImplicit"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="body" value="targetProperty.isImplicit
"/> + <details key="body" value="
	targetProperty.isImplicit
	
"/> </eAnnotations> <eParameters name="diagnostics" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDiagnosticChain"/> <eParameters name="context"> @@ -127,7 +217,7 @@ <details key="originalName" value="TargetPropetyIsSlotProperty"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="body" value="slotExpression.type.conformsTo(getReferredTargetProperty().owningClass)

"/> + <details key="body" value="
	slotExpression.type.conformsTo(getReferredTargetProperty().owningClass)

"/> </eAnnotations> <eParameters name="diagnostics" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDiagnosticChain"/> <eParameters name="context"> @@ -148,15 +238,30 @@ eSuperTypes="#T-qvtcore-NavigationAssignment"> <eOperations name="getReferredTargetProperty" lowerBound="1" eType="ecore:EClass ../../org.eclipse.ocl.pivot/model/Pivot.ecore#T-pivot-Property"> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="body" value="targetProperty
"/> + <details key="body" value="targetProperty

"/> </eAnnotations> </eOperations> + <eOperations name="validateCompatibleTypeForValue" 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="CompatibleTypeForValue"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> + <details key="body" value="Tuple {
	message : String = 'PropertyAssignment::CompatibleTypeForValue: ' + value.type.name + ' must conform to ' + getReferredTargetProperty().type.name + ' or vice-versa',
	status : Boolean = 
	let propertyType = getReferredTargetProperty().type in
	let valueType = value.type in
		valueType.conformsTo(propertyType)
		or propertyType.conformsTo(valueType)


}.status"/> + </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="validatePropertyIsNotImplicit" 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="PropertyIsNotImplicit"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="body" value="not targetProperty.isImplicit
"/> + <details key="body" value="
	not targetProperty.isImplicit

"/> </eAnnotations> <eParameters name="diagnostics" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDiagnosticChain"/> <eParameters name="context"> @@ -171,7 +276,7 @@ <details key="originalName" value="TargetPropetyIsSlotProperty"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="body" value="slotExpression.type.conformsTo(getReferredTargetProperty().owningClass)

"/> + <details key="body" value="
	slotExpression.type.conformsTo(getReferredTargetProperty().owningClass)

"/> </eAnnotations> <eParameters name="diagnostics" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDiagnosticChain"/> <eParameters name="context"> @@ -192,6 +297,21 @@ eSuperTypes="../../org.eclipse.ocl.pivot/model/Pivot.ecore#T-pivot-Variable"/> <eClassifiers xsi:type="ecore:EClass" xmi:id="T-qvtcore-VariableAssignment" name="VariableAssignment" eSuperTypes="#T-qvtcore-Assignment"> + <eOperations name="validateCompatibleTypeForValue" 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="CompatibleTypeForValue"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> + <details key="body" value="Tuple {
	message : String = 'VariableAssignment::CompatibleTypeForValue: ' + value.type.name + ' must conform to ' + targetVariable.type.name + ' or vice-versa',
	status : Boolean = 
	targetVariable.type.conformsTo(value.type)
	or value.type.conformsTo(targetVariable.type)


}.status"/> + </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> <eStructuralFeatures xsi:type="ecore:EReference" xmi:id="F-qvtcore-VariableAssignment-targetVariable" name="targetVariable" lowerBound="1" eType="ecore:EClass ../../org.eclipse.ocl.pivot/model/Pivot.ecore#T-pivot-Variable"> <eAnnotations source="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeRoleName"> diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcore/model/QVTcore.genmodel b/plugins/org.eclipse.qvtd.pivot.qvtcore/model/QVTcore.genmodel index 571ab1ed0..3934ae5b7 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtcore/model/QVTcore.genmodel +++ b/plugins/org.eclipse.qvtd.pivot.qvtcore/model/QVTcore.genmodel @@ -34,6 +34,10 @@ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTcore.ecore#F-qvtcore-BottomPattern-assignment"/> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTcore.ecore#F-qvtcore-BottomPattern-enforcementOperation"/> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTcore.ecore#F-qvtcore-BottomPattern-realizedVariable"/> + <genOperations ecoreOperation="QVTcore.ecore#//BottomPattern/validateVariablesAreBottomVariables"> + <genParameters ecoreParameter="QVTcore.ecore#//BottomPattern/validateVariablesAreBottomVariables/diagnostics"/> + <genParameters ecoreParameter="QVTcore.ecore#//BottomPattern/validateVariablesAreBottomVariables/context"/> + </genOperations> </genClasses> <genClasses ecoreClass="QVTcore.ecore#T-qvtcore-BottomVariable"/> <genClasses ecoreClass="QVTcore.ecore#T-qvtcore-CoreDomain"/> @@ -49,6 +53,10 @@ </genClasses> <genClasses ecoreClass="QVTcore.ecore#T-qvtcore-GuardPattern"> <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference QVTcore.ecore#F-qvtcore-GuardPattern-area"/> + <genOperations ecoreOperation="QVTcore.ecore#//GuardPattern/validateVariablesAreGuardVariables"> + <genParameters ecoreParameter="QVTcore.ecore#//GuardPattern/validateVariablesAreGuardVariables/diagnostics"/> + <genParameters ecoreParameter="QVTcore.ecore#//GuardPattern/validateVariablesAreGuardVariables/context"/> + </genOperations> </genClasses> <genClasses ecoreClass="QVTcore.ecore#T-qvtcore-GuardVariable"/> <genClasses ecoreClass="QVTcore.ecore#T-qvtcore-Mapping"> @@ -56,6 +64,18 @@ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTcore.ecore#F-qvtcore-Mapping-local"/> <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTcore.ecore#F-qvtcore-Mapping-refinement"/> <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTcore.ecore#F-qvtcore-Mapping-specification"/> + <genOperations ecoreOperation="QVTcore.ecore#//Mapping/validateDomainsAreCoreDomains"> + <genParameters ecoreParameter="QVTcore.ecore#//Mapping/validateDomainsAreCoreDomains/diagnostics"/> + <genParameters ecoreParameter="QVTcore.ecore#//Mapping/validateDomainsAreCoreDomains/context"/> + </genOperations> + <genOperations ecoreOperation="QVTcore.ecore#//Mapping/validateNestedNameIsNull"> + <genParameters ecoreParameter="QVTcore.ecore#//Mapping/validateNestedNameIsNull/diagnostics"/> + <genParameters ecoreParameter="QVTcore.ecore#//Mapping/validateNestedNameIsNull/context"/> + </genOperations> + <genOperations ecoreOperation="QVTcore.ecore#//Mapping/validateRootNameIsNotNull"> + <genParameters ecoreParameter="QVTcore.ecore#//Mapping/validateRootNameIsNotNull/diagnostics"/> + <genParameters ecoreParameter="QVTcore.ecore#//Mapping/validateRootNameIsNotNull/context"/> + </genOperations> </genClasses> <genClasses image="false" ecoreClass="QVTcore.ecore#T-qvtcore-NavigationAssignment"> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTcore.ecore#F-qvtcore-NavigationAssignment-slotExpression"/> @@ -63,6 +83,10 @@ <genClasses ecoreClass="QVTcore.ecore#T-qvtcore-OppositePropertyAssignment"> <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTcore.ecore#F-qvtcore-OppositePropertyAssignment-targetProperty"/> <genOperations ecoreOperation="QVTcore.ecore#//OppositePropertyAssignment/getReferredTargetProperty"/> + <genOperations ecoreOperation="QVTcore.ecore#//OppositePropertyAssignment/validateCompatibleTypeForValue"> + <genParameters ecoreParameter="QVTcore.ecore#//OppositePropertyAssignment/validateCompatibleTypeForValue/diagnostics"/> + <genParameters ecoreParameter="QVTcore.ecore#//OppositePropertyAssignment/validateCompatibleTypeForValue/context"/> + </genOperations> <genOperations ecoreOperation="QVTcore.ecore#//OppositePropertyAssignment/validateOppositePropertyIsImplicit"> <genParameters ecoreParameter="QVTcore.ecore#//OppositePropertyAssignment/validateOppositePropertyIsImplicit/diagnostics"/> <genParameters ecoreParameter="QVTcore.ecore#//OppositePropertyAssignment/validateOppositePropertyIsImplicit/context"/> @@ -75,6 +99,10 @@ <genClasses ecoreClass="QVTcore.ecore#T-qvtcore-PropertyAssignment"> <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTcore.ecore#F-qvtcore-PropertyAssignment-targetProperty"/> <genOperations ecoreOperation="QVTcore.ecore#//PropertyAssignment/getReferredTargetProperty"/> + <genOperations ecoreOperation="QVTcore.ecore#//PropertyAssignment/validateCompatibleTypeForValue"> + <genParameters ecoreParameter="QVTcore.ecore#//PropertyAssignment/validateCompatibleTypeForValue/diagnostics"/> + <genParameters ecoreParameter="QVTcore.ecore#//PropertyAssignment/validateCompatibleTypeForValue/context"/> + </genOperations> <genOperations ecoreOperation="QVTcore.ecore#//PropertyAssignment/validatePropertyIsNotImplicit"> <genParameters ecoreParameter="QVTcore.ecore#//PropertyAssignment/validatePropertyIsNotImplicit/diagnostics"/> <genParameters ecoreParameter="QVTcore.ecore#//PropertyAssignment/validatePropertyIsNotImplicit/context"/> @@ -87,6 +115,10 @@ <genClasses ecoreClass="QVTcore.ecore#T-qvtcore-RealizedVariable"/> <genClasses ecoreClass="QVTcore.ecore#T-qvtcore-VariableAssignment"> <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTcore.ecore#F-qvtcore-VariableAssignment-targetVariable"/> + <genOperations ecoreOperation="QVTcore.ecore#//VariableAssignment/validateCompatibleTypeForValue"> + <genParameters ecoreParameter="QVTcore.ecore#//VariableAssignment/validateCompatibleTypeForValue/diagnostics"/> + <genParameters ecoreParameter="QVTcore.ecore#//VariableAssignment/validateCompatibleTypeForValue/context"/> + </genOperations> </genClasses> </genPackages> </genmodel:GenModel> diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcore/model/QVTcore.ocl b/plugins/org.eclipse.qvtd.pivot.qvtcore/model/QVTcore.ocl index aaa8b189f..36072edba 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtcore/model/QVTcore.ocl +++ b/plugins/org.eclipse.qvtd.pivot.qvtcore/model/QVTcore.ocl @@ -2,18 +2,62 @@ import 'QVTcore.ecore' package qvtcore +context BottomPattern +inv VariablesAreBottomVariables: + variable->forAll(oclIsKindOf(BottomVariable)) + +context GuardPattern +inv VariablesAreGuardVariables: + variable->forAll(oclIsKindOf(GuardVariable)) + +context Mapping +inv DomainsAreCoreDomains: + domain->forAll(oclIsKindOf(CoreDomain)) + +inv NestedNameIsNull: +-- _context <> null implies name = null + transformation = null implies name = null + +inv RootNameIsNotNull: + transformation <> null implies name <> null + --context NavigationAssignment --def: getReferredTargetProperty() : pivot::Property[1] = invalid --inv TargetPropetyIsSlotProperty: slotExpression.type.conformsTo(getReferredTargetProperty().owningClass) context OppositePropertyAssignment def: getReferredTargetProperty() : pivot::Property[1] = targetProperty.opposite -inv OppositePropertyIsImplicit: targetProperty.isImplicit -inv TargetPropetyIsSlotProperty: slotExpression.type.conformsTo(getReferredTargetProperty().owningClass) + +inv CompatibleTypeForValue('OppositePropertyAssignment::CompatibleTypeForValue: ' + value.type.name + ' must conform to ' + getReferredTargetProperty().type.name + ' or vice-versa'): + let propertyType = getReferredTargetProperty().type in + let valueType = value.type in + valueType.conformsTo(propertyType) + or propertyType.conformsTo(valueType) + +inv OppositePropertyIsImplicit: + targetProperty.isImplicit + +inv TargetPropetyIsSlotProperty: + slotExpression.type.conformsTo(getReferredTargetProperty().owningClass) context PropertyAssignment def: getReferredTargetProperty() : pivot::Property[1] = targetProperty -inv PropertyIsNotImplicit: not targetProperty.isImplicit -inv TargetPropetyIsSlotProperty: slotExpression.type.conformsTo(getReferredTargetProperty().owningClass) + +inv CompatibleTypeForValue('PropertyAssignment::CompatibleTypeForValue: ' + value.type.name + ' must conform to ' + getReferredTargetProperty().type.name + ' or vice-versa'): + let propertyType = getReferredTargetProperty().type in + let valueType = value.type in + valueType.conformsTo(propertyType) + or propertyType.conformsTo(valueType) + +inv PropertyIsNotImplicit: + not targetProperty.isImplicit + +inv TargetPropetyIsSlotProperty: + slotExpression.type.conformsTo(getReferredTargetProperty().owningClass) + +context VariableAssignment +inv CompatibleTypeForValue('VariableAssignment::CompatibleTypeForValue: ' + value.type.name + ' must conform to ' + targetVariable.type.name + ' or vice-versa'): + targetVariable.type.conformsTo(value.type) + or value.type.conformsTo(targetVariable.type) endpackage diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcore/src/org/eclipse/qvtd/pivot/qvtcore/utilities/QVTcoreHelper.java b/plugins/org.eclipse.qvtd.pivot.qvtcore/src/org/eclipse/qvtd/pivot/qvtcore/utilities/QVTcoreHelper.java index b43b9d10c..2bfebe606 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtcore/src/org/eclipse/qvtd/pivot/qvtcore/utilities/QVTcoreHelper.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtcore/src/org/eclipse/qvtd/pivot/qvtcore/utilities/QVTcoreHelper.java @@ -48,11 +48,12 @@ public class QVTcoreHelper extends QVTbaseHelper return asVariable; } - public @NonNull GuardVariable createGuardVariable(@NonNull String name, @NonNull Type asType, boolean isRequired) { + public @NonNull GuardVariable createGuardVariable(@NonNull String name, @NonNull Type asType, boolean isRequired, @Nullable OCLExpression asInitExpression) { GuardVariable asVariable = QVTcoreFactory.eINSTANCE.createGuardVariable(); asVariable.setName(name); asVariable.setType(asType); asVariable.setIsRequired(isRequired); + asVariable.setOwnedInit(asInitExpression); return asVariable; } diff --git a/tests/org.eclipse.qvtd.xtext.qvtcore.tests/src/org/eclipse/qvtd/xtext/qvtcore/tests/Class2RDBMS/Class2RDBMS.qvtc b/tests/org.eclipse.qvtd.xtext.qvtcore.tests/src/org/eclipse/qvtd/xtext/qvtcore/tests/Class2RDBMS/Class2RDBMS.qvtc index 49cdf2c24..1722dc087 100644 --- a/tests/org.eclipse.qvtd.xtext.qvtcore.tests/src/org/eclipse/qvtd/xtext/qvtcore/tests/Class2RDBMS/Class2RDBMS.qvtc +++ b/tests/org.eclipse.qvtd.xtext.qvtcore.tests/src/org/eclipse/qvtd/xtext/qvtcore/tests/Class2RDBMS/Class2RDBMS.qvtc @@ -161,7 +161,7 @@ map classToTable in umlRdbms { pk.kind := 'primary'; pc.owner := t; pc.key->includes(pk); - default pc.key := Set(Key){pk}; + default pc.key := OrderedSet(Key){pk}; default pc.type := 'NUMBER'; } where () { @@ -210,7 +210,7 @@ map associationToForeignKey in umlRdbms refines flattening { fc.owner := st; fk.refersTo := rk; fc.foreignKeys->includes(fk); - default fc.foreignKeys := Set(ForeignKey){fk}; + default fc.foreignKeys := OrderedSet(ForeignKey){fk}; } where (p2s:PackageToSchema, sc2t:ClassToTable, dc2t:ClassToTable | sc2t.owner = p2s; diff --git a/tests/org.eclipse.qvtd.xtext.qvtcore.tests/src/org/eclipse/qvtd/xtext/qvtcore/tests/platformResource/org.eclipse.ocl.xtext.base/model/BaseCS2AS.qvtp.qvtc b/tests/org.eclipse.qvtd.xtext.qvtcore.tests/src/org/eclipse/qvtd/xtext/qvtcore/tests/platformResource/org.eclipse.ocl.xtext.base/model/BaseCS2AS.qvtp.qvtc index 225998845..e258467e8 100644 --- a/tests/org.eclipse.qvtd.xtext.qvtcore.tests/src/org/eclipse/qvtd/xtext/qvtcore/tests/platformResource/org.eclipse.ocl.xtext.base/model/BaseCS2AS.qvtp.qvtc +++ b/tests/org.eclipse.qvtd.xtext.qvtcore.tests/src/org/eclipse/qvtd/xtext/qvtcore/tests/platformResource/org.eclipse.ocl.xtext.base/model/BaseCS2AS.qvtp.qvtc @@ -320,7 +320,7 @@ map uAnnotationCS_2_Annotation_ownedDetails in BaseCS2AS_qvtp_qvtcas where() {
annotationCS.pivot.oclAsType(pivot::Annotation).ownedDetails :=
- annotationCS.ownedDetails.pivot.oclAsType(pivot::Detail);
+ annotationCS.ownedDetails.pivot.oclAsType(pivot::Detail)->asOrderedSet();
}
}
map uAnnotationCS_2_Annotation_ownedContents in BaseCS2AS_qvtp_qvtcas
@@ -332,7 +332,7 @@ map uAnnotationCS_2_Annotation_ownedContents in BaseCS2AS_qvtp_qvtcas where() {
annotationCS.pivot.oclAsType(pivot::Annotation).ownedContents :=
- annotationCS.ownedContents.pivot.oclAsType(pivot::Element);
+ annotationCS.ownedContents.pivot.oclAsType(pivot::Element)->asOrderedSet();
}
}
map uAnnotationCS_2_Annotation_ownedAnnotations in BaseCS2AS_qvtp_qvtcas
@@ -344,7 +344,7 @@ map uAnnotationCS_2_Annotation_ownedAnnotations in BaseCS2AS_qvtp_qvtcas where() {
annotationCS.pivot.oclAsType(pivot::Annotation).ownedAnnotations :=
- annotationCS.ownedAnnotations.pivot.oclAsType(pivot::Element);
+ annotationCS.ownedAnnotations.pivot.oclAsType(pivot::Element)->asOrderedSet();
}
}
map uAnnotationCS_2_Annotation_references in BaseCS2AS_qvtp_qvtcas
@@ -356,7 +356,7 @@ map uAnnotationCS_2_Annotation_references in BaseCS2AS_qvtp_qvtcas where() {
annotationCS.pivot.oclAsType(pivot::Annotation).references :=
- annotationCS.ownedReferences.pivot.oclAsType(pivot::Element);
+ annotationCS.ownedReferences.pivot.oclAsType(pivot::Element)->asOrderedSet();
}
}
map uAttributeCS_2_Property_name in BaseCS2AS_qvtp_qvtcas
@@ -467,7 +467,7 @@ map uAttributeCS_2_Property_ownedExpression in BaseCS2AS_qvtp_qvtcas where() {
attributeCS.pivot.oclAsType(pivot::Property).ownedExpression :=
- attributeCS.ownedDefaultExpressions.pivot.oclAsType(pivot::LanguageExpression);
+ attributeCS.ownedDefaultExpressions.pivot.oclAsType(pivot::LanguageExpression)->first();
}
}
map uAttributeCS_2_Property_ownedAnnotations in BaseCS2AS_qvtp_qvtcas
@@ -479,7 +479,7 @@ map uAttributeCS_2_Property_ownedAnnotations in BaseCS2AS_qvtp_qvtcas where() {
attributeCS.pivot.oclAsType(pivot::Property).ownedAnnotations :=
- attributeCS.ownedAnnotations.pivot.oclAsType(pivot::Element);
+ attributeCS.ownedAnnotations.pivot.oclAsType(pivot::Element)->asOrderedSet();
}
}
map uAttributeCS_2_Property_type in BaseCS2AS_qvtp_qvtcas
@@ -573,7 +573,7 @@ map uDataTypeCS_2_DataType_ownedAnnotations in BaseCS2AS_qvtp_qvtcas where() {
dataTypeCS.pivot.oclAsType(pivot::DataType).ownedAnnotations :=
- dataTypeCS.ownedAnnotations.pivot.oclAsType(pivot::Element);
+ dataTypeCS.ownedAnnotations.pivot.oclAsType(pivot::Element)->asOrderedSet();
}
}
map uDataTypeCS_2_DataType_ownedInvariants in BaseCS2AS_qvtp_qvtcas
@@ -585,7 +585,7 @@ map uDataTypeCS_2_DataType_ownedInvariants in BaseCS2AS_qvtp_qvtcas where() {
dataTypeCS.pivot.oclAsType(pivot::DataType).ownedInvariants :=
- dataTypeCS.ownedConstraints.pivot.oclAsType(pivot::Constraint);
+ dataTypeCS.ownedConstraints.pivot.oclAsType(pivot::Constraint)->asSet();
}
}
map uDataTypeCS_2_DataType_superClasses in BaseCS2AS_qvtp_qvtcas
@@ -596,7 +596,7 @@ map uDataTypeCS_2_DataType_superClasses in BaseCS2AS_qvtp_qvtcas enforce rightAS() {}
where() {
- dataTypeCS.pivot.oclAsType(pivot::DataType).superClasses := ocl::OclElement;
+ dataTypeCS.pivot.oclAsType(pivot::DataType).superClasses := Set{ocl::OclElement};
}
}
map uDetailCS_2_Detail_name in BaseCS2AS_qvtp_qvtcas
@@ -618,7 +618,7 @@ map uDetailCS_2_Detail_values in BaseCS2AS_qvtp_qvtcas enforce rightAS() {}
where() {
- detailCS.pivot.oclAsType(pivot::Detail).values := detailCS.values;
+ detailCS.pivot.oclAsType(pivot::Detail).values := detailCS.values->asSet();
}
}
map uEnumerationCS_2_Enumeration_name in BaseCS2AS_qvtp_qvtcas
@@ -663,7 +663,7 @@ map uEnumerationCS_2_Enumeration_ownedLiterals in BaseCS2AS_qvtp_qvtcas where() {
enumerationCS.pivot.oclAsType(ocl::Enumeration).ownedLiterals :=
- enumerationCS.ownedLiterals.pivot.oclAsType(ocl::EnumerationLiteral);
+ enumerationCS.ownedLiterals.pivot.oclAsType(ocl::EnumerationLiteral)->asOrderedSet();
}
}
map uEnumerationCS_2_Enumeration_ownedSignature in BaseCS2AS_qvtp_qvtcas
@@ -687,7 +687,7 @@ map uEnumerationCS_2_Enumeration_ownedAnnotations in BaseCS2AS_qvtp_qvtcas where() {
enumerationCS.pivot.oclAsType(ocl::Enumeration).ownedAnnotations :=
- enumerationCS.ownedAnnotations.pivot.oclAsType(pivot::Element);
+ enumerationCS.ownedAnnotations.pivot.oclAsType(pivot::Element)->asOrderedSet();
}
}
map uEnumerationCS_2_Enumeration_ownedInvariants in BaseCS2AS_qvtp_qvtcas
@@ -699,7 +699,7 @@ map uEnumerationCS_2_Enumeration_ownedInvariants in BaseCS2AS_qvtp_qvtcas where() {
enumerationCS.pivot.oclAsType(ocl::Enumeration).ownedInvariants :=
- enumerationCS.ownedConstraints.pivot.oclAsType(pivot::Constraint);
+ enumerationCS.ownedConstraints.pivot.oclAsType(pivot::Constraint)->asSet();
}
}
map uEnumerationCS_2_Enumeration_superClasses in BaseCS2AS_qvtp_qvtcas
@@ -710,7 +710,7 @@ map uEnumerationCS_2_Enumeration_superClasses in BaseCS2AS_qvtp_qvtcas enforce rightAS() {}
where() {
- enumerationCS.pivot.oclAsType(ocl::Enumeration).superClasses := ocl::OclElement;
+ enumerationCS.pivot.oclAsType(ocl::Enumeration).superClasses := Set{ocl::OclElement};
}
}
map uEnumerationLiteralCS_2_EnumerationLiteral_name in BaseCS2AS_qvtp_qvtcas
@@ -744,7 +744,7 @@ map uEnumerationLiteralCS_2_EnumerationLiteral_ownedAnnotations in BaseCS2AS_qvt where() {
enumerationLiteralCS.pivot.oclAsType(ocl::EnumerationLiteral).ownedAnnotations :=
- enumerationLiteralCS.ownedAnnotations.pivot.oclAsType(pivot::Element);
+ enumerationLiteralCS.ownedAnnotations.pivot.oclAsType(pivot::Element)->asOrderedSet();
}
}
map uImportCS_2_Import_name in BaseCS2AS_qvtp_qvtcas
@@ -859,7 +859,7 @@ map uOperationCS_2_Operation_ownedParameters in BaseCS2AS_qvtp_qvtcas where() {
operationCS.pivot.oclAsType(pivot::Operation).ownedParameters :=
- operationCS.ownedParameters.pivot.oclAsType(pivot::Parameter);
+ operationCS.ownedParameters.pivot.oclAsType(pivot::Parameter)->asOrderedSet();
}
}
map uOperationCS_2_Operation_raisedExceptions in BaseCS2AS_qvtp_qvtcas
@@ -871,7 +871,7 @@ map uOperationCS_2_Operation_raisedExceptions in BaseCS2AS_qvtp_qvtcas where() {
operationCS.pivot.oclAsType(pivot::Operation).raisedExceptions :=
- operationCS.ownedExceptions.pivot.oclAsType(pivot::Element);
+ operationCS.ownedExceptions.pivot.oclAsType(pivot::Element)->asSet();
}
}
map uOperationCS_2_Operation_ownedAnnotations in BaseCS2AS_qvtp_qvtcas
@@ -883,7 +883,7 @@ map uOperationCS_2_Operation_ownedAnnotations in BaseCS2AS_qvtp_qvtcas where() {
operationCS.pivot.oclAsType(pivot::Operation).ownedAnnotations :=
- operationCS.ownedAnnotations.pivot.oclAsType(pivot::Element);
+ operationCS.ownedAnnotations.pivot.oclAsType(pivot::Element)->asOrderedSet();
}
}
map uOperationCS_2_Operation_ownedPreconditions in BaseCS2AS_qvtp_qvtcas
@@ -895,7 +895,7 @@ map uOperationCS_2_Operation_ownedPreconditions in BaseCS2AS_qvtp_qvtcas where() {
operationCS.pivot.oclAsType(pivot::Operation).ownedPreconditions :=
- operationCS.ownedPreconditions.pivot.oclAsType(pivot::Constraint);
+ operationCS.ownedPreconditions.pivot.oclAsType(pivot::Constraint)->asSet();
}
}
map uOperationCS_2_Operation_ownedPostconditions in BaseCS2AS_qvtp_qvtcas
@@ -907,7 +907,7 @@ map uOperationCS_2_Operation_ownedPostconditions in BaseCS2AS_qvtp_qvtcas where() {
operationCS.pivot.oclAsType(pivot::Operation).ownedPostconditions :=
- operationCS.ownedPostconditions.pivot.oclAsType(pivot::Constraint);
+ operationCS.ownedPostconditions.pivot.oclAsType(pivot::Constraint)->asSet();
}
}
map uOperationCS_2_Operation_bodyExpression in BaseCS2AS_qvtp_qvtcas
@@ -919,7 +919,7 @@ map uOperationCS_2_Operation_bodyExpression in BaseCS2AS_qvtp_qvtcas where() {
operationCS.pivot.oclAsType(pivot::Operation).bodyExpression :=
- operationCS.ownedBodyExpressions.pivot.oclAsType(pivot::LanguageExpression);
+ operationCS.ownedBodyExpressions.pivot.oclAsType(pivot::LanguageExpression)->first();
}
}
map uOperationCS_2_Operation_type in BaseCS2AS_qvtp_qvtcas
@@ -988,7 +988,7 @@ map uPackageCS_2_Package_ownedPackages in BaseCS2AS_qvtp_qvtcas enforce rightAS() {}
where() {
- packageCS.pivot.oclAsType(pivot::Package).ownedPackages := packageCS.ownedPackages.pivot.oclAsType(pivot::Package);
+ packageCS.pivot.oclAsType(pivot::Package).ownedPackages := packageCS.ownedPackages.pivot.oclAsType(pivot::Package)->asSet();
}
}
map uPackageCS_2_Package_ownedAnnotations in BaseCS2AS_qvtp_qvtcas
@@ -1000,7 +1000,7 @@ map uPackageCS_2_Package_ownedAnnotations in BaseCS2AS_qvtp_qvtcas where() {
packageCS.pivot.oclAsType(pivot::Package).ownedAnnotations :=
- packageCS.ownedAnnotations.pivot.oclAsType(pivot::Element);
+ packageCS.ownedAnnotations.pivot.oclAsType(pivot::Element)->asOrderedSet();
}
}
map uPackageCS_2_Package_ownedClasses in BaseCS2AS_qvtp_qvtcas
@@ -1011,7 +1011,7 @@ map uPackageCS_2_Package_ownedClasses in BaseCS2AS_qvtp_qvtcas enforce rightAS() {}
where() {
- packageCS.pivot.oclAsType(pivot::Package).ownedClasses := packageCS.ownedClasses.pivot.oclAsType(ocl::Class);
+ packageCS.pivot.oclAsType(pivot::Package).ownedClasses := packageCS.ownedClasses.pivot.oclAsType(ocl::Class)->asSet();
}
}
map uParameterCS_2_Parameter_name in BaseCS2AS_qvtp_qvtcas
@@ -1034,7 +1034,7 @@ map uParameterCS_2_Parameter_ownedAnnotations in BaseCS2AS_qvtp_qvtcas where() {
parameterCS.pivot.oclAsType(pivot::Parameter).ownedAnnotations :=
- parameterCS.ownedAnnotations.pivot.oclAsType(pivot::Element);
+ parameterCS.ownedAnnotations.pivot.oclAsType(pivot::Element)->asOrderedSet();
}
}
map uParameterCS_2_Parameter_type in BaseCS2AS_qvtp_qvtcas
@@ -1167,7 +1167,7 @@ map uReferenceCS_2_Property_0_keys in BaseCS2AS_qvtp_qvtcas enforce rightAS() {}
where() {
- referenceCS.pivot.oclAsType(pivot::Property).keys := referenceCS.referredKeys;
+ referenceCS.pivot.oclAsType(pivot::Property).keys := referenceCS.referredKeys->asSet();
}
}
map uReferenceCS_2_Property_0_defaultValueString in BaseCS2AS_qvtp_qvtcas
@@ -1190,7 +1190,7 @@ map uReferenceCS_2_Property_0_ownedExpression in BaseCS2AS_qvtp_qvtcas where() {
referenceCS.pivot.oclAsType(pivot::Property).ownedExpression := if referenceCS.ownedDefaultExpressions->notEmpty()
- then referenceCS.ownedDefaultExpressions.pivot.oclAsType(pivot::LanguageExpression) else null
+ then referenceCS.ownedDefaultExpressions.pivot.oclAsType(pivot::LanguageExpression)->first() else null
endif;
}
}
@@ -1203,7 +1203,7 @@ map uReferenceCS_2_Property_0_ownedAnnotations in BaseCS2AS_qvtp_qvtcas where() {
referenceCS.pivot.oclAsType(pivot::Property).ownedAnnotations :=
- referenceCS.ownedAnnotations.pivot.oclAsType(pivot::Element);
+ referenceCS.ownedAnnotations.pivot.oclAsType(pivot::Element)->asOrderedSet();
}
}
map uReferenceCS_2_Property_0_type in BaseCS2AS_qvtp_qvtcas
@@ -1254,7 +1254,7 @@ map uRootPackageCS_2_Model_ownedImports in BaseCS2AS_qvtp_qvtcas where() {
rootPackageCS.pivot.oclAsType(pivot::Model).ownedImports :=
- rootPackageCS.ownedImports.pivot.oclAsType(pivot::Import);
+ rootPackageCS.ownedImports.pivot.oclAsType(pivot::Import)->asOrderedSet();
}
}
map uRootPackageCS_2_Model_ownedPackages in BaseCS2AS_qvtp_qvtcas
@@ -1266,7 +1266,7 @@ map uRootPackageCS_2_Model_ownedPackages in BaseCS2AS_qvtp_qvtcas where() {
rootPackageCS.pivot.oclAsType(pivot::Model).ownedPackages :=
- rootPackageCS.ownedPackages.pivot.oclAsType(pivot::Package);
+ rootPackageCS.ownedPackages.pivot.oclAsType(pivot::Package)->asSet();
}
}
map uSpecificationCS_2_LanguageExpression_language in BaseCS2AS_qvtp_qvtcas
@@ -1288,7 +1288,7 @@ map uSpecificationCS_2_LanguageExpression_body in BaseCS2AS_qvtp_qvtcas enforce rightAS() {}
where() {
- specificationCS.pivot.oclAsType(pivot::LanguageExpression)._'body' := Sequence(String){specificationCS.exprString};
+ specificationCS.pivot.oclAsType(pivot::LanguageExpression)._'body' := specificationCS.exprString;
}
}
map uStructuredClassCS_2_Class_name in BaseCS2AS_qvtp_qvtcas
@@ -1356,7 +1356,7 @@ map uStructuredClassCS_2_Class_ownedAnnotations in BaseCS2AS_qvtp_qvtcas where() {
structuredClassCS.pivot.oclAsType(ocl::Class).ownedAnnotations :=
- structuredClassCS.ownedAnnotations.pivot.oclAsType(pivot::Element);
+ structuredClassCS.ownedAnnotations.pivot.oclAsType(pivot::Element)->asOrderedSet();
}
}
map uStructuredClassCS_2_Class_ownedOperations in BaseCS2AS_qvtp_qvtcas
@@ -1368,7 +1368,7 @@ map uStructuredClassCS_2_Class_ownedOperations in BaseCS2AS_qvtp_qvtcas where() {
structuredClassCS.pivot.oclAsType(ocl::Class).ownedOperations :=
- structuredClassCS.ownedOperations.pivot.oclAsType(pivot::Operation);
+ structuredClassCS.ownedOperations.pivot.oclAsType(pivot::Operation)->asOrderedSet();
}
}
map uStructuredClassCS_2_Class_ownedProperties in BaseCS2AS_qvtp_qvtcas
@@ -1380,7 +1380,7 @@ map uStructuredClassCS_2_Class_ownedProperties in BaseCS2AS_qvtp_qvtcas where() {
structuredClassCS.pivot.oclAsType(ocl::Class).ownedProperties :=
- structuredClassCS.ownedProperties.pivot.oclAsType(pivot::Element);
+ structuredClassCS.ownedProperties.pivot.oclAsType(pivot::Element)->asOrderedSet();
}
}
map uStructuredClassCS_2_Class_ownedInvariants in BaseCS2AS_qvtp_qvtcas
@@ -1392,7 +1392,7 @@ map uStructuredClassCS_2_Class_ownedInvariants in BaseCS2AS_qvtp_qvtcas where() {
structuredClassCS.pivot.oclAsType(ocl::Class).ownedInvariants :=
- structuredClassCS.ownedConstraints.pivot.oclAsType(pivot::Constraint);
+ structuredClassCS.ownedConstraints.pivot.oclAsType(pivot::Constraint)->asSet();
}
}
map uStructuredClassCS_2_Class_superClasses in BaseCS2AS_qvtp_qvtcas
@@ -1404,8 +1404,8 @@ map uStructuredClassCS_2_Class_superClasses in BaseCS2AS_qvtp_qvtcas where() {
structuredClassCS.pivot.oclAsType(ocl::Class).superClasses := if structuredClassCS.ownedSuperTypes = null then
- ocl::OclElement
- else structuredClassCS.ownedSuperTypes.pivot.oclAsType(pivot::Element) endif;
+ Set{ocl::OclElement}
+ else structuredClassCS.ownedSuperTypes.pivot.oclAsType(pivot::Element)->asSet() endif;
}
}
map uTemplateBindingCS_2_TemplateBinding_ownedSubstitutions in BaseCS2AS_qvtp_qvtcas
@@ -1417,7 +1417,7 @@ map uTemplateBindingCS_2_TemplateBinding_ownedSubstitutions in BaseCS2AS_qvtp_qv where() {
templateBindingCS.pivot.oclAsType(pivot::TemplateBinding).ownedSubstitutions :=
- templateBindingCS.ownedSubstitutions.pivot.oclAsType(pivot::TemplateParameterSubstitution);
+ templateBindingCS.ownedSubstitutions.pivot.oclAsType(pivot::TemplateParameterSubstitution)->asSet();
}
}
map uTemplateBindingCS_2_TemplateBinding_templateSignature in BaseCS2AS_qvtp_qvtcas
@@ -1468,7 +1468,7 @@ enforce rightAS() {} where() {
templateSignatureCS.pivot.oclAsType(pivot::TemplateSignature).ownedParameters :=
- templateSignatureCS.ownedParameters.pivot.oclAsType(pivot::Element);
+ templateSignatureCS.ownedParameters.pivot.oclAsType(pivot::Element)->asOrderedSet();
}
}
map uTuplePartCS_2_Property_name in BaseCS2AS_qvtp_qvtcas
@@ -1513,7 +1513,7 @@ enforce rightAS() {} where() {
tupleTypeCS.pivot.oclAsType(pivot::TupleType).ownedProperties :=
- tupleTypeCS.ownedParts.pivot.oclAsType(pivot::Property);
+ tupleTypeCS.ownedParts.pivot.oclAsType(pivot::Property)->asOrderedSet();
}
}
map uTypeParameterCS_2_TemplateParameter_constrainingClasses in BaseCS2AS_qvtp_qvtcas
|