From 7dad0d6418ec659049af9127fd99dcce62cc438a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martti=20K=C3=A4=C3=A4rik?= Date: Tue, 28 May 2024 13:15:14 +0300 Subject: [PATCH] Enable multiple annotations (textual syntax workaround was added to support the serialization of multiple annotations) --- .../.launch/TOP (1).launch | 29 +- .../mts/tdl/transform/AbstractTranslator.java | 28 + .../.gitignore | 3 + .../META-INF/MANIFEST.MF | 1 + plugins/org.etsi.mts.tdl.model/.project | 19 +- .../META-INF/MANIFEST.MF | 2 + .../etsi/mts/tdl/ComponentInstanceRole.java | 18 +- .../org/etsi/mts/tdl/GateTypeKind.java | 18 +- .../org/etsi/mts/tdl/NamedElement.java | 1 - .../org/etsi/mts/tdl/ParameterKind.java | 18 +- .../org/etsi/mts/tdl/TimeLabelUseKind.java | 18 +- .../mts/tdl/UnassignedMemberTreatment.java | 18 +- .../mts/tdl/impl/ActionBehaviourImpl.java | 190 +++++-- .../org/etsi/mts/tdl/impl/ActionImpl.java | 18 +- .../mts/tdl/impl/ActionReferenceImpl.java | 24 +- .../org/etsi/mts/tdl/impl/AnnotationImpl.java | 30 +- .../etsi/mts/tdl/impl/AnnotationTypeImpl.java | 21 +- .../org/etsi/mts/tdl/impl/AnyValueImpl.java | 205 ++++++-- .../org/etsi/mts/tdl/impl/AssertionImpl.java | 27 +- .../org/etsi/mts/tdl/impl/AssignmentImpl.java | 188 +++++-- .../mts/tdl/impl/AtomicBehaviourImpl.java | 161 ++++-- .../tdl/impl/BehaviourDescriptionImpl.java | 21 +- .../org/etsi/mts/tdl/impl/BehaviourImpl.java | 309 +++++++++-- .../org/etsi/mts/tdl/impl/BlockImpl.java | 248 +++++++-- .../tdl/impl/BoundedLoopBehaviourImpl.java | 18 +- .../tdl/impl/CollectionDataInstanceImpl.java | 18 +- .../mts/tdl/impl/CollectionDataTypeImpl.java | 18 +- .../mts/tdl/impl/CombinedBehaviourImpl.java | 21 +- .../org/etsi/mts/tdl/impl/CommentImpl.java | 24 +- .../impl/ComponentInstanceBindingImpl.java | 24 +- .../mts/tdl/impl/ComponentInstanceImpl.java | 18 +- .../etsi/mts/tdl/impl/ComponentTypeImpl.java | 245 ++++++--- .../org/etsi/mts/tdl/impl/ConnectionImpl.java | 18 +- .../org/etsi/mts/tdl/impl/ConstraintImpl.java | 24 +- .../mts/tdl/impl/DataElementMappingImpl.java | 30 +- .../etsi/mts/tdl/impl/DataElementUseImpl.java | 266 ++++++++-- .../etsi/mts/tdl/impl/DataInstanceImpl.java | 18 +- .../mts/tdl/impl/DataInstanceUseImpl.java | 242 +++++++-- .../mts/tdl/impl/DataResourceMappingImpl.java | 12 +- .../org/etsi/mts/tdl/impl/DataTypeImpl.java | 48 +- .../org/etsi/mts/tdl/impl/DataUseImpl.java | 294 +++++++++-- .../org/etsi/mts/tdl/impl/ElementImpl.java | 138 +++-- .../etsi/mts/tdl/impl/ElementImportImpl.java | 21 +- .../etsi/mts/tdl/impl/EnumDataTypeImpl.java | 18 +- .../tdl/impl/ExceptionalBehaviourImpl.java | 134 +++-- .../org/etsi/mts/tdl/impl/ExtensionImpl.java | 235 +++++++-- .../mts/tdl/impl/FormalParameterUseImpl.java | 54 +- .../etsi/mts/tdl/impl/FunctionCallImpl.java | 54 +- .../org/etsi/mts/tdl/impl/FunctionImpl.java | 18 +- .../etsi/mts/tdl/impl/GateInstanceImpl.java | 18 +- .../etsi/mts/tdl/impl/GateReferenceImpl.java | 24 +- .../org/etsi/mts/tdl/impl/GateTypeImpl.java | 109 ++-- .../etsi/mts/tdl/impl/InlineActionImpl.java | 12 +- .../etsi/mts/tdl/impl/InteractionImpl.java | 162 ++++-- .../mts/tdl/impl/LiteralValueUseImpl.java | 269 ++++++++-- .../mts/tdl/impl/LocalExpressionImpl.java | 27 +- .../mts/tdl/impl/MemberAssignmentImpl.java | 27 +- .../org/etsi/mts/tdl/impl/MemberImpl.java | 18 +- .../mts/tdl/impl/MemberReferenceImpl.java | 27 +- .../org/etsi/mts/tdl/impl/MessageImpl.java | 21 +- .../impl/MultipleCombinedBehaviourImpl.java | 197 ++++++-- .../etsi/mts/tdl/impl/NamedElementImpl.java | 164 +++++- .../org/etsi/mts/tdl/impl/PackageImpl.java | 24 +- .../mts/tdl/impl/PackageableElementImpl.java | 478 +++++++++++++++--- .../mts/tdl/impl/ParameterBindingImpl.java | 148 ++++-- .../org/etsi/mts/tdl/impl/ParameterImpl.java | 18 +- .../mts/tdl/impl/ParameterMappingImpl.java | 18 +- .../mts/tdl/impl/PeriodicBehaviourImpl.java | 131 +++-- .../tdl/impl/PredefinedFunctionCallImpl.java | 118 +++-- .../mts/tdl/impl/PredefinedFunctionImpl.java | 18 +- .../etsi/mts/tdl/impl/ProcedureCallImpl.java | 30 +- .../mts/tdl/impl/ProcedureParameterImpl.java | 12 +- .../mts/tdl/impl/ProcedureSignatureImpl.java | 18 +- .../org/etsi/mts/tdl/impl/QuiescenceImpl.java | 238 +++++++-- .../etsi/mts/tdl/impl/SimpleDataTypeImpl.java | 112 ++-- .../tdl/impl/SingleCombinedBehaviourImpl.java | 182 +++++-- .../mts/tdl/impl/SpecialValueUseImpl.java | 119 ++++- .../tdl/impl/StructuredDataInstanceImpl.java | 18 +- .../mts/tdl/impl/StructuredDataTypeImpl.java | 219 ++++++-- .../org/etsi/mts/tdl/impl/TargetImpl.java | 24 +- .../mts/tdl/impl/TestConfigurationImpl.java | 387 ++++++++++++-- .../mts/tdl/impl/TestDescriptionImpl.java | 33 +- .../impl/TestDescriptionReferenceImpl.java | 188 +++++-- .../etsi/mts/tdl/impl/TestObjectiveImpl.java | 15 +- .../etsi/mts/tdl/impl/TimeConstraintImpl.java | 21 +- .../etsi/mts/tdl/impl/TimeLabelUseImpl.java | 68 ++- .../etsi/mts/tdl/impl/TimeOperationImpl.java | 199 ++++++-- .../etsi/mts/tdl/impl/TimerOperationImpl.java | 135 +++-- .../org/etsi/mts/tdl/impl/TimerStartImpl.java | 21 +- .../mts/tdl/impl/ValueAssignmentImpl.java | 24 +- .../org/etsi/mts/tdl/impl/VariableImpl.java | 18 +- .../etsi/mts/tdl/impl/VariableUseImpl.java | 60 +-- .../mts/tdl/impl/VerdictAssignmentImpl.java | 21 +- .../org/etsi/mts/tdl/impl/tdlFactoryImpl.java | 31 +- .../org/etsi/mts/tdl/impl/tdlPackageImpl.java | 316 ++++++------ .../src-gen/org/etsi/mts/tdl/tdlFactory.java | 9 + .../src-gen/org/etsi/mts/tdl/tdlPackage.java | 215 +++++++- .../etsi/mts/tdl/util/tdlAdapterFactory.java | 349 +++++-------- .../org/etsi/mts/tdl/util/tdlSwitch.java | 346 +++++-------- .../src/org/etsi/mts/tdl/Activator.java | 19 + .../tdl/openapi2tdl/next/ConverterNext.java | 2 +- .../next/OpenAPI2TDLTranslatorNext.java | 35 +- .../org.etsi.mts.tdl.tools.to.docx/.classpath | 17 +- .../META-INF/MANIFEST.MF | 13 +- .../build.properties | 13 +- .../.launch/TDL.tx and TDL.txi.launch | 28 +- .../META-INF/MANIFEST.MF | 3 +- .../etsi/mts/tdl/yang2tdl/YANGConverter.java | 2 +- .../mts/tdl/yang2tdl/Yang2TDLTranslator.java | 204 +++++--- 109 files changed, 6363 insertions(+), 3054 deletions(-) diff --git a/plugins/org.etsi.mts.tdl.TDLan2/.launch/TOP (1).launch b/plugins/org.etsi.mts.tdl.TDLan2/.launch/TOP (1).launch index 6fc4305c..2892d674 100644 --- a/plugins/org.etsi.mts.tdl.TDLan2/.launch/TOP (1).launch +++ b/plugins/org.etsi.mts.tdl.TDLan2/.launch/TOP (1).launch @@ -32,13 +32,12 @@ - + - @@ -64,8 +63,6 @@ - - @@ -89,7 +86,6 @@ - @@ -118,7 +114,6 @@ - @@ -186,7 +181,6 @@ - @@ -226,8 +220,6 @@ - - @@ -246,12 +238,6 @@ - - - - - - @@ -315,7 +301,6 @@ - @@ -375,6 +360,11 @@ + + + + + @@ -387,17 +377,18 @@ + + - - + @@ -413,6 +404,8 @@ + + diff --git a/plugins/org.etsi.mts.tdl.common/src/org/etsi/mts/tdl/transform/AbstractTranslator.java b/plugins/org.etsi.mts.tdl.common/src/org/etsi/mts/tdl/transform/AbstractTranslator.java index 9c66519b..4e23324e 100644 --- a/plugins/org.etsi.mts.tdl.common/src/org/etsi/mts/tdl/transform/AbstractTranslator.java +++ b/plugins/org.etsi.mts.tdl.common/src/org/etsi/mts/tdl/transform/AbstractTranslator.java @@ -1,7 +1,9 @@ package org.etsi.mts.tdl.transform; +import java.util.HashSet; import java.util.List; import java.util.Optional; +import java.util.Set; import java.util.TreeMap; import java.util.function.Predicate; @@ -285,4 +287,30 @@ public abstract class AbstractTranslator { this.generatedPackage = generatedPackage; } + public void ensureUniqueNames(Package p) { + Set names = new HashSet<>(); + for (PackageableElement pe: p.getPackagedElement()) { + makeUnique(pe, names); + if (pe instanceof EnumDataType) + for (PackageableElement l: ((EnumDataType) pe).getValue()) + makeUnique(l, names); + else if (pe instanceof Package) { + ensureUniqueNames((Package) pe); + } + } + + } + + private void makeUnique(NamedElement e, Set names) { + String name = e.getName(); + int i = 1; + String newName = name; + while (names.contains(newName)) { + newName = name + "_" + i++; + } + if (!newName.equals(name)) + e.setName(newName); + names.add(newName); + } + } \ No newline at end of file diff --git a/plugins/org.etsi.mts.tdl.execution.java/.gitignore b/plugins/org.etsi.mts.tdl.execution.java/.gitignore index b83d2226..c1888407 100644 --- a/plugins/org.etsi.mts.tdl.execution.java/.gitignore +++ b/plugins/org.etsi.mts.tdl.execution.java/.gitignore @@ -1 +1,4 @@ /target/ +/example-a-api +/example-a-src +/example-lib diff --git a/plugins/org.etsi.mts.tdl.graphical.labels.data.ui/META-INF/MANIFEST.MF b/plugins/org.etsi.mts.tdl.graphical.labels.data.ui/META-INF/MANIFEST.MF index a0def5e6..bfae79ec 100644 --- a/plugins/org.etsi.mts.tdl.graphical.labels.data.ui/META-INF/MANIFEST.MF +++ b/plugins/org.etsi.mts.tdl.graphical.labels.data.ui/META-INF/MANIFEST.MF @@ -24,3 +24,4 @@ Export-Package: org.etsi.mts.tdl.graphical.labels.ui.quickfix, org.etsi.mts.tdl.graphical.labels.data.ui.internal, org.etsi.mts.tdl.graphical.labels.ide.contentassist.antlr.internal, org.etsi.mts.tdl.graphical.labels.ide.contentassist.antlr +Bundle-Activator: org.etsi.mts.tdl.graphical.labels.data.ui.internal.DataActivator diff --git a/plugins/org.etsi.mts.tdl.model/.project b/plugins/org.etsi.mts.tdl.model/.project index 16b43bee..dc251f15 100644 --- a/plugins/org.etsi.mts.tdl.model/.project +++ b/plugins/org.etsi.mts.tdl.model/.project @@ -11,23 +11,12 @@ - org.eclipse.ocl.pivot.ui.oclbuilder + org.eclipse.ui.externaltools.ExternalToolBuilder + full,incremental, - disabledExtensions - *,essentialocl - - - disabledPaths - bin/**,target/** - - - enabledExtensions - ecore,ocl,oclinecore,oclstdlib,uml - - - enabledPaths - ** + LaunchConfigHandle + <project>/.externalToolBuilders/org.eclipse.ocl.pivot.ui.oclbuilder.launch diff --git a/plugins/org.etsi.mts.tdl.model/META-INF/MANIFEST.MF b/plugins/org.etsi.mts.tdl.model/META-INF/MANIFEST.MF index 2e217a54..4a487ef8 100644 --- a/plugins/org.etsi.mts.tdl.model/META-INF/MANIFEST.MF +++ b/plugins/org.etsi.mts.tdl.model/META-INF/MANIFEST.MF @@ -18,10 +18,12 @@ Export-Package: org.etsi.mts.tdl, org.etsi.mts.tdl.structuredobjectives.impl, org.etsi.mts.tdl.structuredobjectives.util Require-Bundle: org.eclipse.core.runtime, + org.eclipse.core.resources, org.eclipse.emf.ecore;visibility:=reexport, org.eclipse.emf.ecore.xmi;visibility:=reexport, org.etsi.mts.tdl.model;visibility:=reexport, org.eclipse.ocl.pivot;visibility:=reexport, + org.eclipse.ocl.examples.codegen;visibility:=reexport, org.eclipse.ocl.xtext.essentialocl, org.eclipse.ocl.xtext.completeocl, org.eclipse.emf.mwe2.launch;resolution:=optional, diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/ComponentInstanceRole.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/ComponentInstanceRole.java index 58ab4013..010eef92 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/ComponentInstanceRole.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/ComponentInstanceRole.java @@ -68,8 +68,7 @@ public enum ComponentInstanceRole implements Enumerator * @generated */ private static final ComponentInstanceRole[] VALUES_ARRAY = - new ComponentInstanceRole[] - { + new ComponentInstanceRole[] { SUT, TESTER, }; @@ -92,11 +91,9 @@ public enum ComponentInstanceRole implements Enumerator */ public static ComponentInstanceRole get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) - { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { ComponentInstanceRole result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) - { + if (result.toString().equals(literal)) { return result; } } @@ -113,11 +110,9 @@ public enum ComponentInstanceRole implements Enumerator */ public static ComponentInstanceRole getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) - { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { ComponentInstanceRole result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) - { + if (result.getName().equals(name)) { return result; } } @@ -134,8 +129,7 @@ public enum ComponentInstanceRole implements Enumerator */ public static ComponentInstanceRole get(int value) { - switch (value) - { + switch (value) { case SUT_VALUE: return SUT; case TESTER_VALUE: return TESTER; } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/GateTypeKind.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/GateTypeKind.java index d4db35e9..940fde23 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/GateTypeKind.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/GateTypeKind.java @@ -68,8 +68,7 @@ public enum GateTypeKind implements Enumerator * @generated */ private static final GateTypeKind[] VALUES_ARRAY = - new GateTypeKind[] - { + new GateTypeKind[] { MESSAGE, PROCEDURE, }; @@ -92,11 +91,9 @@ public enum GateTypeKind implements Enumerator */ public static GateTypeKind get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) - { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { GateTypeKind result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) - { + if (result.toString().equals(literal)) { return result; } } @@ -113,11 +110,9 @@ public enum GateTypeKind implements Enumerator */ public static GateTypeKind getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) - { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { GateTypeKind result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) - { + if (result.getName().equals(name)) { return result; } } @@ -134,8 +129,7 @@ public enum GateTypeKind implements Enumerator */ public static GateTypeKind get(int value) { - switch (value) - { + switch (value) { case MESSAGE_VALUE: return MESSAGE; case PROCEDURE_VALUE: return PROCEDURE; } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/NamedElement.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/NamedElement.java index 5ea0acad..c7239779 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/NamedElement.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/NamedElement.java @@ -28,7 +28,6 @@ public interface NamedElement extends Element * @return the value of the 'Qualified Name' attribute. * @see org.etsi.mts.tdl.tdlPackage#getNamedElement_QualifiedName() * @model required="true" transient="true" changeable="false" volatile="true" derived="true" - * annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot derivation='\n if (self.name.oclIsUndefined()) then\n \'\'\n else\n if (not self.oclContainer().oclIsUndefined()) then\n if (self.oclContainer().oclIsKindOf(NamedElement)) then\n self.oclContainer().oclAsType(NamedElement).qualifiedName + \'::\' + self.name\n else\n self.oclContainer().oclAsType(ocl::OclElement)->closure(oclContainer())\n ->select(c | c.oclIsKindOf(NamedElement))\n ->asOrderedSet()\n ->first().oclAsType(NamedElement).qualifiedName + \'::\' + self.name\n endif\n else\n self.name\n endif\n endif'" * @generated */ String getQualifiedName(); diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/ParameterKind.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/ParameterKind.java index f800cf54..be93d25a 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/ParameterKind.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/ParameterKind.java @@ -89,8 +89,7 @@ public enum ParameterKind implements Enumerator * @generated */ private static final ParameterKind[] VALUES_ARRAY = - new ParameterKind[] - { + new ParameterKind[] { IN, OUT, EXCEPTION, @@ -114,11 +113,9 @@ public enum ParameterKind implements Enumerator */ public static ParameterKind get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) - { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { ParameterKind result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) - { + if (result.toString().equals(literal)) { return result; } } @@ -135,11 +132,9 @@ public enum ParameterKind implements Enumerator */ public static ParameterKind getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) - { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { ParameterKind result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) - { + if (result.getName().equals(name)) { return result; } } @@ -156,8 +151,7 @@ public enum ParameterKind implements Enumerator */ public static ParameterKind get(int value) { - switch (value) - { + switch (value) { case IN_VALUE: return IN; case OUT_VALUE: return OUT; case EXCEPTION_VALUE: return EXCEPTION; diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/TimeLabelUseKind.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/TimeLabelUseKind.java index de8f680a..3a38d290 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/TimeLabelUseKind.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/TimeLabelUseKind.java @@ -89,8 +89,7 @@ public enum TimeLabelUseKind implements Enumerator * @generated */ private static final TimeLabelUseKind[] VALUES_ARRAY = - new TimeLabelUseKind[] - { + new TimeLabelUseKind[] { LAST, PREVIOUS, FIRST, @@ -114,11 +113,9 @@ public enum TimeLabelUseKind implements Enumerator */ public static TimeLabelUseKind get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) - { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { TimeLabelUseKind result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) - { + if (result.toString().equals(literal)) { return result; } } @@ -135,11 +132,9 @@ public enum TimeLabelUseKind implements Enumerator */ public static TimeLabelUseKind getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) - { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { TimeLabelUseKind result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) - { + if (result.getName().equals(name)) { return result; } } @@ -156,8 +151,7 @@ public enum TimeLabelUseKind implements Enumerator */ public static TimeLabelUseKind get(int value) { - switch (value) - { + switch (value) { case LAST_VALUE: return LAST; case PREVIOUS_VALUE: return PREVIOUS; case FIRST_VALUE: return FIRST; diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/UnassignedMemberTreatment.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/UnassignedMemberTreatment.java index a0e61288..f6ce4c73 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/UnassignedMemberTreatment.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/UnassignedMemberTreatment.java @@ -89,8 +89,7 @@ public enum UnassignedMemberTreatment implements Enumerator * @generated */ private static final UnassignedMemberTreatment[] VALUES_ARRAY = - new UnassignedMemberTreatment[] - { + new UnassignedMemberTreatment[] { UNDEFINED, ANY_VALUE, ANY_VALUE_OR_OMIT, @@ -114,11 +113,9 @@ public enum UnassignedMemberTreatment implements Enumerator */ public static UnassignedMemberTreatment get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) - { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { UnassignedMemberTreatment result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) - { + if (result.toString().equals(literal)) { return result; } } @@ -135,11 +132,9 @@ public enum UnassignedMemberTreatment implements Enumerator */ public static UnassignedMemberTreatment getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) - { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { UnassignedMemberTreatment result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) - { + if (result.getName().equals(name)) { return result; } } @@ -156,8 +151,7 @@ public enum UnassignedMemberTreatment implements Enumerator */ public static UnassignedMemberTreatment get(int value) { - switch (value) - { + switch (value) { case UNDEFINED_VALUE: return UNDEFINED; case ANY_VALUE_VALUE: return ANY_VALUE; case ANY_VALUE_OR_OMIT_VALUE: return ANY_VALUE_OR_OMIT; diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ActionBehaviourImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ActionBehaviourImpl.java index 225332b1..8494686c 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ActionBehaviourImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ActionBehaviourImpl.java @@ -4,22 +4,39 @@ package org.etsi.mts.tdl.impl; import java.lang.reflect.InvocationTargetException; +import java.util.Iterator; +import java.util.List; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.ids.IdResolver.IdResolverExtension; +import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsSetOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsTypeOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsKindOfOperation; +import org.eclipse.ocl.pivot.messages.PivotMessages; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SetValue; import org.etsi.mts.tdl.ActionBehaviour; import org.etsi.mts.tdl.AtomicBehaviour; import org.etsi.mts.tdl.Behaviour; +import org.etsi.mts.tdl.Block; import org.etsi.mts.tdl.ComponentInstance; +import org.etsi.mts.tdl.Element; +import org.etsi.mts.tdl.TestConfiguration; +import org.etsi.mts.tdl.TestDescription; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -75,12 +92,10 @@ public abstract class ActionBehaviourImpl extends AtomicBehaviourImpl implements @Override public ComponentInstance getComponentInstance() { - if (componentInstance != null && componentInstance.eIsProxy()) - { + if (componentInstance != null && componentInstance.eIsProxy()) { InternalEObject oldComponentInstance = (InternalEObject)componentInstance; componentInstance = (ComponentInstance)eResolveProxy(oldComponentInstance); - if (componentInstance != oldComponentInstance) - { + if (componentInstance != oldComponentInstance) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.ACTION_BEHAVIOUR__COMPONENT_INSTANCE, oldComponentInstance, componentInstance)); } @@ -112,16 +127,6 @@ public abstract class ActionBehaviourImpl extends AtomicBehaviourImpl implements eNotify(new ENotificationImpl(this, Notification.SET, tdlPackage.ACTION_BEHAVIOUR__COMPONENT_INSTANCE, oldComponentInstance, componentInstance)); } - /** - * The cached invocation delegate for the '{@link #getParticipatingComponents() Get Participating Components}' operation. - * - * - * @see #getParticipatingComponents() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.ACTION_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS).getInvocationDelegate(); - /** * * @@ -131,14 +136,126 @@ public abstract class ActionBehaviourImpl extends AtomicBehaviourImpl implements @Override public EList getParticipatingComponents() { - try - { - return (EList)GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if + * self.getParentTestDescription() + * ->exists(td | td.isLocallyOrdered) and + * self.container() + * .oclIsKindOf(Block) + * then + * if not self.componentInstance.oclIsUndefined() + * then OrderedSet{self.componentInstance} + * else + * self.container() + * .oclAsType(Block) + * .getParticipatingComponentsExcluding(self) + * ->asOrderedSet() + * endif + * else + * self.getParentTestDescription() + * .testConfiguration.componentInstance->asOrderedSet() + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_Block_0 = idResolver.getClass(tdlTables.CLSSid_Block, null); + final /*@NonInvalid*/ Element container = this.container(); + final /*@NonInvalid*/ TestDescription getParentTestDescription_0 = this.getParentTestDescription(); + final /*@NonInvalid*/ SetValue oclAsSet = OclAnyOclAsSetOperation.INSTANCE.evaluate(executor, tdlTables.SET_CLSSid_TestDescription, getParentTestDescription_0); + /*@Thrown*/ Object accumulator = ValueUtil.FALSE_VALUE; + Iterator ITERATOR_td = oclAsSet.iterator(); + /*@NonInvalid*/ Boolean exists; + while (true) { + if (!ITERATOR_td.hasNext()) { + if (accumulator == ValueUtil.FALSE_VALUE) { + exists = ValueUtil.FALSE_VALUE; + } + else { + throw (InvalidValueException)accumulator; + } + break; + } + /*@NonInvalid*/ TestDescription td = (TestDescription)ITERATOR_td.next(); + /** + * td.isLocallyOrdered + */ + final /*@NonInvalid*/ boolean isLocallyOrdered = td.isIsLocallyOrdered(); + // + if (isLocallyOrdered) { // Normal successful body evaluation result + exists = ValueUtil.TRUE_VALUE; + break; // Stop immediately + } + else if (!isLocallyOrdered) { // Normal unsuccessful body evaluation result + ; // Carry on + } + else { // Impossible badly typed result + accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "exists"); + } + } + final /*@Thrown*/ Boolean and; + if (exists == ValueUtil.FALSE_VALUE) { + and = ValueUtil.FALSE_VALUE; + } + else { + final /*@NonInvalid*/ boolean oclIsKindOf = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_Block_0).booleanValue(); + if (!oclIsKindOf) { + and = ValueUtil.FALSE_VALUE; + } + else { + if (exists == null) { + and = null; + } + else { + and = ValueUtil.TRUE_VALUE; + } + } + } + if (and == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ OrderedSetValue local_1; + if (and) { + final /*@NonInvalid*/ ComponentInstance componentInstance_0 = this.getComponentInstance(); + final /*@NonInvalid*/ boolean oclIsUndefined = componentInstance_0 == null; + final /*@NonInvalid*/ Boolean not; + if (!oclIsUndefined) { + not = ValueUtil.TRUE_VALUE; + } + else { + if (oclIsUndefined) { + not = ValueUtil.FALSE_VALUE; + } + else { + not = null; + } + } + if (not == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ OrderedSetValue local_0; + if (not) { + final /*@NonInvalid*/ OrderedSetValue OrderedSet = ValueUtil.createOrderedSetOfEach(tdlTables.ORD_CLSSid_ComponentInstance, componentInstance_0); + local_0 = OrderedSet; + } + else { + final /*@Thrown*/ Block oclAsType = (Block)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_Block_0); + final /*@Thrown*/ List getParticipatingComponentsExcluding = oclAsType.getParticipatingComponentsExcluding(this); + final /*@Thrown*/ OrderedSetValue BOXED_getParticipatingComponentsExcluding = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_ComponentInstance, getParticipatingComponentsExcluding); + final /*@Thrown*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(BOXED_getParticipatingComponentsExcluding); + local_0 = asOrderedSet; + } + local_1 = local_0; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + final /*@NonInvalid*/ TestConfiguration testConfiguration = getParentTestDescription_0.getTestConfiguration(); + final /*@NonInvalid*/ List componentInstance_1 = testConfiguration.getComponentInstance(); + final /*@NonInvalid*/ SetValue BOXED_componentInstance_1 = idResolver.createSetOfAll(tdlTables.SET_CLSSid_ComponentInstance, componentInstance_1); + final /*@NonInvalid*/ OrderedSetValue asOrderedSet_0 = CollectionAsOrderedSetOperation.INSTANCE.evaluate(BOXED_componentInstance_1); + local_1 = asOrderedSet_0; } + final /*@Thrown*/ List ECORE_local_1 = ((IdResolverExtension)idResolver).ecoreValueOfAll(ComponentInstance.class, local_1); + return (EList)ECORE_local_1; } /** @@ -149,8 +266,7 @@ public abstract class ActionBehaviourImpl extends AtomicBehaviourImpl implements @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ACTION_BEHAVIOUR__COMPONENT_INSTANCE: if (resolve) return getComponentInstance(); return basicGetComponentInstance(); @@ -166,8 +282,7 @@ public abstract class ActionBehaviourImpl extends AtomicBehaviourImpl implements @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ACTION_BEHAVIOUR__COMPONENT_INSTANCE: setComponentInstance((ComponentInstance)newValue); return; @@ -183,8 +298,7 @@ public abstract class ActionBehaviourImpl extends AtomicBehaviourImpl implements @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ACTION_BEHAVIOUR__COMPONENT_INSTANCE: setComponentInstance((ComponentInstance)null); return; @@ -200,8 +314,7 @@ public abstract class ActionBehaviourImpl extends AtomicBehaviourImpl implements @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ACTION_BEHAVIOUR__COMPONENT_INSTANCE: return componentInstance != null; } @@ -216,18 +329,14 @@ public abstract class ActionBehaviourImpl extends AtomicBehaviourImpl implements @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == Behaviour.class) - { - switch (baseOperationID) - { + if (baseClass == Behaviour.class) { + switch (baseOperationID) { case tdlPackage.BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return tdlPackage.ACTION_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS; default: return super.eDerivedOperationID(baseOperationID, baseClass); } } - if (baseClass == AtomicBehaviour.class) - { - switch (baseOperationID) - { + if (baseClass == AtomicBehaviour.class) { + switch (baseOperationID) { case tdlPackage.ATOMIC_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return tdlPackage.ACTION_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -243,8 +352,7 @@ public abstract class ActionBehaviourImpl extends AtomicBehaviourImpl implements @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.ACTION_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return getParticipatingComponents(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ActionImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ActionImpl.java index 38487376..1290a4b8 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ActionImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ActionImpl.java @@ -121,8 +121,7 @@ public class ActionImpl extends MappableDataElementImpl implements Action @Override public EList getFormalParameter() { - if (formalParameter == null) - { + if (formalParameter == null) { formalParameter = new EObjectContainmentEList(FormalParameter.class, this, tdlPackage.ACTION__FORMAL_PARAMETER); } return formalParameter; @@ -136,8 +135,7 @@ public class ActionImpl extends MappableDataElementImpl implements Action @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ACTION__FORMAL_PARAMETER: return ((InternalEList)getFormalParameter()).basicRemove(otherEnd, msgs); } @@ -152,8 +150,7 @@ public class ActionImpl extends MappableDataElementImpl implements Action @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ACTION__BODY: return getBody(); case tdlPackage.ACTION__FORMAL_PARAMETER: @@ -171,8 +168,7 @@ public class ActionImpl extends MappableDataElementImpl implements Action @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ACTION__BODY: setBody((String)newValue); return; @@ -192,8 +188,7 @@ public class ActionImpl extends MappableDataElementImpl implements Action @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ACTION__BODY: setBody(BODY_EDEFAULT); return; @@ -212,8 +207,7 @@ public class ActionImpl extends MappableDataElementImpl implements Action @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ACTION__BODY: return BODY_EDEFAULT == null ? body != null : !BODY_EDEFAULT.equals(body); case tdlPackage.ACTION__FORMAL_PARAMETER: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ActionReferenceImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ActionReferenceImpl.java index 8afe4f23..d00753b8 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ActionReferenceImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ActionReferenceImpl.java @@ -87,12 +87,10 @@ public class ActionReferenceImpl extends ActionBehaviourImpl implements ActionRe @Override public Action getAction() { - if (action != null && action.eIsProxy()) - { + if (action != null && action.eIsProxy()) { InternalEObject oldAction = (InternalEObject)action; action = (Action)eResolveProxy(oldAction); - if (action != oldAction) - { + if (action != oldAction) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.ACTION_REFERENCE__ACTION, oldAction, action)); } @@ -132,8 +130,7 @@ public class ActionReferenceImpl extends ActionBehaviourImpl implements ActionRe @Override public EList getArgument() { - if (argument == null) - { + if (argument == null) { argument = new EObjectContainmentEList(ParameterBinding.class, this, tdlPackage.ACTION_REFERENCE__ARGUMENT); } return argument; @@ -147,8 +144,7 @@ public class ActionReferenceImpl extends ActionBehaviourImpl implements ActionRe @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ACTION_REFERENCE__ARGUMENT: return ((InternalEList)getArgument()).basicRemove(otherEnd, msgs); } @@ -163,8 +159,7 @@ public class ActionReferenceImpl extends ActionBehaviourImpl implements ActionRe @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ACTION_REFERENCE__ACTION: if (resolve) return getAction(); return basicGetAction(); @@ -183,8 +178,7 @@ public class ActionReferenceImpl extends ActionBehaviourImpl implements ActionRe @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ACTION_REFERENCE__ACTION: setAction((Action)newValue); return; @@ -204,8 +198,7 @@ public class ActionReferenceImpl extends ActionBehaviourImpl implements ActionRe @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ACTION_REFERENCE__ACTION: setAction((Action)null); return; @@ -224,8 +217,7 @@ public class ActionReferenceImpl extends ActionBehaviourImpl implements ActionRe @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ACTION_REFERENCE__ACTION: return action != null; case tdlPackage.ACTION_REFERENCE__ARGUMENT: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AnnotationImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AnnotationImpl.java index 25149c68..2e4e6447 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AnnotationImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AnnotationImpl.java @@ -118,12 +118,10 @@ public class AnnotationImpl extends ElementImpl implements Annotation @Override public AnnotationType getKey() { - if (key != null && key.eIsProxy()) - { + if (key != null && key.eIsProxy()) { InternalEObject oldKey = (InternalEObject)key; key = (AnnotationType)eResolveProxy(oldKey); - if (key != oldKey) - { + if (key != oldKey) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.ANNOTATION__KEY, oldKey, key)); } @@ -186,8 +184,7 @@ public class AnnotationImpl extends ElementImpl implements Annotation @Override public void setAnnotatedElement(Element newAnnotatedElement) { - if (newAnnotatedElement != eInternalContainer() || (eContainerFeatureID() != tdlPackage.ANNOTATION__ANNOTATED_ELEMENT && newAnnotatedElement != null)) - { + if (newAnnotatedElement != eInternalContainer() || (eContainerFeatureID() != tdlPackage.ANNOTATION__ANNOTATED_ELEMENT && newAnnotatedElement != null)) { if (EcoreUtil.isAncestor(this, newAnnotatedElement)) throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); NotificationChain msgs = null; @@ -210,8 +207,7 @@ public class AnnotationImpl extends ElementImpl implements Annotation @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ANNOTATION__ANNOTATED_ELEMENT: if (eInternalContainer() != null) msgs = eBasicRemoveFromContainer(msgs); @@ -228,8 +224,7 @@ public class AnnotationImpl extends ElementImpl implements Annotation @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ANNOTATION__ANNOTATED_ELEMENT: return basicSetAnnotatedElement(null, msgs); } @@ -244,8 +239,7 @@ public class AnnotationImpl extends ElementImpl implements Annotation @Override public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { - switch (eContainerFeatureID()) - { + switch (eContainerFeatureID()) { case tdlPackage.ANNOTATION__ANNOTATED_ELEMENT: return eInternalContainer().eInverseRemove(this, tdlPackage.ELEMENT__ANNOTATION, Element.class, msgs); } @@ -260,8 +254,7 @@ public class AnnotationImpl extends ElementImpl implements Annotation @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ANNOTATION__VALUE: return getValue(); case tdlPackage.ANNOTATION__KEY: @@ -281,8 +274,7 @@ public class AnnotationImpl extends ElementImpl implements Annotation @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ANNOTATION__VALUE: setValue((String)newValue); return; @@ -304,8 +296,7 @@ public class AnnotationImpl extends ElementImpl implements Annotation @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ANNOTATION__VALUE: setValue(VALUE_EDEFAULT); return; @@ -327,8 +318,7 @@ public class AnnotationImpl extends ElementImpl implements Annotation @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ANNOTATION__VALUE: return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); case tdlPackage.ANNOTATION__KEY: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AnnotationTypeImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AnnotationTypeImpl.java index 1dedabac..4a1fb3ce 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AnnotationTypeImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AnnotationTypeImpl.java @@ -80,8 +80,7 @@ public class AnnotationTypeImpl extends PackageableElementImpl implements Annota { Extension oldExtension = extension; extension = newExtension; - if (eNotificationRequired()) - { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, tdlPackage.ANNOTATION_TYPE__EXTENSION, oldExtension, newExtension); if (msgs == null) msgs = notification; else msgs.add(notification); } @@ -96,8 +95,7 @@ public class AnnotationTypeImpl extends PackageableElementImpl implements Annota @Override public void setExtension(Extension newExtension) { - if (newExtension != extension) - { + if (newExtension != extension) { NotificationChain msgs = null; if (extension != null) msgs = ((InternalEObject)extension).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - tdlPackage.ANNOTATION_TYPE__EXTENSION, null, msgs); @@ -118,8 +116,7 @@ public class AnnotationTypeImpl extends PackageableElementImpl implements Annota @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ANNOTATION_TYPE__EXTENSION: return basicSetExtension(null, msgs); } @@ -134,8 +131,7 @@ public class AnnotationTypeImpl extends PackageableElementImpl implements Annota @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ANNOTATION_TYPE__EXTENSION: return getExtension(); } @@ -150,8 +146,7 @@ public class AnnotationTypeImpl extends PackageableElementImpl implements Annota @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ANNOTATION_TYPE__EXTENSION: setExtension((Extension)newValue); return; @@ -167,8 +162,7 @@ public class AnnotationTypeImpl extends PackageableElementImpl implements Annota @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ANNOTATION_TYPE__EXTENSION: setExtension((Extension)null); return; @@ -184,8 +178,7 @@ public class AnnotationTypeImpl extends PackageableElementImpl implements Annota @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ANNOTATION_TYPE__EXTENSION: return extension != null; } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AnyValueImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AnyValueImpl.java index 362fd761..0a40ed0b 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AnyValueImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AnyValueImpl.java @@ -7,19 +7,33 @@ import java.lang.reflect.InvocationTargetException; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsTypeOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsTypeOfOperation; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; import org.etsi.mts.tdl.AnyValue; +import org.etsi.mts.tdl.CollectionDataInstance; +import org.etsi.mts.tdl.CollectionDataType; +import org.etsi.mts.tdl.DataElementUse; +import org.etsi.mts.tdl.DataInstanceUse; import org.etsi.mts.tdl.DataType; import org.etsi.mts.tdl.DataUse; +import org.etsi.mts.tdl.Element; +import org.etsi.mts.tdl.Member; +import org.etsi.mts.tdl.MemberAssignment; +import org.etsi.mts.tdl.Parameter; +import org.etsi.mts.tdl.ParameterBinding; import org.etsi.mts.tdl.SpecialValueUse; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -75,12 +89,10 @@ public class AnyValueImpl extends SpecialValueUseImpl implements AnyValue @Override public DataType getDataType() { - if (dataType != null && dataType.eIsProxy()) - { + if (dataType != null && dataType.eIsProxy()) { InternalEObject oldDataType = (InternalEObject)dataType; dataType = (DataType)eResolveProxy(oldDataType); - if (dataType != oldDataType) - { + if (dataType != oldDataType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.ANY_VALUE__DATA_TYPE, oldDataType, dataType)); } @@ -112,16 +124,6 @@ public class AnyValueImpl extends SpecialValueUseImpl implements AnyValue eNotify(new ENotificationImpl(this, Notification.SET, tdlPackage.ANY_VALUE__DATA_TYPE, oldDataType, dataType)); } - /** - * The cached invocation delegate for the '{@link #resolveDataType() Resolve Data Type}' operation. - * - * - * @see #resolveDataType() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate RESOLVE_DATA_TYPE__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.ANY_VALUE___RESOLVE_DATA_TYPE).getInvocationDelegate(); - /** * * @@ -130,14 +132,144 @@ public class AnyValueImpl extends SpecialValueUseImpl implements AnyValue @Override public DataType resolveDataType() { - try - { - return (DataType)RESOLVE_DATA_TYPE__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if not self.dataType.oclIsUndefined() + * then self.dataType + * else + * if self.container().oclIsTypeOf(MemberAssignment) + * then + * self.container() + * .oclAsType(MemberAssignment).member.dataType + * else + * if self.container().oclIsTypeOf(ParameterBinding) + * then + * self.container() + * .oclAsType(ParameterBinding).parameter.dataType + * else + * if + * self.container() + * .oclIsTypeOf(CollectionDataInstance) + * then + * self.container() + * .oclAsType(CollectionDataInstance) + * .dataType.oclAsType(CollectionDataType).itemType + * else + * if self.container().oclIsTypeOf(DataElementUse) + * then + * self.container() + * .oclAsType(DataElementUse) + * .resolveDataType() + * .oclAsType(CollectionDataType).itemType + * else + * if self.container().oclIsTypeOf(DataInstanceUse) + * then + * self.container() + * .oclAsType(DataInstanceUse) + * .resolveDataType() + * .oclAsType(CollectionDataType).itemType + * else null + * endif + * endif + * endif + * endif + * endif + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ DataType dataType_0 = this.getDataType(); + final /*@NonInvalid*/ boolean oclIsUndefined = dataType_0 == null; + final /*@NonInvalid*/ Boolean not; + if (!oclIsUndefined) { + not = ValueUtil.TRUE_VALUE; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + if (oclIsUndefined) { + not = ValueUtil.FALSE_VALUE; + } + else { + not = null; + } + } + if (not == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ DataType local_5; + if (not) { + local_5 = dataType_0; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_MemberAssignment_0 = idResolver.getClass(tdlTables.CLSSid_MemberAssignment, null); + final /*@NonInvalid*/ Element container = this.container(); + final /*@NonInvalid*/ boolean oclIsTypeOf = OclAnyOclIsTypeOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_MemberAssignment_0).booleanValue(); + /*@Thrown*/ DataType local_4; + if (oclIsTypeOf) { + final /*@Thrown*/ MemberAssignment oclAsType = (MemberAssignment)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_MemberAssignment_0); + final /*@Thrown*/ Member member = oclAsType.getMember(); + final /*@Thrown*/ DataType dataType_1 = member.getDataType(); + local_4 = dataType_1; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_ParameterBinding_0 = idResolver.getClass(tdlTables.CLSSid_ParameterBinding, null); + final /*@NonInvalid*/ boolean oclIsTypeOf_0 = OclAnyOclIsTypeOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_ParameterBinding_0).booleanValue(); + /*@Thrown*/ DataType local_3; + if (oclIsTypeOf_0) { + final /*@Thrown*/ ParameterBinding oclAsType_0 = (ParameterBinding)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_ParameterBinding_0); + final /*@Thrown*/ Parameter parameter = oclAsType_0.getParameter(); + final /*@Thrown*/ DataType dataType_2 = parameter.getDataType(); + local_3 = dataType_2; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_CollectionDataInstance_0 = idResolver.getClass(tdlTables.CLSSid_CollectionDataInstance, null); + final /*@NonInvalid*/ boolean oclIsTypeOf_1 = OclAnyOclIsTypeOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_CollectionDataInstance_0).booleanValue(); + /*@Thrown*/ DataType local_2; + if (oclIsTypeOf_1) { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_CollectionDataType_0 = idResolver.getClass(tdlTables.CLSSid_CollectionDataType, null); + final /*@Thrown*/ CollectionDataInstance oclAsType_1 = (CollectionDataInstance)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_CollectionDataInstance_0); + final /*@Thrown*/ DataType dataType_3 = oclAsType_1.getDataType(); + final /*@Thrown*/ CollectionDataType oclAsType_2 = (CollectionDataType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, dataType_3, TYP_tdl_c_c_CollectionDataType_0); + final /*@Thrown*/ DataType itemType = oclAsType_2.getItemType(); + local_2 = itemType; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_DataElementUse_0 = idResolver.getClass(tdlTables.CLSSid_DataElementUse, null); + final /*@NonInvalid*/ boolean oclIsTypeOf_2 = OclAnyOclIsTypeOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_DataElementUse_0).booleanValue(); + /*@Thrown*/ DataType local_1; + if (oclIsTypeOf_2) { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_CollectionDataType_1 = idResolver.getClass(tdlTables.CLSSid_CollectionDataType, null); + final /*@Thrown*/ DataElementUse oclAsType_3 = (DataElementUse)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_DataElementUse_0); + final /*@Thrown*/ DataType resolveDataType = oclAsType_3.resolveDataType(); + final /*@Thrown*/ CollectionDataType oclAsType_4 = (CollectionDataType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, resolveDataType, TYP_tdl_c_c_CollectionDataType_1); + final /*@Thrown*/ DataType itemType_0 = oclAsType_4.getItemType(); + local_1 = itemType_0; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_DataInstanceUse_0 = idResolver.getClass(tdlTables.CLSSid_DataInstanceUse, null); + final /*@NonInvalid*/ boolean oclIsTypeOf_3 = OclAnyOclIsTypeOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_DataInstanceUse_0).booleanValue(); + /*@Thrown*/ DataType local_0; + if (oclIsTypeOf_3) { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_CollectionDataType_2 = idResolver.getClass(tdlTables.CLSSid_CollectionDataType, null); + final /*@Thrown*/ DataInstanceUse oclAsType_5 = (DataInstanceUse)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_DataInstanceUse_0); + final /*@Thrown*/ DataType resolveDataType_0 = oclAsType_5.resolveDataType(); + final /*@Thrown*/ CollectionDataType oclAsType_6 = (CollectionDataType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, resolveDataType_0, TYP_tdl_c_c_CollectionDataType_2); + final /*@Thrown*/ DataType itemType_1 = oclAsType_6.getItemType(); + local_0 = itemType_1; + } + else { + local_0 = null; + } + local_1 = local_0; + } + local_2 = local_1; + } + local_3 = local_2; + } + local_4 = local_3; + } + local_5 = local_4; } + return local_5; } /** @@ -148,8 +280,7 @@ public class AnyValueImpl extends SpecialValueUseImpl implements AnyValue @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ANY_VALUE__DATA_TYPE: if (resolve) return getDataType(); return basicGetDataType(); @@ -165,8 +296,7 @@ public class AnyValueImpl extends SpecialValueUseImpl implements AnyValue @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ANY_VALUE__DATA_TYPE: setDataType((DataType)newValue); return; @@ -182,8 +312,7 @@ public class AnyValueImpl extends SpecialValueUseImpl implements AnyValue @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ANY_VALUE__DATA_TYPE: setDataType((DataType)null); return; @@ -199,8 +328,7 @@ public class AnyValueImpl extends SpecialValueUseImpl implements AnyValue @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ANY_VALUE__DATA_TYPE: return dataType != null; } @@ -215,18 +343,14 @@ public class AnyValueImpl extends SpecialValueUseImpl implements AnyValue @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == DataUse.class) - { - switch (baseOperationID) - { + if (baseClass == DataUse.class) { + switch (baseOperationID) { case tdlPackage.DATA_USE___RESOLVE_DATA_TYPE: return tdlPackage.ANY_VALUE___RESOLVE_DATA_TYPE; default: return super.eDerivedOperationID(baseOperationID, baseClass); } } - if (baseClass == SpecialValueUse.class) - { - switch (baseOperationID) - { + if (baseClass == SpecialValueUse.class) { + switch (baseOperationID) { case tdlPackage.SPECIAL_VALUE_USE___RESOLVE_DATA_TYPE: return tdlPackage.ANY_VALUE___RESOLVE_DATA_TYPE; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -242,8 +366,7 @@ public class AnyValueImpl extends SpecialValueUseImpl implements AnyValue @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.ANY_VALUE___RESOLVE_DATA_TYPE: return resolveDataType(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AssertionImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AssertionImpl.java index 37ba40f9..5b7910a5 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AssertionImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AssertionImpl.java @@ -91,8 +91,7 @@ public class AssertionImpl extends ActionBehaviourImpl implements Assertion { DataUse oldOtherwise = otherwise; otherwise = newOtherwise; - if (eNotificationRequired()) - { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, tdlPackage.ASSERTION__OTHERWISE, oldOtherwise, newOtherwise); if (msgs == null) msgs = notification; else msgs.add(notification); } @@ -107,8 +106,7 @@ public class AssertionImpl extends ActionBehaviourImpl implements Assertion @Override public void setOtherwise(DataUse newOtherwise) { - if (newOtherwise != otherwise) - { + if (newOtherwise != otherwise) { NotificationChain msgs = null; if (otherwise != null) msgs = ((InternalEObject)otherwise).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - tdlPackage.ASSERTION__OTHERWISE, null, msgs); @@ -141,8 +139,7 @@ public class AssertionImpl extends ActionBehaviourImpl implements Assertion { DataUse oldCondition = condition; condition = newCondition; - if (eNotificationRequired()) - { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, tdlPackage.ASSERTION__CONDITION, oldCondition, newCondition); if (msgs == null) msgs = notification; else msgs.add(notification); } @@ -157,8 +154,7 @@ public class AssertionImpl extends ActionBehaviourImpl implements Assertion @Override public void setCondition(DataUse newCondition) { - if (newCondition != condition) - { + if (newCondition != condition) { NotificationChain msgs = null; if (condition != null) msgs = ((InternalEObject)condition).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - tdlPackage.ASSERTION__CONDITION, null, msgs); @@ -179,8 +175,7 @@ public class AssertionImpl extends ActionBehaviourImpl implements Assertion @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ASSERTION__OTHERWISE: return basicSetOtherwise(null, msgs); case tdlPackage.ASSERTION__CONDITION: @@ -197,8 +192,7 @@ public class AssertionImpl extends ActionBehaviourImpl implements Assertion @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ASSERTION__OTHERWISE: return getOtherwise(); case tdlPackage.ASSERTION__CONDITION: @@ -215,8 +209,7 @@ public class AssertionImpl extends ActionBehaviourImpl implements Assertion @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ASSERTION__OTHERWISE: setOtherwise((DataUse)newValue); return; @@ -235,8 +228,7 @@ public class AssertionImpl extends ActionBehaviourImpl implements Assertion @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ASSERTION__OTHERWISE: setOtherwise((DataUse)null); return; @@ -255,8 +247,7 @@ public class AssertionImpl extends ActionBehaviourImpl implements Assertion @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ASSERTION__OTHERWISE: return otherwise != null; case tdlPackage.ASSERTION__CONDITION: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AssignmentImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AssignmentImpl.java index 4d990818..ee17f452 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AssignmentImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AssignmentImpl.java @@ -4,25 +4,42 @@ package org.etsi.mts.tdl.impl; import java.lang.reflect.InvocationTargetException; +import java.util.Iterator; +import java.util.List; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.ids.IdResolver.IdResolverExtension; +import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsSetOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsTypeOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsKindOfOperation; +import org.eclipse.ocl.pivot.messages.PivotMessages; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SetValue; import org.etsi.mts.tdl.Assignment; import org.etsi.mts.tdl.AtomicBehaviour; import org.etsi.mts.tdl.Behaviour; +import org.etsi.mts.tdl.Block; import org.etsi.mts.tdl.ComponentInstance; import org.etsi.mts.tdl.DataUse; +import org.etsi.mts.tdl.Element; +import org.etsi.mts.tdl.TestConfiguration; +import org.etsi.mts.tdl.TestDescription; import org.etsi.mts.tdl.VariableUse; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -101,8 +118,7 @@ public class AssignmentImpl extends AtomicBehaviourImpl implements Assignment { VariableUse oldVariable = variable; variable = newVariable; - if (eNotificationRequired()) - { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, tdlPackage.ASSIGNMENT__VARIABLE, oldVariable, newVariable); if (msgs == null) msgs = notification; else msgs.add(notification); } @@ -117,8 +133,7 @@ public class AssignmentImpl extends AtomicBehaviourImpl implements Assignment @Override public void setVariable(VariableUse newVariable) { - if (newVariable != variable) - { + if (newVariable != variable) { NotificationChain msgs = null; if (variable != null) msgs = ((InternalEObject)variable).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - tdlPackage.ASSIGNMENT__VARIABLE, null, msgs); @@ -151,8 +166,7 @@ public class AssignmentImpl extends AtomicBehaviourImpl implements Assignment { DataUse oldExpression = expression; expression = newExpression; - if (eNotificationRequired()) - { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, tdlPackage.ASSIGNMENT__EXPRESSION, oldExpression, newExpression); if (msgs == null) msgs = notification; else msgs.add(notification); } @@ -167,8 +181,7 @@ public class AssignmentImpl extends AtomicBehaviourImpl implements Assignment @Override public void setExpression(DataUse newExpression) { - if (newExpression != expression) - { + if (newExpression != expression) { NotificationChain msgs = null; if (expression != null) msgs = ((InternalEObject)expression).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - tdlPackage.ASSIGNMENT__EXPRESSION, null, msgs); @@ -181,16 +194,6 @@ public class AssignmentImpl extends AtomicBehaviourImpl implements Assignment eNotify(new ENotificationImpl(this, Notification.SET, tdlPackage.ASSIGNMENT__EXPRESSION, newExpression, newExpression)); } - /** - * The cached invocation delegate for the '{@link #getParticipatingComponents() Get Participating Components}' operation. - * - * - * @see #getParticipatingComponents() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.ASSIGNMENT___GET_PARTICIPATING_COMPONENTS).getInvocationDelegate(); - /** * * @@ -200,14 +203,115 @@ public class AssignmentImpl extends AtomicBehaviourImpl implements Assignment @Override public EList getParticipatingComponents() { - try - { - return (EList)GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if + * self.getParentTestDescription() + * ->exists(td | td.isLocallyOrdered) and + * self.container() + * .oclIsKindOf(Block) + * then + * if not self.variable.componentInstance.oclIsUndefined() + * then OrderedSet{self.variable.componentInstance} + * else + * self.container() + * .oclAsType(Block) + * .getParticipatingComponentsExcluding(self) + * ->asOrderedSet() + * endif + * else + * self.getParentTestDescription() + * .testConfiguration.componentInstance->asOrderedSet() + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_Block_0 = idResolver.getClass(tdlTables.CLSSid_Block, null); + final /*@NonInvalid*/ Element container = this.container(); + final /*@NonInvalid*/ TestDescription getParentTestDescription_0 = this.getParentTestDescription(); + final /*@NonInvalid*/ SetValue oclAsSet = OclAnyOclAsSetOperation.INSTANCE.evaluate(executor, tdlTables.SET_CLSSid_TestDescription, getParentTestDescription_0); + /*@Thrown*/ Object accumulator = ValueUtil.FALSE_VALUE; + Iterator ITERATOR_td = oclAsSet.iterator(); + /*@NonInvalid*/ Boolean exists; + while (true) { + if (!ITERATOR_td.hasNext()) { + if (accumulator == ValueUtil.FALSE_VALUE) { + exists = ValueUtil.FALSE_VALUE; + } + else { + throw (InvalidValueException)accumulator; + } + break; + } + /*@NonInvalid*/ TestDescription td = (TestDescription)ITERATOR_td.next(); + /** + * td.isLocallyOrdered + */ + final /*@NonInvalid*/ boolean isLocallyOrdered = td.isIsLocallyOrdered(); + // + if (isLocallyOrdered) { // Normal successful body evaluation result + exists = ValueUtil.TRUE_VALUE; + break; // Stop immediately + } + else if (!isLocallyOrdered) { // Normal unsuccessful body evaluation result + ; // Carry on + } + else { // Impossible badly typed result + accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "exists"); + } + } + final /*@Thrown*/ Boolean and; + if (exists == ValueUtil.FALSE_VALUE) { + and = ValueUtil.FALSE_VALUE; + } + else { + final /*@NonInvalid*/ boolean oclIsKindOf = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_Block_0).booleanValue(); + if (!oclIsKindOf) { + and = ValueUtil.FALSE_VALUE; + } + else { + if (exists == null) { + and = null; + } + else { + and = ValueUtil.TRUE_VALUE; + } + } + } + if (and == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ OrderedSetValue local_1; + if (and) { + final /*@NonInvalid*/ Boolean not = ValueUtil.TRUE_VALUE; + if (not == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ OrderedSetValue local_0; + if (not) { + final /*@NonInvalid*/ VariableUse variable = this.getVariable(); + final /*@NonInvalid*/ ComponentInstance componentInstance = variable.getComponentInstance(); + final /*@NonInvalid*/ OrderedSetValue OrderedSet = ValueUtil.createOrderedSetOfEach(tdlTables.ORD_CLSSid_ComponentInstance, componentInstance); + local_0 = OrderedSet; + } + else { + final /*@Thrown*/ Block oclAsType = (Block)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_Block_0); + final /*@Thrown*/ List getParticipatingComponentsExcluding = oclAsType.getParticipatingComponentsExcluding(this); + final /*@Thrown*/ OrderedSetValue BOXED_getParticipatingComponentsExcluding = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_ComponentInstance, getParticipatingComponentsExcluding); + final /*@Thrown*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(BOXED_getParticipatingComponentsExcluding); + local_0 = asOrderedSet; + } + local_1 = local_0; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + final /*@NonInvalid*/ TestConfiguration testConfiguration = getParentTestDescription_0.getTestConfiguration(); + final /*@NonInvalid*/ List componentInstance_0 = testConfiguration.getComponentInstance(); + final /*@NonInvalid*/ SetValue BOXED_componentInstance_0 = idResolver.createSetOfAll(tdlTables.SET_CLSSid_ComponentInstance, componentInstance_0); + final /*@NonInvalid*/ OrderedSetValue asOrderedSet_0 = CollectionAsOrderedSetOperation.INSTANCE.evaluate(BOXED_componentInstance_0); + local_1 = asOrderedSet_0; } + final /*@Thrown*/ List ECORE_local_1 = ((IdResolverExtension)idResolver).ecoreValueOfAll(ComponentInstance.class, local_1); + return (EList)ECORE_local_1; } /** @@ -218,8 +322,7 @@ public class AssignmentImpl extends AtomicBehaviourImpl implements Assignment @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ASSIGNMENT__VARIABLE: return basicSetVariable(null, msgs); case tdlPackage.ASSIGNMENT__EXPRESSION: @@ -236,8 +339,7 @@ public class AssignmentImpl extends AtomicBehaviourImpl implements Assignment @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ASSIGNMENT__VARIABLE: return getVariable(); case tdlPackage.ASSIGNMENT__EXPRESSION: @@ -254,8 +356,7 @@ public class AssignmentImpl extends AtomicBehaviourImpl implements Assignment @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ASSIGNMENT__VARIABLE: setVariable((VariableUse)newValue); return; @@ -274,8 +375,7 @@ public class AssignmentImpl extends AtomicBehaviourImpl implements Assignment @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ASSIGNMENT__VARIABLE: setVariable((VariableUse)null); return; @@ -294,8 +394,7 @@ public class AssignmentImpl extends AtomicBehaviourImpl implements Assignment @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ASSIGNMENT__VARIABLE: return variable != null; case tdlPackage.ASSIGNMENT__EXPRESSION: @@ -312,18 +411,14 @@ public class AssignmentImpl extends AtomicBehaviourImpl implements Assignment @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == Behaviour.class) - { - switch (baseOperationID) - { + if (baseClass == Behaviour.class) { + switch (baseOperationID) { case tdlPackage.BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return tdlPackage.ASSIGNMENT___GET_PARTICIPATING_COMPONENTS; default: return super.eDerivedOperationID(baseOperationID, baseClass); } } - if (baseClass == AtomicBehaviour.class) - { - switch (baseOperationID) - { + if (baseClass == AtomicBehaviour.class) { + switch (baseOperationID) { case tdlPackage.ATOMIC_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return tdlPackage.ASSIGNMENT___GET_PARTICIPATING_COMPONENTS; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -339,8 +434,7 @@ public class AssignmentImpl extends AtomicBehaviourImpl implements Assignment @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.ASSIGNMENT___GET_PARTICIPATING_COMPONENTS: return getParticipatingComponents(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AtomicBehaviourImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AtomicBehaviourImpl.java index 661d8d95..e41b9c14 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AtomicBehaviourImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/AtomicBehaviourImpl.java @@ -6,14 +6,13 @@ import java.lang.reflect.InvocationTargetException; import java.util.Collection; +import java.util.Iterator; +import java.util.List; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; @@ -21,12 +20,30 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.ids.IdResolver.IdResolverExtension; +import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsSetOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsTypeOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsKindOfOperation; +import org.eclipse.ocl.pivot.messages.PivotMessages; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SetValue; import org.etsi.mts.tdl.AtomicBehaviour; import org.etsi.mts.tdl.Behaviour; +import org.etsi.mts.tdl.Block; import org.etsi.mts.tdl.ComponentInstance; +import org.etsi.mts.tdl.Element; +import org.etsi.mts.tdl.TestConfiguration; +import org.etsi.mts.tdl.TestDescription; import org.etsi.mts.tdl.TimeConstraint; import org.etsi.mts.tdl.TimeLabel; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -93,8 +110,7 @@ public abstract class AtomicBehaviourImpl extends BehaviourImpl implements Atomi @Override public EList getTimeConstraint() { - if (timeConstraint == null) - { + if (timeConstraint == null) { timeConstraint = new EObjectContainmentEList(TimeConstraint.class, this, tdlPackage.ATOMIC_BEHAVIOUR__TIME_CONSTRAINT); } return timeConstraint; @@ -120,8 +136,7 @@ public abstract class AtomicBehaviourImpl extends BehaviourImpl implements Atomi { TimeLabel oldTimeLabel = timeLabel; timeLabel = newTimeLabel; - if (eNotificationRequired()) - { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, tdlPackage.ATOMIC_BEHAVIOUR__TIME_LABEL, oldTimeLabel, newTimeLabel); if (msgs == null) msgs = notification; else msgs.add(notification); } @@ -136,8 +151,7 @@ public abstract class AtomicBehaviourImpl extends BehaviourImpl implements Atomi @Override public void setTimeLabel(TimeLabel newTimeLabel) { - if (newTimeLabel != timeLabel) - { + if (newTimeLabel != timeLabel) { NotificationChain msgs = null; if (timeLabel != null) msgs = ((InternalEObject)timeLabel).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - tdlPackage.ATOMIC_BEHAVIOUR__TIME_LABEL, null, msgs); @@ -150,16 +164,6 @@ public abstract class AtomicBehaviourImpl extends BehaviourImpl implements Atomi eNotify(new ENotificationImpl(this, Notification.SET, tdlPackage.ATOMIC_BEHAVIOUR__TIME_LABEL, newTimeLabel, newTimeLabel)); } - /** - * The cached invocation delegate for the '{@link #getParticipatingComponents() Get Participating Components}' operation. - * - * - * @see #getParticipatingComponents() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.ATOMIC_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS).getInvocationDelegate(); - /** * * @@ -169,14 +173,97 @@ public abstract class AtomicBehaviourImpl extends BehaviourImpl implements Atomi @Override public EList getParticipatingComponents() { - try - { - return (EList)GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if + * self.getParentTestDescription() + * ->exists(td | td.isLocallyOrdered) and + * self.container() + * .oclIsKindOf(Block) + * then + * self.container() + * .oclAsType(Block) + * .getParticipatingComponentsExcluding(self) + * ->asOrderedSet() + * else + * self.getParentTestDescription() + * .testConfiguration.componentInstance->asOrderedSet() + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_Block_0 = idResolver.getClass(tdlTables.CLSSid_Block, null); + final /*@NonInvalid*/ Element container = this.container(); + final /*@NonInvalid*/ TestDescription getParentTestDescription_0 = this.getParentTestDescription(); + final /*@NonInvalid*/ SetValue oclAsSet = OclAnyOclAsSetOperation.INSTANCE.evaluate(executor, tdlTables.SET_CLSSid_TestDescription, getParentTestDescription_0); + /*@Thrown*/ Object accumulator = ValueUtil.FALSE_VALUE; + Iterator ITERATOR_td = oclAsSet.iterator(); + /*@NonInvalid*/ Boolean exists; + while (true) { + if (!ITERATOR_td.hasNext()) { + if (accumulator == ValueUtil.FALSE_VALUE) { + exists = ValueUtil.FALSE_VALUE; + } + else { + throw (InvalidValueException)accumulator; + } + break; + } + /*@NonInvalid*/ TestDescription td = (TestDescription)ITERATOR_td.next(); + /** + * td.isLocallyOrdered + */ + final /*@NonInvalid*/ boolean isLocallyOrdered = td.isIsLocallyOrdered(); + // + if (isLocallyOrdered) { // Normal successful body evaluation result + exists = ValueUtil.TRUE_VALUE; + break; // Stop immediately + } + else if (!isLocallyOrdered) { // Normal unsuccessful body evaluation result + ; // Carry on + } + else { // Impossible badly typed result + accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "exists"); + } + } + final /*@Thrown*/ Boolean and; + if (exists == ValueUtil.FALSE_VALUE) { + and = ValueUtil.FALSE_VALUE; + } + else { + final /*@NonInvalid*/ boolean oclIsKindOf = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_Block_0).booleanValue(); + if (!oclIsKindOf) { + and = ValueUtil.FALSE_VALUE; + } + else { + if (exists == null) { + and = null; + } + else { + and = ValueUtil.TRUE_VALUE; + } + } + } + if (and == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ OrderedSetValue local_0; + if (and) { + final /*@Thrown*/ Block oclAsType = (Block)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_Block_0); + final /*@Thrown*/ List getParticipatingComponentsExcluding = oclAsType.getParticipatingComponentsExcluding(this); + final /*@Thrown*/ OrderedSetValue BOXED_getParticipatingComponentsExcluding = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_ComponentInstance, getParticipatingComponentsExcluding); + final /*@Thrown*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(BOXED_getParticipatingComponentsExcluding); + local_0 = asOrderedSet; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + final /*@NonInvalid*/ TestConfiguration testConfiguration = getParentTestDescription_0.getTestConfiguration(); + final /*@NonInvalid*/ List componentInstance = testConfiguration.getComponentInstance(); + final /*@NonInvalid*/ SetValue BOXED_componentInstance = idResolver.createSetOfAll(tdlTables.SET_CLSSid_ComponentInstance, componentInstance); + final /*@NonInvalid*/ OrderedSetValue asOrderedSet_0 = CollectionAsOrderedSetOperation.INSTANCE.evaluate(BOXED_componentInstance); + local_0 = asOrderedSet_0; } + final /*@Thrown*/ List ECORE_local_0 = ((IdResolverExtension)idResolver).ecoreValueOfAll(ComponentInstance.class, local_0); + return (EList)ECORE_local_0; } /** @@ -187,8 +274,7 @@ public abstract class AtomicBehaviourImpl extends BehaviourImpl implements Atomi @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ATOMIC_BEHAVIOUR__TIME_CONSTRAINT: return ((InternalEList)getTimeConstraint()).basicRemove(otherEnd, msgs); case tdlPackage.ATOMIC_BEHAVIOUR__TIME_LABEL: @@ -205,8 +291,7 @@ public abstract class AtomicBehaviourImpl extends BehaviourImpl implements Atomi @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ATOMIC_BEHAVIOUR__TIME_CONSTRAINT: return getTimeConstraint(); case tdlPackage.ATOMIC_BEHAVIOUR__TIME_LABEL: @@ -224,8 +309,7 @@ public abstract class AtomicBehaviourImpl extends BehaviourImpl implements Atomi @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ATOMIC_BEHAVIOUR__TIME_CONSTRAINT: getTimeConstraint().clear(); getTimeConstraint().addAll((Collection)newValue); @@ -245,8 +329,7 @@ public abstract class AtomicBehaviourImpl extends BehaviourImpl implements Atomi @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ATOMIC_BEHAVIOUR__TIME_CONSTRAINT: getTimeConstraint().clear(); return; @@ -265,8 +348,7 @@ public abstract class AtomicBehaviourImpl extends BehaviourImpl implements Atomi @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ATOMIC_BEHAVIOUR__TIME_CONSTRAINT: return timeConstraint != null && !timeConstraint.isEmpty(); case tdlPackage.ATOMIC_BEHAVIOUR__TIME_LABEL: @@ -283,10 +365,8 @@ public abstract class AtomicBehaviourImpl extends BehaviourImpl implements Atomi @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == Behaviour.class) - { - switch (baseOperationID) - { + if (baseClass == Behaviour.class) { + switch (baseOperationID) { case tdlPackage.BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return tdlPackage.ATOMIC_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -302,8 +382,7 @@ public abstract class AtomicBehaviourImpl extends BehaviourImpl implements Atomi @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.ATOMIC_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return getParticipatingComponents(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/BehaviourDescriptionImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/BehaviourDescriptionImpl.java index d96be429..32bc0bf4 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/BehaviourDescriptionImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/BehaviourDescriptionImpl.java @@ -80,8 +80,7 @@ public class BehaviourDescriptionImpl extends ElementImpl implements BehaviourDe { Behaviour oldBehaviour = behaviour; behaviour = newBehaviour; - if (eNotificationRequired()) - { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, tdlPackage.BEHAVIOUR_DESCRIPTION__BEHAVIOUR, oldBehaviour, newBehaviour); if (msgs == null) msgs = notification; else msgs.add(notification); } @@ -96,8 +95,7 @@ public class BehaviourDescriptionImpl extends ElementImpl implements BehaviourDe @Override public void setBehaviour(Behaviour newBehaviour) { - if (newBehaviour != behaviour) - { + if (newBehaviour != behaviour) { NotificationChain msgs = null; if (behaviour != null) msgs = ((InternalEObject)behaviour).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - tdlPackage.BEHAVIOUR_DESCRIPTION__BEHAVIOUR, null, msgs); @@ -118,8 +116,7 @@ public class BehaviourDescriptionImpl extends ElementImpl implements BehaviourDe @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.BEHAVIOUR_DESCRIPTION__BEHAVIOUR: return basicSetBehaviour(null, msgs); } @@ -134,8 +131,7 @@ public class BehaviourDescriptionImpl extends ElementImpl implements BehaviourDe @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.BEHAVIOUR_DESCRIPTION__BEHAVIOUR: return getBehaviour(); } @@ -150,8 +146,7 @@ public class BehaviourDescriptionImpl extends ElementImpl implements BehaviourDe @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.BEHAVIOUR_DESCRIPTION__BEHAVIOUR: setBehaviour((Behaviour)newValue); return; @@ -167,8 +162,7 @@ public class BehaviourDescriptionImpl extends ElementImpl implements BehaviourDe @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.BEHAVIOUR_DESCRIPTION__BEHAVIOUR: setBehaviour((Behaviour)null); return; @@ -184,8 +178,7 @@ public class BehaviourDescriptionImpl extends ElementImpl implements BehaviourDe @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.BEHAVIOUR_DESCRIPTION__BEHAVIOUR: return behaviour != null; } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/BehaviourImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/BehaviourImpl.java index 6601954f..e91efb82 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/BehaviourImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/BehaviourImpl.java @@ -6,18 +6,38 @@ import java.lang.reflect.InvocationTargetException; import java.util.Collection; +import java.util.Iterator; +import java.util.List; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; - import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.EnumerationLiteralId; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.ids.IdResolver.IdResolverExtension; +import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsSetOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsTypeOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsKindOfOperation; +import org.eclipse.ocl.pivot.messages.PivotMessages; +import org.eclipse.ocl.pivot.utilities.ClassUtil; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SetValue; import org.etsi.mts.tdl.Behaviour; import org.etsi.mts.tdl.ComponentInstance; +import org.etsi.mts.tdl.ComponentInstanceRole; +import org.etsi.mts.tdl.GateReference; +import org.etsi.mts.tdl.Interaction; +import org.etsi.mts.tdl.Target; +import org.etsi.mts.tdl.TestConfiguration; +import org.etsi.mts.tdl.TestDescription; import org.etsi.mts.tdl.TestObjective; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -73,23 +93,12 @@ public abstract class BehaviourImpl extends ElementImpl implements Behaviour @Override public EList getTestObjective() { - if (testObjective == null) - { + if (testObjective == null) { testObjective = new EObjectResolvingEList(TestObjective.class, this, tdlPackage.BEHAVIOUR__TEST_OBJECTIVE); } return testObjective; } - /** - * The cached invocation delegate for the '{@link #isTesterInputEvent() Is Tester Input Event}' operation. - * - * - * @see #isTesterInputEvent() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate IS_TESTER_INPUT_EVENT__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.BEHAVIOUR___IS_TESTER_INPUT_EVENT).getInvocationDelegate(); - /** * * @@ -98,26 +107,182 @@ public abstract class BehaviourImpl extends ElementImpl implements Behaviour @Override public Boolean isTesterInputEvent() { - try - { - return (Boolean)IS_TESTER_INPUT_EVENT__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if + * self.oclIsKindOf(TimeOut) or + * self.oclIsKindOf(Quiescence) or + * self.oclIsKindOf(Interaction) and + * self.oclAsType(Interaction).sourceGate.component.role = ComponentInstanceRole::SUT and + * self.oclAsType(Interaction) + * .target->exists(t | t.targetGate.component.role = ComponentInstanceRole::Tester) + * then true + * else false + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_Quiescence_0 = idResolver.getClass(tdlTables.CLSSid_Quiescence, null); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_TimeOut_0 = idResolver.getClass(tdlTables.CLSSid_TimeOut, null); + final /*@NonInvalid*/ boolean oclIsKindOf = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_TimeOut_0).booleanValue(); + final /*@NonInvalid*/ Boolean or; + if (oclIsKindOf) { + or = ValueUtil.TRUE_VALUE; + } + else { + final /*@NonInvalid*/ boolean oclIsKindOf_0 = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_Quiescence_0).booleanValue(); + if (oclIsKindOf_0) { + or = ValueUtil.TRUE_VALUE; + } + else { + or = ValueUtil.FALSE_VALUE; + } + } + final /*@Thrown*/ Boolean or_0; + if (or == ValueUtil.TRUE_VALUE) { + or_0 = ValueUtil.TRUE_VALUE; + } + else { + /*@Caught*/ Object CAUGHT_and_0; + try { + /*@Caught*/ Object CAUGHT_and; + try { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_Interaction_0 = idResolver.getClass(tdlTables.CLSSid_Interaction, null); + final /*@NonInvalid*/ boolean oclIsKindOf_1 = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_Interaction_0).booleanValue(); + final /*@Thrown*/ Boolean and; + if (!oclIsKindOf_1) { + and = ValueUtil.FALSE_VALUE; + } + else { + /*@Caught*/ Object CAUGHT_eq; + try { + final /*@Thrown*/ Interaction oclAsType = (Interaction)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_Interaction_0); + final /*@Thrown*/ GateReference sourceGate = oclAsType.getSourceGate(); + final /*@Thrown*/ ComponentInstance component = sourceGate.getComponent(); + final /*@Thrown*/ ComponentInstanceRole role = component.getRole(); + final /*@Thrown*/ EnumerationLiteralId BOXED_role = tdlTables.ENUMid_ComponentInstanceRole.getEnumerationLiteralId(ClassUtil.nonNullState(role.getName())); + final /*@Thrown*/ boolean eq = BOXED_role == tdlTables.ELITid_SUT; + CAUGHT_eq = eq; + } + catch (Exception e) { + CAUGHT_eq = ValueUtil.createInvalidValue(e); + } + if (CAUGHT_eq == ValueUtil.FALSE_VALUE) { + and = ValueUtil.FALSE_VALUE; + } + else { + if (CAUGHT_eq instanceof InvalidValueException) { + throw (InvalidValueException)CAUGHT_eq; + } + and = ValueUtil.TRUE_VALUE; + } + } + CAUGHT_and = and; + } + catch (Exception e) { + CAUGHT_and = ValueUtil.createInvalidValue(e); + } + final /*@Thrown*/ Boolean and_0; + if (CAUGHT_and == ValueUtil.FALSE_VALUE) { + and_0 = ValueUtil.FALSE_VALUE; + } + else { + /*@Caught*/ Object CAUGHT_exists; + try { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_Interaction_2 = idResolver.getClass(tdlTables.CLSSid_Interaction, null); + final /*@Thrown*/ Interaction oclAsType_0 = (Interaction)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_Interaction_2); + final /*@Thrown*/ List target = oclAsType_0.getTarget(); + final /*@Thrown*/ SetValue BOXED_target = idResolver.createSetOfAll(tdlTables.SET_CLSSid_Target, target); + /*@Thrown*/ Object accumulator = ValueUtil.FALSE_VALUE; + Iterator ITERATOR_t = BOXED_target.iterator(); + /*@Thrown*/ Boolean exists; + while (true) { + if (!ITERATOR_t.hasNext()) { + if (accumulator == ValueUtil.FALSE_VALUE) { + exists = ValueUtil.FALSE_VALUE; + } + else { + throw (InvalidValueException)accumulator; + } + break; + } + /*@NonInvalid*/ Target t = (Target)ITERATOR_t.next(); + /** + * t.targetGate.component.role = ComponentInstanceRole::Tester + */ + final /*@NonInvalid*/ GateReference targetGate = t.getTargetGate(); + final /*@NonInvalid*/ ComponentInstance component_0 = targetGate.getComponent(); + final /*@NonInvalid*/ ComponentInstanceRole role_0 = component_0.getRole(); + final /*@NonInvalid*/ EnumerationLiteralId BOXED_role_0 = tdlTables.ENUMid_ComponentInstanceRole.getEnumerationLiteralId(ClassUtil.nonNullState(role_0.getName())); + final /*@NonInvalid*/ boolean eq_0 = BOXED_role_0 == tdlTables.ELITid_Tester; + // + if (eq_0) { // Normal successful body evaluation result + exists = ValueUtil.TRUE_VALUE; + break; // Stop immediately + } + else if (!eq_0) { // Normal unsuccessful body evaluation result + ; // Carry on + } + else { // Impossible badly typed result + accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "exists"); + } + } + CAUGHT_exists = exists; + } + catch (Exception e) { + CAUGHT_exists = ValueUtil.createInvalidValue(e); + } + if (CAUGHT_exists == ValueUtil.FALSE_VALUE) { + and_0 = ValueUtil.FALSE_VALUE; + } + else { + if (CAUGHT_and instanceof InvalidValueException) { + throw (InvalidValueException)CAUGHT_and; + } + if (CAUGHT_exists instanceof InvalidValueException) { + throw (InvalidValueException)CAUGHT_exists; + } + if ((CAUGHT_and == null) || (CAUGHT_exists == null)) { + and_0 = null; + } + else { + and_0 = ValueUtil.TRUE_VALUE; + } + } + } + CAUGHT_and_0 = and_0; + } + catch (Exception e) { + CAUGHT_and_0 = ValueUtil.createInvalidValue(e); + } + if (CAUGHT_and_0 == ValueUtil.TRUE_VALUE) { + or_0 = ValueUtil.TRUE_VALUE; + } + else { + if (CAUGHT_and_0 instanceof InvalidValueException) { + throw (InvalidValueException)CAUGHT_and_0; + } + if ((or == null) || (CAUGHT_and_0 == null)) { + or_0 = null; + } + else { + or_0 = ValueUtil.FALSE_VALUE; + } + } } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + if (or_0 == null) { + throw new InvalidValueException("Null if condition"); } + /*@NonInvalid*/ boolean local_0; + if (or_0) { + local_0 = true; + } + else { + local_0 = false; + } + return local_0; } - /** - * The cached invocation delegate for the '{@link #getParticipatingComponents() Get Participating Components}' operation. - * - * - * @see #getParticipatingComponents() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.BEHAVIOUR___GET_PARTICIPATING_COMPONENTS).getInvocationDelegate(); - /** * * @@ -127,14 +292,67 @@ public abstract class BehaviourImpl extends ElementImpl implements Behaviour @Override public EList getParticipatingComponents() { - try - { - return (EList)GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if + * self.getParentTestDescription() + * ->exists(td | td.isLocallyOrdered) + * then OrderedSet{} + * else + * self.getParentTestDescription() + * .testConfiguration.componentInstance->asOrderedSet() + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ TestDescription getParentTestDescription = this.getParentTestDescription(); + final /*@NonInvalid*/ SetValue oclAsSet = OclAnyOclAsSetOperation.INSTANCE.evaluate(executor, tdlTables.SET_CLSSid_TestDescription, getParentTestDescription); + /*@Thrown*/ Object accumulator = ValueUtil.FALSE_VALUE; + Iterator ITERATOR_td = oclAsSet.iterator(); + /*@NonInvalid*/ Boolean exists; + while (true) { + if (!ITERATOR_td.hasNext()) { + if (accumulator == ValueUtil.FALSE_VALUE) { + exists = ValueUtil.FALSE_VALUE; + } + else { + throw (InvalidValueException)accumulator; + } + break; + } + /*@NonInvalid*/ TestDescription td = (TestDescription)ITERATOR_td.next(); + /** + * td.isLocallyOrdered + */ + final /*@NonInvalid*/ boolean isLocallyOrdered = td.isIsLocallyOrdered(); + // + if (isLocallyOrdered) { // Normal successful body evaluation result + exists = ValueUtil.TRUE_VALUE; + break; // Stop immediately + } + else if (!isLocallyOrdered) { // Normal unsuccessful body evaluation result + ; // Carry on + } + else { // Impossible badly typed result + accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "exists"); + } + } + if (exists == null) { + throw new InvalidValueException("Null if condition"); + } + /*@NonInvalid*/ OrderedSetValue local_0; + if (exists) { + local_0 = tdlTables.OrderedSet; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + final /*@NonInvalid*/ TestConfiguration testConfiguration = getParentTestDescription.getTestConfiguration(); + final /*@NonInvalid*/ List componentInstance = testConfiguration.getComponentInstance(); + final /*@NonInvalid*/ SetValue BOXED_componentInstance = idResolver.createSetOfAll(tdlTables.SET_CLSSid_ComponentInstance, componentInstance); + final /*@NonInvalid*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(BOXED_componentInstance); + local_0 = asOrderedSet; } + final /*@NonInvalid*/ List ECORE_local_0 = ((IdResolverExtension)idResolver).ecoreValueOfAll(ComponentInstance.class, local_0); + return (EList)ECORE_local_0; } /** @@ -145,8 +363,7 @@ public abstract class BehaviourImpl extends ElementImpl implements Behaviour @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.BEHAVIOUR__TEST_OBJECTIVE: return getTestObjective(); } @@ -162,8 +379,7 @@ public abstract class BehaviourImpl extends ElementImpl implements Behaviour @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.BEHAVIOUR__TEST_OBJECTIVE: getTestObjective().clear(); getTestObjective().addAll((Collection)newValue); @@ -180,8 +396,7 @@ public abstract class BehaviourImpl extends ElementImpl implements Behaviour @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.BEHAVIOUR__TEST_OBJECTIVE: getTestObjective().clear(); return; @@ -197,8 +412,7 @@ public abstract class BehaviourImpl extends ElementImpl implements Behaviour @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.BEHAVIOUR__TEST_OBJECTIVE: return testObjective != null && !testObjective.isEmpty(); } @@ -213,8 +427,7 @@ public abstract class BehaviourImpl extends ElementImpl implements Behaviour @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.BEHAVIOUR___IS_TESTER_INPUT_EVENT: return isTesterInputEvent(); case tdlPackage.BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/BlockImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/BlockImpl.java index b5f2185e..59503b3a 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/BlockImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/BlockImpl.java @@ -6,24 +6,38 @@ import java.lang.reflect.InvocationTargetException; import java.util.Collection; +import java.util.Iterator; +import java.util.List; import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.BasicEList; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.ids.IdResolver.IdResolverExtension; +import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; +import org.eclipse.ocl.pivot.library.collection.CollectionExcludingOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsSetOperation; +import org.eclipse.ocl.pivot.messages.PivotMessages; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SequenceValue; +import org.eclipse.ocl.pivot.values.SequenceValue.Accumulator; +import org.eclipse.ocl.pivot.values.SetValue; import org.etsi.mts.tdl.Behaviour; import org.etsi.mts.tdl.Block; import org.etsi.mts.tdl.ComponentInstance; import org.etsi.mts.tdl.LocalExpression; +import org.etsi.mts.tdl.TestConfiguration; +import org.etsi.mts.tdl.TestDescription; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -90,8 +104,7 @@ public class BlockImpl extends ElementImpl implements Block @Override public EList getBehaviour() { - if (behaviour == null) - { + if (behaviour == null) { behaviour = new EObjectContainmentEList(Behaviour.class, this, tdlPackage.BLOCK__BEHAVIOUR); } return behaviour; @@ -105,23 +118,12 @@ public class BlockImpl extends ElementImpl implements Block @Override public EList getGuard() { - if (guard == null) - { + if (guard == null) { guard = new EObjectContainmentEList(LocalExpression.class, this, tdlPackage.BLOCK__GUARD); } return guard; } - /** - * The cached invocation delegate for the '{@link #getParticipatingComponents() Get Participating Components}' operation. - * - * - * @see #getParticipatingComponents() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.BLOCK___GET_PARTICIPATING_COMPONENTS).getInvocationDelegate(); - /** * * @@ -131,26 +133,91 @@ public class BlockImpl extends ElementImpl implements Block @Override public EList getParticipatingComponents() { - try - { - return (EList)GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if + * self.getParentTestDescription() + * ->exists(td | td.isLocallyOrdered) + * then self.behaviour.getParticipatingComponents()->asOrderedSet() + * else + * self.getParentTestDescription() + * .testConfiguration.componentInstance->asOrderedSet() + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ TestDescription getParentTestDescription = this.getParentTestDescription(); + final /*@NonInvalid*/ SetValue oclAsSet = OclAnyOclAsSetOperation.INSTANCE.evaluate(executor, tdlTables.SET_CLSSid_TestDescription, getParentTestDescription); + /*@Thrown*/ Object accumulator = ValueUtil.FALSE_VALUE; + Iterator ITERATOR_td = oclAsSet.iterator(); + /*@NonInvalid*/ Boolean exists; + while (true) { + if (!ITERATOR_td.hasNext()) { + if (accumulator == ValueUtil.FALSE_VALUE) { + exists = ValueUtil.FALSE_VALUE; + } + else { + throw (InvalidValueException)accumulator; + } + break; + } + /*@NonInvalid*/ TestDescription td = (TestDescription)ITERATOR_td.next(); + /** + * td.isLocallyOrdered + */ + final /*@NonInvalid*/ boolean isLocallyOrdered = td.isIsLocallyOrdered(); + // + if (isLocallyOrdered) { // Normal successful body evaluation result + exists = ValueUtil.TRUE_VALUE; + break; // Stop immediately + } + else if (!isLocallyOrdered) { // Normal unsuccessful body evaluation result + ; // Carry on + } + else { // Impossible badly typed result + accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "exists"); + } + } + if (exists == null) { + throw new InvalidValueException("Null if condition"); } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + /*@NonInvalid*/ OrderedSetValue local_0; + if (exists) { + final /*@NonInvalid*/ List behaviour = this.getBehaviour(); + final /*@NonInvalid*/ OrderedSetValue BOXED_behaviour = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_Behaviour, behaviour); + /*@Thrown*/ Accumulator accumulator_0 = ValueUtil.createSequenceAccumulatorValue(tdlTables.SEQ_CLSSid_ComponentInstance); + Iterator ITERATOR__1 = BOXED_behaviour.iterator(); + /*@NonInvalid*/ SequenceValue collect; + while (true) { + if (!ITERATOR__1.hasNext()) { + collect = accumulator_0; + break; + } + /*@NonInvalid*/ Behaviour _1 = (Behaviour)ITERATOR__1.next(); + /** + * getParticipatingComponents() + */ + final /*@NonInvalid*/ List getParticipatingComponents = _1.getParticipatingComponents(); + final /*@NonInvalid*/ OrderedSetValue BOXED_getParticipatingComponents = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_ComponentInstance, getParticipatingComponents); + // + for (Object value : BOXED_getParticipatingComponents.flatten().getElements()) { + accumulator_0.add(value); + } + } + final /*@NonInvalid*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(collect); + local_0 = asOrderedSet; } + else { + final /*@NonInvalid*/ TestConfiguration testConfiguration = getParentTestDescription.getTestConfiguration(); + final /*@NonInvalid*/ List componentInstance = testConfiguration.getComponentInstance(); + final /*@NonInvalid*/ SetValue BOXED_componentInstance = idResolver.createSetOfAll(tdlTables.SET_CLSSid_ComponentInstance, componentInstance); + final /*@NonInvalid*/ OrderedSetValue asOrderedSet_0 = CollectionAsOrderedSetOperation.INSTANCE.evaluate(BOXED_componentInstance); + local_0 = asOrderedSet_0; + } + final /*@NonInvalid*/ List ECORE_local_0 = ((IdResolverExtension)idResolver).ecoreValueOfAll(ComponentInstance.class, local_0); + return (EList)ECORE_local_0; } - /** - * The cached invocation delegate for the '{@link #getParticipatingComponentsExcluding(org.etsi.mts.tdl.Behaviour) Get Participating Components Excluding}' operation. - * - * - * @see #getParticipatingComponentsExcluding(org.etsi.mts.tdl.Behaviour) - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate GET_PARTICIPATING_COMPONENTS_EXCLUDING_BEHAVIOUR__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.BLOCK___GET_PARTICIPATING_COMPONENTS_EXCLUDING__BEHAVIOUR).getInvocationDelegate(); - /** * * @@ -158,16 +225,95 @@ public class BlockImpl extends ElementImpl implements Block */ @SuppressWarnings("unchecked") @Override - public EList getParticipatingComponentsExcluding(Behaviour excluded) + public EList getParticipatingComponentsExcluding(final Behaviour excluded) { - try - { - return (EList)GET_PARTICIPATING_COMPONENTS_EXCLUDING_BEHAVIOUR__EINVOCATION_DELEGATE.dynamicInvoke(this, new BasicEList.UnmodifiableEList(1, new Object[]{excluded})); + /** + * + * if + * self.getParentTestDescription() + * ->exists(td | td.isLocallyOrdered) + * then + * self.behaviour->excluding(excluded) + * .getParticipatingComponents() + * ->asOrderedSet() + * else + * self.getParentTestDescription() + * .testConfiguration.componentInstance->asOrderedSet() + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ TestDescription getParentTestDescription = this.getParentTestDescription(); + final /*@NonInvalid*/ SetValue oclAsSet = OclAnyOclAsSetOperation.INSTANCE.evaluate(executor, tdlTables.SET_CLSSid_TestDescription, getParentTestDescription); + /*@Thrown*/ Object accumulator = ValueUtil.FALSE_VALUE; + Iterator ITERATOR_td = oclAsSet.iterator(); + /*@NonInvalid*/ Boolean exists; + while (true) { + if (!ITERATOR_td.hasNext()) { + if (accumulator == ValueUtil.FALSE_VALUE) { + exists = ValueUtil.FALSE_VALUE; + } + else { + throw (InvalidValueException)accumulator; + } + break; + } + /*@NonInvalid*/ TestDescription td = (TestDescription)ITERATOR_td.next(); + /** + * td.isLocallyOrdered + */ + final /*@NonInvalid*/ boolean isLocallyOrdered = td.isIsLocallyOrdered(); + // + if (isLocallyOrdered) { // Normal successful body evaluation result + exists = ValueUtil.TRUE_VALUE; + break; // Stop immediately + } + else if (!isLocallyOrdered) { // Normal unsuccessful body evaluation result + ; // Carry on + } + else { // Impossible badly typed result + accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "exists"); + } + } + if (exists == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ OrderedSetValue local_0; + if (exists) { + final /*@NonInvalid*/ List behaviour = this.getBehaviour(); + final /*@NonInvalid*/ OrderedSetValue BOXED_behaviour = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_Behaviour, behaviour); + final /*@Thrown*/ OrderedSetValue excluding = (OrderedSetValue)CollectionExcludingOperation.INSTANCE.evaluate(BOXED_behaviour, excluded); + /*@Thrown*/ Accumulator accumulator_0 = ValueUtil.createSequenceAccumulatorValue(tdlTables.SEQ_CLSSid_ComponentInstance); + Iterator ITERATOR__1 = excluding.iterator(); + /*@Thrown*/ SequenceValue collect; + while (true) { + if (!ITERATOR__1.hasNext()) { + collect = accumulator_0; + break; + } + /*@NonInvalid*/ Behaviour _1 = (Behaviour)ITERATOR__1.next(); + /** + * getParticipatingComponents() + */ + final /*@NonInvalid*/ List getParticipatingComponents = _1.getParticipatingComponents(); + final /*@NonInvalid*/ OrderedSetValue BOXED_getParticipatingComponents = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_ComponentInstance, getParticipatingComponents); + // + for (Object value : BOXED_getParticipatingComponents.flatten().getElements()) { + accumulator_0.add(value); + } + } + final /*@Thrown*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(collect); + local_0 = asOrderedSet; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + final /*@NonInvalid*/ TestConfiguration testConfiguration = getParentTestDescription.getTestConfiguration(); + final /*@NonInvalid*/ List componentInstance = testConfiguration.getComponentInstance(); + final /*@NonInvalid*/ SetValue BOXED_componentInstance = idResolver.createSetOfAll(tdlTables.SET_CLSSid_ComponentInstance, componentInstance); + final /*@NonInvalid*/ OrderedSetValue asOrderedSet_0 = CollectionAsOrderedSetOperation.INSTANCE.evaluate(BOXED_componentInstance); + local_0 = asOrderedSet_0; } + final /*@Thrown*/ List ECORE_local_0 = ((IdResolverExtension)idResolver).ecoreValueOfAll(ComponentInstance.class, local_0); + return (EList)ECORE_local_0; } /** @@ -178,8 +324,7 @@ public class BlockImpl extends ElementImpl implements Block @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.BLOCK__BEHAVIOUR: return ((InternalEList)getBehaviour()).basicRemove(otherEnd, msgs); case tdlPackage.BLOCK__GUARD: @@ -196,8 +341,7 @@ public class BlockImpl extends ElementImpl implements Block @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.BLOCK__BEHAVIOUR: return getBehaviour(); case tdlPackage.BLOCK__GUARD: @@ -215,8 +359,7 @@ public class BlockImpl extends ElementImpl implements Block @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.BLOCK__BEHAVIOUR: getBehaviour().clear(); getBehaviour().addAll((Collection)newValue); @@ -237,8 +380,7 @@ public class BlockImpl extends ElementImpl implements Block @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.BLOCK__BEHAVIOUR: getBehaviour().clear(); return; @@ -257,8 +399,7 @@ public class BlockImpl extends ElementImpl implements Block @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.BLOCK__BEHAVIOUR: return behaviour != null && !behaviour.isEmpty(); case tdlPackage.BLOCK__GUARD: @@ -275,8 +416,7 @@ public class BlockImpl extends ElementImpl implements Block @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.BLOCK___GET_PARTICIPATING_COMPONENTS: return getParticipatingComponents(); case tdlPackage.BLOCK___GET_PARTICIPATING_COMPONENTS_EXCLUDING__BEHAVIOUR: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/BoundedLoopBehaviourImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/BoundedLoopBehaviourImpl.java index 6b5b18c4..94cc8248 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/BoundedLoopBehaviourImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/BoundedLoopBehaviourImpl.java @@ -72,8 +72,7 @@ public class BoundedLoopBehaviourImpl extends SingleCombinedBehaviourImpl implem @Override public EList getNumIteration() { - if (numIteration == null) - { + if (numIteration == null) { numIteration = new EObjectContainmentEList(LocalExpression.class, this, tdlPackage.BOUNDED_LOOP_BEHAVIOUR__NUM_ITERATION); } return numIteration; @@ -87,8 +86,7 @@ public class BoundedLoopBehaviourImpl extends SingleCombinedBehaviourImpl implem @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.BOUNDED_LOOP_BEHAVIOUR__NUM_ITERATION: return ((InternalEList)getNumIteration()).basicRemove(otherEnd, msgs); } @@ -103,8 +101,7 @@ public class BoundedLoopBehaviourImpl extends SingleCombinedBehaviourImpl implem @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.BOUNDED_LOOP_BEHAVIOUR__NUM_ITERATION: return getNumIteration(); } @@ -120,8 +117,7 @@ public class BoundedLoopBehaviourImpl extends SingleCombinedBehaviourImpl implem @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.BOUNDED_LOOP_BEHAVIOUR__NUM_ITERATION: getNumIteration().clear(); getNumIteration().addAll((Collection)newValue); @@ -138,8 +134,7 @@ public class BoundedLoopBehaviourImpl extends SingleCombinedBehaviourImpl implem @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.BOUNDED_LOOP_BEHAVIOUR__NUM_ITERATION: getNumIteration().clear(); return; @@ -155,8 +150,7 @@ public class BoundedLoopBehaviourImpl extends SingleCombinedBehaviourImpl implem @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.BOUNDED_LOOP_BEHAVIOUR__NUM_ITERATION: return numIteration != null && !numIteration.isEmpty(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/CollectionDataInstanceImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/CollectionDataInstanceImpl.java index 2c7a63c1..8a022830 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/CollectionDataInstanceImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/CollectionDataInstanceImpl.java @@ -97,8 +97,7 @@ public class CollectionDataInstanceImpl extends DataInstanceImpl implements Coll @Override public EList getItem() { - if (item == null) - { + if (item == null) { item = new EObjectContainmentEList(DataUse.class, this, tdlPackage.COLLECTION_DATA_INSTANCE__ITEM); } return item; @@ -137,8 +136,7 @@ public class CollectionDataInstanceImpl extends DataInstanceImpl implements Coll @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COLLECTION_DATA_INSTANCE__ITEM: return ((InternalEList)getItem()).basicRemove(otherEnd, msgs); } @@ -153,8 +151,7 @@ public class CollectionDataInstanceImpl extends DataInstanceImpl implements Coll @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COLLECTION_DATA_INSTANCE__ITEM: return getItem(); case tdlPackage.COLLECTION_DATA_INSTANCE__UNASSIGNED_MEMBER: @@ -172,8 +169,7 @@ public class CollectionDataInstanceImpl extends DataInstanceImpl implements Coll @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COLLECTION_DATA_INSTANCE__ITEM: getItem().clear(); getItem().addAll((Collection)newValue); @@ -193,8 +189,7 @@ public class CollectionDataInstanceImpl extends DataInstanceImpl implements Coll @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COLLECTION_DATA_INSTANCE__ITEM: getItem().clear(); return; @@ -213,8 +208,7 @@ public class CollectionDataInstanceImpl extends DataInstanceImpl implements Coll @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COLLECTION_DATA_INSTANCE__ITEM: return item != null && !item.isEmpty(); case tdlPackage.COLLECTION_DATA_INSTANCE__UNASSIGNED_MEMBER: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/CollectionDataTypeImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/CollectionDataTypeImpl.java index c185cdd0..cab089fa 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/CollectionDataTypeImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/CollectionDataTypeImpl.java @@ -67,12 +67,10 @@ public class CollectionDataTypeImpl extends DataTypeImpl implements CollectionDa @Override public DataType getItemType() { - if (itemType != null && itemType.eIsProxy()) - { + if (itemType != null && itemType.eIsProxy()) { InternalEObject oldItemType = (InternalEObject)itemType; itemType = (DataType)eResolveProxy(oldItemType); - if (itemType != oldItemType) - { + if (itemType != oldItemType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.COLLECTION_DATA_TYPE__ITEM_TYPE, oldItemType, itemType)); } @@ -112,8 +110,7 @@ public class CollectionDataTypeImpl extends DataTypeImpl implements CollectionDa @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COLLECTION_DATA_TYPE__ITEM_TYPE: if (resolve) return getItemType(); return basicGetItemType(); @@ -129,8 +126,7 @@ public class CollectionDataTypeImpl extends DataTypeImpl implements CollectionDa @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COLLECTION_DATA_TYPE__ITEM_TYPE: setItemType((DataType)newValue); return; @@ -146,8 +142,7 @@ public class CollectionDataTypeImpl extends DataTypeImpl implements CollectionDa @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COLLECTION_DATA_TYPE__ITEM_TYPE: setItemType((DataType)null); return; @@ -163,8 +158,7 @@ public class CollectionDataTypeImpl extends DataTypeImpl implements CollectionDa @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COLLECTION_DATA_TYPE__ITEM_TYPE: return itemType != null; } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/CombinedBehaviourImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/CombinedBehaviourImpl.java index 4613d154..c280d682 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/CombinedBehaviourImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/CombinedBehaviourImpl.java @@ -84,8 +84,7 @@ public abstract class CombinedBehaviourImpl extends BehaviourImpl implements Com @Override public EList getPeriodic() { - if (periodic == null) - { + if (periodic == null) { periodic = new EObjectContainmentEList(PeriodicBehaviour.class, this, tdlPackage.COMBINED_BEHAVIOUR__PERIODIC); } return periodic; @@ -99,8 +98,7 @@ public abstract class CombinedBehaviourImpl extends BehaviourImpl implements Com @Override public EList getExceptional() { - if (exceptional == null) - { + if (exceptional == null) { exceptional = new EObjectContainmentEList(ExceptionalBehaviour.class, this, tdlPackage.COMBINED_BEHAVIOUR__EXCEPTIONAL); } return exceptional; @@ -114,8 +112,7 @@ public abstract class CombinedBehaviourImpl extends BehaviourImpl implements Com @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMBINED_BEHAVIOUR__PERIODIC: return ((InternalEList)getPeriodic()).basicRemove(otherEnd, msgs); case tdlPackage.COMBINED_BEHAVIOUR__EXCEPTIONAL: @@ -132,8 +129,7 @@ public abstract class CombinedBehaviourImpl extends BehaviourImpl implements Com @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMBINED_BEHAVIOUR__PERIODIC: return getPeriodic(); case tdlPackage.COMBINED_BEHAVIOUR__EXCEPTIONAL: @@ -151,8 +147,7 @@ public abstract class CombinedBehaviourImpl extends BehaviourImpl implements Com @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMBINED_BEHAVIOUR__PERIODIC: getPeriodic().clear(); getPeriodic().addAll((Collection)newValue); @@ -173,8 +168,7 @@ public abstract class CombinedBehaviourImpl extends BehaviourImpl implements Com @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMBINED_BEHAVIOUR__PERIODIC: getPeriodic().clear(); return; @@ -193,8 +187,7 @@ public abstract class CombinedBehaviourImpl extends BehaviourImpl implements Com @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMBINED_BEHAVIOUR__PERIODIC: return periodic != null && !periodic.isEmpty(); case tdlPackage.COMBINED_BEHAVIOUR__EXCEPTIONAL: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/CommentImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/CommentImpl.java index cad38afa..5f7cec09 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/CommentImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/CommentImpl.java @@ -129,8 +129,7 @@ public class CommentImpl extends ElementImpl implements Comment @Override public void setCommentedElement(Element newCommentedElement) { - if (newCommentedElement != eInternalContainer() || (eContainerFeatureID() != tdlPackage.COMMENT__COMMENTED_ELEMENT && newCommentedElement != null)) - { + if (newCommentedElement != eInternalContainer() || (eContainerFeatureID() != tdlPackage.COMMENT__COMMENTED_ELEMENT && newCommentedElement != null)) { if (EcoreUtil.isAncestor(this, newCommentedElement)) throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); NotificationChain msgs = null; @@ -153,8 +152,7 @@ public class CommentImpl extends ElementImpl implements Comment @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMMENT__COMMENTED_ELEMENT: if (eInternalContainer() != null) msgs = eBasicRemoveFromContainer(msgs); @@ -171,8 +169,7 @@ public class CommentImpl extends ElementImpl implements Comment @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMMENT__COMMENTED_ELEMENT: return basicSetCommentedElement(null, msgs); } @@ -187,8 +184,7 @@ public class CommentImpl extends ElementImpl implements Comment @Override public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { - switch (eContainerFeatureID()) - { + switch (eContainerFeatureID()) { case tdlPackage.COMMENT__COMMENTED_ELEMENT: return eInternalContainer().eInverseRemove(this, tdlPackage.ELEMENT__COMMENT, Element.class, msgs); } @@ -203,8 +199,7 @@ public class CommentImpl extends ElementImpl implements Comment @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMMENT__BODY: return getBody(); case tdlPackage.COMMENT__COMMENTED_ELEMENT: @@ -221,8 +216,7 @@ public class CommentImpl extends ElementImpl implements Comment @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMMENT__BODY: setBody((String)newValue); return; @@ -241,8 +235,7 @@ public class CommentImpl extends ElementImpl implements Comment @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMMENT__BODY: setBody(BODY_EDEFAULT); return; @@ -261,8 +254,7 @@ public class CommentImpl extends ElementImpl implements Comment @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMMENT__BODY: return BODY_EDEFAULT == null ? body != null : !BODY_EDEFAULT.equals(body); case tdlPackage.COMMENT__COMMENTED_ELEMENT: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ComponentInstanceBindingImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ComponentInstanceBindingImpl.java index d3534c1b..f999473f 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ComponentInstanceBindingImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ComponentInstanceBindingImpl.java @@ -78,12 +78,10 @@ public class ComponentInstanceBindingImpl extends ElementImpl implements Compone @Override public ComponentInstance getFormalComponent() { - if (formalComponent != null && formalComponent.eIsProxy()) - { + if (formalComponent != null && formalComponent.eIsProxy()) { InternalEObject oldFormalComponent = (InternalEObject)formalComponent; formalComponent = (ComponentInstance)eResolveProxy(oldFormalComponent); - if (formalComponent != oldFormalComponent) - { + if (formalComponent != oldFormalComponent) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.COMPONENT_INSTANCE_BINDING__FORMAL_COMPONENT, oldFormalComponent, formalComponent)); } @@ -123,12 +121,10 @@ public class ComponentInstanceBindingImpl extends ElementImpl implements Compone @Override public ComponentInstance getActualComponent() { - if (actualComponent != null && actualComponent.eIsProxy()) - { + if (actualComponent != null && actualComponent.eIsProxy()) { InternalEObject oldActualComponent = (InternalEObject)actualComponent; actualComponent = (ComponentInstance)eResolveProxy(oldActualComponent); - if (actualComponent != oldActualComponent) - { + if (actualComponent != oldActualComponent) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.COMPONENT_INSTANCE_BINDING__ACTUAL_COMPONENT, oldActualComponent, actualComponent)); } @@ -168,8 +164,7 @@ public class ComponentInstanceBindingImpl extends ElementImpl implements Compone @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMPONENT_INSTANCE_BINDING__FORMAL_COMPONENT: if (resolve) return getFormalComponent(); return basicGetFormalComponent(); @@ -188,8 +183,7 @@ public class ComponentInstanceBindingImpl extends ElementImpl implements Compone @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMPONENT_INSTANCE_BINDING__FORMAL_COMPONENT: setFormalComponent((ComponentInstance)newValue); return; @@ -208,8 +202,7 @@ public class ComponentInstanceBindingImpl extends ElementImpl implements Compone @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMPONENT_INSTANCE_BINDING__FORMAL_COMPONENT: setFormalComponent((ComponentInstance)null); return; @@ -228,8 +221,7 @@ public class ComponentInstanceBindingImpl extends ElementImpl implements Compone @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMPONENT_INSTANCE_BINDING__FORMAL_COMPONENT: return formalComponent != null; case tdlPackage.COMPONENT_INSTANCE_BINDING__ACTUAL_COMPONENT: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ComponentInstanceImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ComponentInstanceImpl.java index 38ed65d7..12eec3d0 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ComponentInstanceImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ComponentInstanceImpl.java @@ -89,12 +89,10 @@ public class ComponentInstanceImpl extends NamedElementImpl implements Component @Override public ComponentType getType() { - if (type != null && type.eIsProxy()) - { + if (type != null && type.eIsProxy()) { InternalEObject oldType = (InternalEObject)type; type = (ComponentType)eResolveProxy(oldType); - if (type != oldType) - { + if (type != oldType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.COMPONENT_INSTANCE__TYPE, oldType, type)); } @@ -159,8 +157,7 @@ public class ComponentInstanceImpl extends NamedElementImpl implements Component @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMPONENT_INSTANCE__TYPE: if (resolve) return getType(); return basicGetType(); @@ -178,8 +175,7 @@ public class ComponentInstanceImpl extends NamedElementImpl implements Component @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMPONENT_INSTANCE__TYPE: setType((ComponentType)newValue); return; @@ -198,8 +194,7 @@ public class ComponentInstanceImpl extends NamedElementImpl implements Component @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMPONENT_INSTANCE__TYPE: setType((ComponentType)null); return; @@ -218,8 +213,7 @@ public class ComponentInstanceImpl extends NamedElementImpl implements Component @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMPONENT_INSTANCE__TYPE: return type != null; case tdlPackage.COMPONENT_INSTANCE__ROLE: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ComponentTypeImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ComponentTypeImpl.java index fb26e30f..49dbdb2c 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ComponentTypeImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ComponentTypeImpl.java @@ -6,14 +6,12 @@ import java.lang.reflect.InvocationTargetException; import java.util.Collection; +import java.util.List; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; @@ -21,12 +19,25 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.ids.IdResolver.IdResolverExtension; +import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; +import org.eclipse.ocl.pivot.library.collection.CollectionUnionOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsTypeOperation; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SetValue; import org.etsi.mts.tdl.ComponentType; import org.etsi.mts.tdl.Extension; import org.etsi.mts.tdl.GateInstance; +import org.etsi.mts.tdl.PackageableElement; import org.etsi.mts.tdl.Timer; import org.etsi.mts.tdl.Variable; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -115,8 +126,7 @@ public class ComponentTypeImpl extends PackageableElementImpl implements Compone @Override public EList getGateInstance() { - if (gateInstance == null) - { + if (gateInstance == null) { gateInstance = new EObjectContainmentEList(GateInstance.class, this, tdlPackage.COMPONENT_TYPE__GATE_INSTANCE); } return gateInstance; @@ -130,8 +140,7 @@ public class ComponentTypeImpl extends PackageableElementImpl implements Compone @Override public EList getTimer() { - if (timer == null) - { + if (timer == null) { timer = new EObjectContainmentEList(Timer.class, this, tdlPackage.COMPONENT_TYPE__TIMER); } return timer; @@ -145,8 +154,7 @@ public class ComponentTypeImpl extends PackageableElementImpl implements Compone @Override public EList getVariable() { - if (variable == null) - { + if (variable == null) { variable = new EObjectContainmentEList(Variable.class, this, tdlPackage.COMPONENT_TYPE__VARIABLE); } return variable; @@ -172,8 +180,7 @@ public class ComponentTypeImpl extends PackageableElementImpl implements Compone { Extension oldExtension = extension; extension = newExtension; - if (eNotificationRequired()) - { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, tdlPackage.COMPONENT_TYPE__EXTENSION, oldExtension, newExtension); if (msgs == null) msgs = notification; else msgs.add(notification); } @@ -188,8 +195,7 @@ public class ComponentTypeImpl extends PackageableElementImpl implements Compone @Override public void setExtension(Extension newExtension) { - if (newExtension != extension) - { + if (newExtension != extension) { NotificationChain msgs = null; if (extension != null) msgs = ((InternalEObject)extension).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - tdlPackage.COMPONENT_TYPE__EXTENSION, null, msgs); @@ -202,16 +208,6 @@ public class ComponentTypeImpl extends PackageableElementImpl implements Compone eNotify(new ENotificationImpl(this, Notification.SET, tdlPackage.COMPONENT_TYPE__EXTENSION, newExtension, newExtension)); } - /** - * The cached invocation delegate for the '{@link #allGates() All Gates}' operation. - * - * - * @see #allGates() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate ALL_GATES__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.COMPONENT_TYPE___ALL_GATES).getInvocationDelegate(); - /** * * @@ -221,26 +217,59 @@ public class ComponentTypeImpl extends PackageableElementImpl implements Compone @Override public EList allGates() { - try - { - return (EList)ALL_GATES__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if not self.extension.oclIsUndefined() + * then + * self.extension.extending.oclAsType(ComponentType) + * .allGates() + * ->union(self.gateInstance) + * ->asOrderedSet() + * else self.gateInstance + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ Extension extension = this.getExtension(); + final /*@NonInvalid*/ List gateInstance_0 = this.getGateInstance(); + final /*@NonInvalid*/ OrderedSetValue BOXED_gateInstance_0 = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_GateInstance, gateInstance_0); + final /*@NonInvalid*/ boolean oclIsUndefined = extension == null; + final /*@NonInvalid*/ Boolean not; + if (!oclIsUndefined) { + not = ValueUtil.TRUE_VALUE; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + if (oclIsUndefined) { + not = ValueUtil.FALSE_VALUE; + } + else { + not = null; + } } + if (not == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ OrderedSetValue local_0; + if (not) { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_ComponentType_0 = idResolver.getClass(tdlTables.CLSSid_ComponentType, null); + if (extension == null) { + throw new InvalidValueException("Null source for \'\'http://www.etsi.org/spec/TDL/1.4.1\'::Extension::extending\'"); + } + final /*@Thrown*/ PackageableElement extending = extension.getExtending(); + final /*@Thrown*/ ComponentType oclAsType = (ComponentType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, extending, TYP_tdl_c_c_ComponentType_0); + final /*@Thrown*/ List allGates = oclAsType.allGates(); + final /*@Thrown*/ OrderedSetValue BOXED_allGates = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_GateInstance, allGates); + final /*@Thrown*/ SetValue union = (SetValue)CollectionUnionOperation.INSTANCE.evaluate(BOXED_allGates, BOXED_gateInstance_0); + final /*@Thrown*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(union); + local_0 = asOrderedSet; + } + else { + local_0 = BOXED_gateInstance_0; + } + final /*@Thrown*/ List ECORE_local_0 = ((IdResolverExtension)idResolver).ecoreValueOfAll(GateInstance.class, local_0); + return (EList)ECORE_local_0; } - /** - * The cached invocation delegate for the '{@link #allTimers() All Timers}' operation. - * - * - * @see #allTimers() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate ALL_TIMERS__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.COMPONENT_TYPE___ALL_TIMERS).getInvocationDelegate(); - /** * * @@ -250,26 +279,59 @@ public class ComponentTypeImpl extends PackageableElementImpl implements Compone @Override public EList allTimers() { - try - { - return (EList)ALL_TIMERS__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if not self.extension.oclIsUndefined() + * then + * self.extension.extending.oclAsType(ComponentType) + * .allTimers() + * ->union(self.timer) + * ->asOrderedSet() + * else self.timer + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ Extension extension = this.getExtension(); + final /*@NonInvalid*/ List timer_0 = this.getTimer(); + final /*@NonInvalid*/ OrderedSetValue BOXED_timer_0 = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_Timer, timer_0); + final /*@NonInvalid*/ boolean oclIsUndefined = extension == null; + final /*@NonInvalid*/ Boolean not; + if (!oclIsUndefined) { + not = ValueUtil.TRUE_VALUE; + } + else { + if (oclIsUndefined) { + not = ValueUtil.FALSE_VALUE; + } + else { + not = null; + } + } + if (not == null) { + throw new InvalidValueException("Null if condition"); } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + /*@Thrown*/ OrderedSetValue local_0; + if (not) { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_ComponentType_0 = idResolver.getClass(tdlTables.CLSSid_ComponentType, null); + if (extension == null) { + throw new InvalidValueException("Null source for \'\'http://www.etsi.org/spec/TDL/1.4.1\'::Extension::extending\'"); + } + final /*@Thrown*/ PackageableElement extending = extension.getExtending(); + final /*@Thrown*/ ComponentType oclAsType = (ComponentType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, extending, TYP_tdl_c_c_ComponentType_0); + final /*@Thrown*/ List allTimers = oclAsType.allTimers(); + final /*@Thrown*/ OrderedSetValue BOXED_allTimers = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_Timer, allTimers); + final /*@Thrown*/ SetValue union = (SetValue)CollectionUnionOperation.INSTANCE.evaluate(BOXED_allTimers, BOXED_timer_0); + final /*@Thrown*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(union); + local_0 = asOrderedSet; } + else { + local_0 = BOXED_timer_0; + } + final /*@Thrown*/ List ECORE_local_0 = ((IdResolverExtension)idResolver).ecoreValueOfAll(Timer.class, local_0); + return (EList)ECORE_local_0; } - /** - * The cached invocation delegate for the '{@link #allVariables() All Variables}' operation. - * - * - * @see #allVariables() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate ALL_VARIABLES__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.COMPONENT_TYPE___ALL_VARIABLES).getInvocationDelegate(); - /** * * @@ -279,14 +341,57 @@ public class ComponentTypeImpl extends PackageableElementImpl implements Compone @Override public EList allVariables() { - try - { - return (EList)ALL_VARIABLES__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if not self.extension.oclIsUndefined() + * then + * self.extension.extending.oclAsType(ComponentType) + * .allVariables() + * ->union(self.variable) + * ->asOrderedSet() + * else self.variable + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ Extension extension = this.getExtension(); + final /*@NonInvalid*/ List variable_0 = this.getVariable(); + final /*@NonInvalid*/ OrderedSetValue BOXED_variable_0 = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_Variable, variable_0); + final /*@NonInvalid*/ boolean oclIsUndefined = extension == null; + final /*@NonInvalid*/ Boolean not; + if (!oclIsUndefined) { + not = ValueUtil.TRUE_VALUE; + } + else { + if (oclIsUndefined) { + not = ValueUtil.FALSE_VALUE; + } + else { + not = null; + } + } + if (not == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ OrderedSetValue local_0; + if (not) { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_ComponentType_0 = idResolver.getClass(tdlTables.CLSSid_ComponentType, null); + if (extension == null) { + throw new InvalidValueException("Null source for \'\'http://www.etsi.org/spec/TDL/1.4.1\'::Extension::extending\'"); + } + final /*@Thrown*/ PackageableElement extending = extension.getExtending(); + final /*@Thrown*/ ComponentType oclAsType = (ComponentType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, extending, TYP_tdl_c_c_ComponentType_0); + final /*@Thrown*/ List allVariables = oclAsType.allVariables(); + final /*@Thrown*/ OrderedSetValue BOXED_allVariables = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_Variable, allVariables); + final /*@Thrown*/ SetValue union = (SetValue)CollectionUnionOperation.INSTANCE.evaluate(BOXED_allVariables, BOXED_variable_0); + final /*@Thrown*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(union); + local_0 = asOrderedSet; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + local_0 = BOXED_variable_0; } + final /*@Thrown*/ List ECORE_local_0 = ((IdResolverExtension)idResolver).ecoreValueOfAll(Variable.class, local_0); + return (EList)ECORE_local_0; } /** @@ -297,8 +402,7 @@ public class ComponentTypeImpl extends PackageableElementImpl implements Compone @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMPONENT_TYPE__GATE_INSTANCE: return ((InternalEList)getGateInstance()).basicRemove(otherEnd, msgs); case tdlPackage.COMPONENT_TYPE__TIMER: @@ -319,8 +423,7 @@ public class ComponentTypeImpl extends PackageableElementImpl implements Compone @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMPONENT_TYPE__GATE_INSTANCE: return getGateInstance(); case tdlPackage.COMPONENT_TYPE__TIMER: @@ -342,8 +445,7 @@ public class ComponentTypeImpl extends PackageableElementImpl implements Compone @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMPONENT_TYPE__GATE_INSTANCE: getGateInstance().clear(); getGateInstance().addAll((Collection)newValue); @@ -371,8 +473,7 @@ public class ComponentTypeImpl extends PackageableElementImpl implements Compone @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMPONENT_TYPE__GATE_INSTANCE: getGateInstance().clear(); return; @@ -397,8 +498,7 @@ public class ComponentTypeImpl extends PackageableElementImpl implements Compone @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.COMPONENT_TYPE__GATE_INSTANCE: return gateInstance != null && !gateInstance.isEmpty(); case tdlPackage.COMPONENT_TYPE__TIMER: @@ -419,8 +519,7 @@ public class ComponentTypeImpl extends PackageableElementImpl implements Compone @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.COMPONENT_TYPE___ALL_GATES: return allGates(); case tdlPackage.COMPONENT_TYPE___ALL_TIMERS: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ConnectionImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ConnectionImpl.java index 96b2710d..959e4ac8 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ConnectionImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ConnectionImpl.java @@ -72,8 +72,7 @@ public class ConnectionImpl extends ElementImpl implements Connection @Override public EList getEndPoint() { - if (endPoint == null) - { + if (endPoint == null) { endPoint = new EObjectContainmentEList(GateReference.class, this, tdlPackage.CONNECTION__END_POINT); } return endPoint; @@ -87,8 +86,7 @@ public class ConnectionImpl extends ElementImpl implements Connection @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.CONNECTION__END_POINT: return ((InternalEList)getEndPoint()).basicRemove(otherEnd, msgs); } @@ -103,8 +101,7 @@ public class ConnectionImpl extends ElementImpl implements Connection @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.CONNECTION__END_POINT: return getEndPoint(); } @@ -120,8 +117,7 @@ public class ConnectionImpl extends ElementImpl implements Connection @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.CONNECTION__END_POINT: getEndPoint().clear(); getEndPoint().addAll((Collection)newValue); @@ -138,8 +134,7 @@ public class ConnectionImpl extends ElementImpl implements Connection @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.CONNECTION__END_POINT: getEndPoint().clear(); return; @@ -155,8 +150,7 @@ public class ConnectionImpl extends ElementImpl implements Connection @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.CONNECTION__END_POINT: return endPoint != null && !endPoint.isEmpty(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ConstraintImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ConstraintImpl.java index ab4c9fc3..ed1c088e 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ConstraintImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ConstraintImpl.java @@ -87,12 +87,10 @@ public class ConstraintImpl extends ElementImpl implements Constraint @Override public ConstraintType getType() { - if (type != null && type.eIsProxy()) - { + if (type != null && type.eIsProxy()) { InternalEObject oldType = (InternalEObject)type; type = (ConstraintType)eResolveProxy(oldType); - if (type != oldType) - { + if (type != oldType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.CONSTRAINT__TYPE, oldType, type)); } @@ -132,8 +130,7 @@ public class ConstraintImpl extends ElementImpl implements Constraint @Override public EList getQuantifier() { - if (quantifier == null) - { + if (quantifier == null) { quantifier = new EObjectContainmentEList(DataUse.class, this, tdlPackage.CONSTRAINT__QUANTIFIER); } return quantifier; @@ -147,8 +144,7 @@ public class ConstraintImpl extends ElementImpl implements Constraint @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.CONSTRAINT__QUANTIFIER: return ((InternalEList)getQuantifier()).basicRemove(otherEnd, msgs); } @@ -163,8 +159,7 @@ public class ConstraintImpl extends ElementImpl implements Constraint @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.CONSTRAINT__TYPE: if (resolve) return getType(); return basicGetType(); @@ -183,8 +178,7 @@ public class ConstraintImpl extends ElementImpl implements Constraint @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.CONSTRAINT__TYPE: setType((ConstraintType)newValue); return; @@ -204,8 +198,7 @@ public class ConstraintImpl extends ElementImpl implements Constraint @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.CONSTRAINT__TYPE: setType((ConstraintType)null); return; @@ -224,8 +217,7 @@ public class ConstraintImpl extends ElementImpl implements Constraint @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.CONSTRAINT__TYPE: return type != null; case tdlPackage.CONSTRAINT__QUANTIFIER: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataElementMappingImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataElementMappingImpl.java index fc04b9b3..9f725c7f 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataElementMappingImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataElementMappingImpl.java @@ -120,12 +120,10 @@ public class DataElementMappingImpl extends PackageableElementImpl implements Da @Override public MappableDataElement getMappableDataElement() { - if (mappableDataElement != null && mappableDataElement.eIsProxy()) - { + if (mappableDataElement != null && mappableDataElement.eIsProxy()) { InternalEObject oldMappableDataElement = (InternalEObject)mappableDataElement; mappableDataElement = (MappableDataElement)eResolveProxy(oldMappableDataElement); - if (mappableDataElement != oldMappableDataElement) - { + if (mappableDataElement != oldMappableDataElement) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.DATA_ELEMENT_MAPPING__MAPPABLE_DATA_ELEMENT, oldMappableDataElement, mappableDataElement)); } @@ -190,12 +188,10 @@ public class DataElementMappingImpl extends PackageableElementImpl implements Da @Override public DataResourceMapping getDataResourceMapping() { - if (dataResourceMapping != null && dataResourceMapping.eIsProxy()) - { + if (dataResourceMapping != null && dataResourceMapping.eIsProxy()) { InternalEObject oldDataResourceMapping = (InternalEObject)dataResourceMapping; dataResourceMapping = (DataResourceMapping)eResolveProxy(oldDataResourceMapping); - if (dataResourceMapping != oldDataResourceMapping) - { + if (dataResourceMapping != oldDataResourceMapping) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.DATA_ELEMENT_MAPPING__DATA_RESOURCE_MAPPING, oldDataResourceMapping, dataResourceMapping)); } @@ -235,8 +231,7 @@ public class DataElementMappingImpl extends PackageableElementImpl implements Da @Override public EList getParameterMapping() { - if (parameterMapping == null) - { + if (parameterMapping == null) { parameterMapping = new EObjectContainmentEList(ParameterMapping.class, this, tdlPackage.DATA_ELEMENT_MAPPING__PARAMETER_MAPPING); } return parameterMapping; @@ -250,8 +245,7 @@ public class DataElementMappingImpl extends PackageableElementImpl implements Da @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_ELEMENT_MAPPING__PARAMETER_MAPPING: return ((InternalEList)getParameterMapping()).basicRemove(otherEnd, msgs); } @@ -266,8 +260,7 @@ public class DataElementMappingImpl extends PackageableElementImpl implements Da @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_ELEMENT_MAPPING__MAPPABLE_DATA_ELEMENT: if (resolve) return getMappableDataElement(); return basicGetMappableDataElement(); @@ -291,8 +284,7 @@ public class DataElementMappingImpl extends PackageableElementImpl implements Da @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_ELEMENT_MAPPING__MAPPABLE_DATA_ELEMENT: setMappableDataElement((MappableDataElement)newValue); return; @@ -318,8 +310,7 @@ public class DataElementMappingImpl extends PackageableElementImpl implements Da @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_ELEMENT_MAPPING__MAPPABLE_DATA_ELEMENT: setMappableDataElement((MappableDataElement)null); return; @@ -344,8 +335,7 @@ public class DataElementMappingImpl extends PackageableElementImpl implements Da @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_ELEMENT_MAPPING__MAPPABLE_DATA_ELEMENT: return mappableDataElement != null; case tdlPackage.DATA_ELEMENT_MAPPING__ELEMENT_URI: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataElementUseImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataElementUseImpl.java index 2ce4388b..b04aaac5 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataElementUseImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataElementUseImpl.java @@ -10,10 +10,7 @@ import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; @@ -21,12 +18,31 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsTypeOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsKindOfOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsTypeOfOperation; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.etsi.mts.tdl.CollectionDataInstance; +import org.etsi.mts.tdl.CollectionDataType; import org.etsi.mts.tdl.DataElementUse; +import org.etsi.mts.tdl.DataInstance; +import org.etsi.mts.tdl.DataInstanceUse; import org.etsi.mts.tdl.DataType; import org.etsi.mts.tdl.DataUse; +import org.etsi.mts.tdl.Element; +import org.etsi.mts.tdl.FormalParameter; +import org.etsi.mts.tdl.Function; +import org.etsi.mts.tdl.Member; +import org.etsi.mts.tdl.MemberAssignment; import org.etsi.mts.tdl.NamedElement; +import org.etsi.mts.tdl.ParameterBinding; import org.etsi.mts.tdl.UnassignedMemberTreatment; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -139,12 +155,10 @@ public class DataElementUseImpl extends DataUseImpl implements DataElementUse @Override public NamedElement getDataElement() { - if (dataElement != null && dataElement.eIsProxy()) - { + if (dataElement != null && dataElement.eIsProxy()) { InternalEObject oldDataElement = (InternalEObject)dataElement; dataElement = (NamedElement)eResolveProxy(oldDataElement); - if (dataElement != oldDataElement) - { + if (dataElement != oldDataElement) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.DATA_ELEMENT_USE__DATA_ELEMENT, oldDataElement, dataElement)); } @@ -184,23 +198,12 @@ public class DataElementUseImpl extends DataUseImpl implements DataElementUse @Override public EList getItem() { - if (item == null) - { + if (item == null) { item = new EObjectContainmentEList(DataUse.class, this, tdlPackage.DATA_ELEMENT_USE__ITEM); } return item; } - /** - * The cached invocation delegate for the '{@link #resolveDataType() Resolve Data Type}' operation. - * - * - * @see #resolveDataType() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate RESOLVE_DATA_TYPE__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.DATA_ELEMENT_USE___RESOLVE_DATA_TYPE).getInvocationDelegate(); - /** * * @@ -209,14 +212,203 @@ public class DataElementUseImpl extends DataUseImpl implements DataElementUse @Override public DataType resolveDataType() { - try - { - return (DataType)RESOLVE_DATA_TYPE__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if not self.dataElement.oclIsUndefined() + * then + * if self.dataElement.oclIsKindOf(DataType) + * then self.dataElement.oclAsType(DataType) + * else + * if self.dataElement.oclIsKindOf(DataInstance) + * then self.dataElement.oclAsType(DataInstance).dataType + * else + * if self.dataElement.oclIsTypeOf(FormalParameter) + * then self.dataElement.oclAsType(FormalParameter).dataType + * else + * if self.dataElement.oclIsTypeOf(Function) + * then self.dataElement.oclAsType(Function).returnType + * else null + * endif + * endif + * endif + * endif + * else + * if self.container().oclIsTypeOf(MemberAssignment) + * then + * self.container() + * .oclAsType(MemberAssignment).member.dataType + * else + * if self.container().oclIsTypeOf(ParameterBinding) + * then + * self.container() + * .oclAsType(ParameterBinding) + * .resolveParameterType() + * else + * if + * self.container() + * .oclIsTypeOf(CollectionDataInstance) + * then + * self.container() + * .oclAsType(CollectionDataInstance) + * .dataType.oclAsType(CollectionDataType).itemType + * else + * if self.container().oclIsTypeOf(DataElementUse) + * then + * self.container() + * .oclAsType(DataElementUse) + * .resolveDataType() + * .oclAsType(CollectionDataType).itemType + * else + * if self.container().oclIsTypeOf(DataInstanceUse) + * then + * self.container() + * .oclAsType(DataInstanceUse) + * .resolveDataType() + * .oclAsType(CollectionDataType).itemType + * else null + * endif + * endif + * endif + * endif + * endif + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ NamedElement dataElement_1 = this.getDataElement(); + final /*@NonInvalid*/ boolean oclIsUndefined = dataElement_1 == null; + final /*@NonInvalid*/ Boolean not; + if (!oclIsUndefined) { + not = ValueUtil.TRUE_VALUE; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + if (oclIsUndefined) { + not = ValueUtil.FALSE_VALUE; + } + else { + not = null; + } + } + if (not == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ DataType local_9; + if (not) { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_DataType_1 = idResolver.getClass(tdlTables.CLSSid_DataType, null); + final /*@Thrown*/ boolean oclIsKindOf = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, dataElement_1, TYP_tdl_c_c_DataType_1).booleanValue(); + /*@Thrown*/ DataType local_3; + if (oclIsKindOf) { + final /*@Thrown*/ DataType oclAsType = (DataType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, dataElement_1, TYP_tdl_c_c_DataType_1); + local_3 = oclAsType; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_DataInstance_0 = idResolver.getClass(tdlTables.CLSSid_DataInstance, null); + final /*@Thrown*/ boolean oclIsKindOf_0 = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, dataElement_1, TYP_tdl_c_c_DataInstance_0).booleanValue(); + /*@Thrown*/ DataType local_2; + if (oclIsKindOf_0) { + final /*@Thrown*/ DataInstance oclAsType_0 = (DataInstance)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, dataElement_1, TYP_tdl_c_c_DataInstance_0); + final /*@Thrown*/ DataType dataType = oclAsType_0.getDataType(); + local_2 = dataType; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_FormalParameter_0 = idResolver.getClass(tdlTables.CLSSid_FormalParameter, null); + final /*@Thrown*/ boolean oclIsTypeOf = OclAnyOclIsTypeOfOperation.INSTANCE.evaluate(executor, dataElement_1, TYP_tdl_c_c_FormalParameter_0).booleanValue(); + /*@Thrown*/ DataType local_1; + if (oclIsTypeOf) { + final /*@Thrown*/ FormalParameter oclAsType_1 = (FormalParameter)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, dataElement_1, TYP_tdl_c_c_FormalParameter_0); + final /*@Thrown*/ DataType dataType_0 = oclAsType_1.getDataType(); + local_1 = dataType_0; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_Function_0 = idResolver.getClass(tdlTables.CLSSid_Function, null); + final /*@Thrown*/ boolean oclIsTypeOf_0 = OclAnyOclIsTypeOfOperation.INSTANCE.evaluate(executor, dataElement_1, TYP_tdl_c_c_Function_0).booleanValue(); + /*@Thrown*/ DataType local_0; + if (oclIsTypeOf_0) { + final /*@Thrown*/ Function oclAsType_2 = (Function)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, dataElement_1, TYP_tdl_c_c_Function_0); + final /*@Thrown*/ DataType returnType = oclAsType_2.getReturnType(); + local_0 = returnType; + } + else { + local_0 = null; + } + local_1 = local_0; + } + local_2 = local_1; + } + local_3 = local_2; + } + local_9 = local_3; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_MemberAssignment_0 = idResolver.getClass(tdlTables.CLSSid_MemberAssignment, null); + final /*@NonInvalid*/ Element container = this.container(); + final /*@NonInvalid*/ boolean oclIsTypeOf_1 = OclAnyOclIsTypeOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_MemberAssignment_0).booleanValue(); + /*@Thrown*/ DataType local_8; + if (oclIsTypeOf_1) { + final /*@Thrown*/ MemberAssignment oclAsType_3 = (MemberAssignment)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_MemberAssignment_0); + final /*@Thrown*/ Member member = oclAsType_3.getMember(); + final /*@Thrown*/ DataType dataType_1 = member.getDataType(); + local_8 = dataType_1; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_ParameterBinding_0 = idResolver.getClass(tdlTables.CLSSid_ParameterBinding, null); + final /*@NonInvalid*/ boolean oclIsTypeOf_2 = OclAnyOclIsTypeOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_ParameterBinding_0).booleanValue(); + /*@Thrown*/ DataType local_7; + if (oclIsTypeOf_2) { + final /*@Thrown*/ ParameterBinding oclAsType_4 = (ParameterBinding)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_ParameterBinding_0); + final /*@Thrown*/ DataType resolveParameterType = oclAsType_4.resolveParameterType(); + local_7 = resolveParameterType; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_CollectionDataInstance_0 = idResolver.getClass(tdlTables.CLSSid_CollectionDataInstance, null); + final /*@NonInvalid*/ boolean oclIsTypeOf_3 = OclAnyOclIsTypeOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_CollectionDataInstance_0).booleanValue(); + /*@Thrown*/ DataType local_6; + if (oclIsTypeOf_3) { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_CollectionDataType_0 = idResolver.getClass(tdlTables.CLSSid_CollectionDataType, null); + final /*@Thrown*/ CollectionDataInstance oclAsType_5 = (CollectionDataInstance)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_CollectionDataInstance_0); + final /*@Thrown*/ DataType dataType_2 = oclAsType_5.getDataType(); + final /*@Thrown*/ CollectionDataType oclAsType_6 = (CollectionDataType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, dataType_2, TYP_tdl_c_c_CollectionDataType_0); + final /*@Thrown*/ DataType itemType = oclAsType_6.getItemType(); + local_6 = itemType; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_DataElementUse_0 = idResolver.getClass(tdlTables.CLSSid_DataElementUse, null); + final /*@NonInvalid*/ boolean oclIsTypeOf_4 = OclAnyOclIsTypeOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_DataElementUse_0).booleanValue(); + /*@Thrown*/ DataType local_5; + if (oclIsTypeOf_4) { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_CollectionDataType_1 = idResolver.getClass(tdlTables.CLSSid_CollectionDataType, null); + final /*@Thrown*/ DataElementUse oclAsType_7 = (DataElementUse)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_DataElementUse_0); + final /*@Thrown*/ DataType resolveDataType = oclAsType_7.resolveDataType(); + final /*@Thrown*/ CollectionDataType oclAsType_8 = (CollectionDataType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, resolveDataType, TYP_tdl_c_c_CollectionDataType_1); + final /*@Thrown*/ DataType itemType_0 = oclAsType_8.getItemType(); + local_5 = itemType_0; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_DataInstanceUse_0 = idResolver.getClass(tdlTables.CLSSid_DataInstanceUse, null); + final /*@NonInvalid*/ boolean oclIsTypeOf_5 = OclAnyOclIsTypeOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_DataInstanceUse_0).booleanValue(); + /*@Thrown*/ DataType local_4; + if (oclIsTypeOf_5) { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_CollectionDataType_2 = idResolver.getClass(tdlTables.CLSSid_CollectionDataType, null); + final /*@Thrown*/ DataInstanceUse oclAsType_9 = (DataInstanceUse)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_DataInstanceUse_0); + final /*@Thrown*/ DataType resolveDataType_0 = oclAsType_9.resolveDataType(); + final /*@Thrown*/ CollectionDataType oclAsType_10 = (CollectionDataType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, resolveDataType_0, TYP_tdl_c_c_CollectionDataType_2); + final /*@Thrown*/ DataType itemType_1 = oclAsType_10.getItemType(); + local_4 = itemType_1; + } + else { + local_4 = null; + } + local_5 = local_4; + } + local_6 = local_5; + } + local_7 = local_6; + } + local_8 = local_7; + } + local_9 = local_8; } + return local_9; } /** @@ -227,8 +419,7 @@ public class DataElementUseImpl extends DataUseImpl implements DataElementUse @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_ELEMENT_USE__ITEM: return ((InternalEList)getItem()).basicRemove(otherEnd, msgs); } @@ -243,8 +434,7 @@ public class DataElementUseImpl extends DataUseImpl implements DataElementUse @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_ELEMENT_USE__UNASSIGNED_MEMBER: return getUnassignedMember(); case tdlPackage.DATA_ELEMENT_USE__DATA_ELEMENT: @@ -265,8 +455,7 @@ public class DataElementUseImpl extends DataUseImpl implements DataElementUse @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_ELEMENT_USE__UNASSIGNED_MEMBER: setUnassignedMember((UnassignedMemberTreatment)newValue); return; @@ -289,8 +478,7 @@ public class DataElementUseImpl extends DataUseImpl implements DataElementUse @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_ELEMENT_USE__UNASSIGNED_MEMBER: setUnassignedMember(UNASSIGNED_MEMBER_EDEFAULT); return; @@ -312,8 +500,7 @@ public class DataElementUseImpl extends DataUseImpl implements DataElementUse @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_ELEMENT_USE__UNASSIGNED_MEMBER: return unassignedMember != UNASSIGNED_MEMBER_EDEFAULT; case tdlPackage.DATA_ELEMENT_USE__DATA_ELEMENT: @@ -332,10 +519,8 @@ public class DataElementUseImpl extends DataUseImpl implements DataElementUse @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == DataUse.class) - { - switch (baseOperationID) - { + if (baseClass == DataUse.class) { + switch (baseOperationID) { case tdlPackage.DATA_USE___RESOLVE_DATA_TYPE: return tdlPackage.DATA_ELEMENT_USE___RESOLVE_DATA_TYPE; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -351,8 +536,7 @@ public class DataElementUseImpl extends DataUseImpl implements DataElementUse @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.DATA_ELEMENT_USE___RESOLVE_DATA_TYPE: return resolveDataType(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataInstanceImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataInstanceImpl.java index cfdbfe28..456422d0 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataInstanceImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataInstanceImpl.java @@ -67,12 +67,10 @@ public abstract class DataInstanceImpl extends MappableDataElementImpl implement @Override public DataType getDataType() { - if (dataType != null && dataType.eIsProxy()) - { + if (dataType != null && dataType.eIsProxy()) { InternalEObject oldDataType = (InternalEObject)dataType; dataType = (DataType)eResolveProxy(oldDataType); - if (dataType != oldDataType) - { + if (dataType != oldDataType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.DATA_INSTANCE__DATA_TYPE, oldDataType, dataType)); } @@ -112,8 +110,7 @@ public abstract class DataInstanceImpl extends MappableDataElementImpl implement @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_INSTANCE__DATA_TYPE: if (resolve) return getDataType(); return basicGetDataType(); @@ -129,8 +126,7 @@ public abstract class DataInstanceImpl extends MappableDataElementImpl implement @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_INSTANCE__DATA_TYPE: setDataType((DataType)newValue); return; @@ -146,8 +142,7 @@ public abstract class DataInstanceImpl extends MappableDataElementImpl implement @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_INSTANCE__DATA_TYPE: setDataType((DataType)null); return; @@ -163,8 +158,7 @@ public abstract class DataInstanceImpl extends MappableDataElementImpl implement @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_INSTANCE__DATA_TYPE: return dataType != null; } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataInstanceUseImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataInstanceUseImpl.java index c4827d9f..64fd169d 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataInstanceUseImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataInstanceUseImpl.java @@ -10,10 +10,7 @@ import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; @@ -21,12 +18,28 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsTypeOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsTypeOfOperation; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.etsi.mts.tdl.CollectionDataInstance; +import org.etsi.mts.tdl.CollectionDataType; +import org.etsi.mts.tdl.DataElementUse; import org.etsi.mts.tdl.DataInstance; import org.etsi.mts.tdl.DataInstanceUse; import org.etsi.mts.tdl.DataType; import org.etsi.mts.tdl.DataUse; +import org.etsi.mts.tdl.Element; +import org.etsi.mts.tdl.Member; +import org.etsi.mts.tdl.MemberAssignment; +import org.etsi.mts.tdl.Parameter; +import org.etsi.mts.tdl.ParameterBinding; import org.etsi.mts.tdl.UnassignedMemberTreatment; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -125,12 +138,10 @@ public class DataInstanceUseImpl extends StaticDataUseImpl implements DataInstan @Override public DataInstance getDataInstance() { - if (dataInstance != null && dataInstance.eIsProxy()) - { + if (dataInstance != null && dataInstance.eIsProxy()) { InternalEObject oldDataInstance = (InternalEObject)dataInstance; dataInstance = (DataInstance)eResolveProxy(oldDataInstance); - if (dataInstance != oldDataInstance) - { + if (dataInstance != oldDataInstance) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.DATA_INSTANCE_USE__DATA_INSTANCE, oldDataInstance, dataInstance)); } @@ -195,12 +206,10 @@ public class DataInstanceUseImpl extends StaticDataUseImpl implements DataInstan @Override public DataType getDataType() { - if (dataType != null && dataType.eIsProxy()) - { + if (dataType != null && dataType.eIsProxy()) { InternalEObject oldDataType = (InternalEObject)dataType; dataType = (DataType)eResolveProxy(oldDataType); - if (dataType != oldDataType) - { + if (dataType != oldDataType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.DATA_INSTANCE_USE__DATA_TYPE, oldDataType, dataType)); } @@ -240,23 +249,12 @@ public class DataInstanceUseImpl extends StaticDataUseImpl implements DataInstan @Override public EList getItem() { - if (item == null) - { + if (item == null) { item = new EObjectContainmentEList(DataUse.class, this, tdlPackage.DATA_INSTANCE_USE__ITEM); } return item; } - /** - * The cached invocation delegate for the '{@link #resolveDataType() Resolve Data Type}' operation. - * - * - * @see #resolveDataType() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate RESOLVE_DATA_TYPE__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.DATA_INSTANCE_USE___RESOLVE_DATA_TYPE).getInvocationDelegate(); - /** * * @@ -265,14 +263,176 @@ public class DataInstanceUseImpl extends StaticDataUseImpl implements DataInstan @Override public DataType resolveDataType() { - try - { - return (DataType)RESOLVE_DATA_TYPE__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if not self.dataInstance.oclIsUndefined() + * then self.dataInstance.dataType + * else + * if not self.dataType.oclIsUndefined() + * then self.dataType + * else + * if self.container().oclIsTypeOf(MemberAssignment) + * then + * self.container() + * .oclAsType(MemberAssignment).member.dataType + * else + * if self.container().oclIsTypeOf(ParameterBinding) + * then + * self.container() + * .oclAsType(ParameterBinding).parameter.dataType + * else + * if + * self.container() + * .oclIsTypeOf(CollectionDataInstance) + * then + * self.container() + * .oclAsType(CollectionDataInstance) + * .dataType.oclAsType(CollectionDataType).itemType + * else + * if self.container().oclIsTypeOf(DataElementUse) + * then + * self.container() + * .oclAsType(DataElementUse) + * .resolveDataType() + * .oclAsType(CollectionDataType).itemType + * else + * if self.container().oclIsTypeOf(DataInstanceUse) + * then + * self.container() + * .oclAsType(DataInstanceUse) + * .resolveDataType() + * .oclAsType(CollectionDataType).itemType + * else null + * endif + * endif + * endif + * endif + * endif + * endif + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ DataInstance dataInstance_0 = this.getDataInstance(); + final /*@NonInvalid*/ boolean oclIsUndefined = dataInstance_0 == null; + final /*@NonInvalid*/ Boolean not; + if (!oclIsUndefined) { + not = ValueUtil.TRUE_VALUE; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + if (oclIsUndefined) { + not = ValueUtil.FALSE_VALUE; + } + else { + not = null; + } + } + if (not == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ DataType local_6; + if (not) { + if (dataInstance_0 == null) { + throw new InvalidValueException("Null source for \'\'http://www.etsi.org/spec/TDL/1.4.1\'::DataInstance::dataType\'"); + } + final /*@Thrown*/ DataType dataType = dataInstance_0.getDataType(); + local_6 = dataType; + } + else { + final /*@NonInvalid*/ DataType dataType_1 = this.getDataType(); + final /*@NonInvalid*/ boolean oclIsUndefined_0 = dataType_1 == null; + final /*@NonInvalid*/ Boolean not_0; + if (!oclIsUndefined_0) { + not_0 = ValueUtil.TRUE_VALUE; + } + else { + if (oclIsUndefined_0) { + not_0 = ValueUtil.FALSE_VALUE; + } + else { + not_0 = null; + } + } + if (not_0 == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ DataType local_5; + if (not_0) { + local_5 = dataType_1; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_MemberAssignment_0 = idResolver.getClass(tdlTables.CLSSid_MemberAssignment, null); + final /*@NonInvalid*/ Element container = this.container(); + final /*@NonInvalid*/ boolean oclIsTypeOf = OclAnyOclIsTypeOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_MemberAssignment_0).booleanValue(); + /*@Thrown*/ DataType local_4; + if (oclIsTypeOf) { + final /*@Thrown*/ MemberAssignment oclAsType = (MemberAssignment)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_MemberAssignment_0); + final /*@Thrown*/ Member member = oclAsType.getMember(); + final /*@Thrown*/ DataType dataType_2 = member.getDataType(); + local_4 = dataType_2; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_ParameterBinding_0 = idResolver.getClass(tdlTables.CLSSid_ParameterBinding, null); + final /*@NonInvalid*/ boolean oclIsTypeOf_0 = OclAnyOclIsTypeOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_ParameterBinding_0).booleanValue(); + /*@Thrown*/ DataType local_3; + if (oclIsTypeOf_0) { + final /*@Thrown*/ ParameterBinding oclAsType_0 = (ParameterBinding)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_ParameterBinding_0); + final /*@Thrown*/ Parameter parameter = oclAsType_0.getParameter(); + final /*@Thrown*/ DataType dataType_3 = parameter.getDataType(); + local_3 = dataType_3; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_CollectionDataInstance_0 = idResolver.getClass(tdlTables.CLSSid_CollectionDataInstance, null); + final /*@NonInvalid*/ boolean oclIsTypeOf_1 = OclAnyOclIsTypeOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_CollectionDataInstance_0).booleanValue(); + /*@Thrown*/ DataType local_2; + if (oclIsTypeOf_1) { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_CollectionDataType_0 = idResolver.getClass(tdlTables.CLSSid_CollectionDataType, null); + final /*@Thrown*/ CollectionDataInstance oclAsType_1 = (CollectionDataInstance)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_CollectionDataInstance_0); + final /*@Thrown*/ DataType dataType_4 = oclAsType_1.getDataType(); + final /*@Thrown*/ CollectionDataType oclAsType_2 = (CollectionDataType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, dataType_4, TYP_tdl_c_c_CollectionDataType_0); + final /*@Thrown*/ DataType itemType = oclAsType_2.getItemType(); + local_2 = itemType; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_DataElementUse_0 = idResolver.getClass(tdlTables.CLSSid_DataElementUse, null); + final /*@NonInvalid*/ boolean oclIsTypeOf_2 = OclAnyOclIsTypeOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_DataElementUse_0).booleanValue(); + /*@Thrown*/ DataType local_1; + if (oclIsTypeOf_2) { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_CollectionDataType_1 = idResolver.getClass(tdlTables.CLSSid_CollectionDataType, null); + final /*@Thrown*/ DataElementUse oclAsType_3 = (DataElementUse)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_DataElementUse_0); + final /*@Thrown*/ DataType resolveDataType = oclAsType_3.resolveDataType(); + final /*@Thrown*/ CollectionDataType oclAsType_4 = (CollectionDataType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, resolveDataType, TYP_tdl_c_c_CollectionDataType_1); + final /*@Thrown*/ DataType itemType_0 = oclAsType_4.getItemType(); + local_1 = itemType_0; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_DataInstanceUse_0 = idResolver.getClass(tdlTables.CLSSid_DataInstanceUse, null); + final /*@NonInvalid*/ boolean oclIsTypeOf_3 = OclAnyOclIsTypeOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_DataInstanceUse_0).booleanValue(); + /*@Thrown*/ DataType local_0; + if (oclIsTypeOf_3) { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_CollectionDataType_2 = idResolver.getClass(tdlTables.CLSSid_CollectionDataType, null); + final /*@Thrown*/ DataInstanceUse oclAsType_5 = (DataInstanceUse)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_DataInstanceUse_0); + final /*@Thrown*/ DataType resolveDataType_0 = oclAsType_5.resolveDataType(); + final /*@Thrown*/ CollectionDataType oclAsType_6 = (CollectionDataType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, resolveDataType_0, TYP_tdl_c_c_CollectionDataType_2); + final /*@Thrown*/ DataType itemType_1 = oclAsType_6.getItemType(); + local_0 = itemType_1; + } + else { + local_0 = null; + } + local_1 = local_0; + } + local_2 = local_1; + } + local_3 = local_2; + } + local_4 = local_3; + } + local_5 = local_4; + } + local_6 = local_5; } + return local_6; } /** @@ -283,8 +443,7 @@ public class DataInstanceUseImpl extends StaticDataUseImpl implements DataInstan @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_INSTANCE_USE__ITEM: return ((InternalEList)getItem()).basicRemove(otherEnd, msgs); } @@ -299,8 +458,7 @@ public class DataInstanceUseImpl extends StaticDataUseImpl implements DataInstan @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_INSTANCE_USE__DATA_INSTANCE: if (resolve) return getDataInstance(); return basicGetDataInstance(); @@ -324,8 +482,7 @@ public class DataInstanceUseImpl extends StaticDataUseImpl implements DataInstan @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_INSTANCE_USE__DATA_INSTANCE: setDataInstance((DataInstance)newValue); return; @@ -351,8 +508,7 @@ public class DataInstanceUseImpl extends StaticDataUseImpl implements DataInstan @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_INSTANCE_USE__DATA_INSTANCE: setDataInstance((DataInstance)null); return; @@ -377,8 +533,7 @@ public class DataInstanceUseImpl extends StaticDataUseImpl implements DataInstan @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_INSTANCE_USE__DATA_INSTANCE: return dataInstance != null; case tdlPackage.DATA_INSTANCE_USE__UNASSIGNED_MEMBER: @@ -399,10 +554,8 @@ public class DataInstanceUseImpl extends StaticDataUseImpl implements DataInstan @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == DataUse.class) - { - switch (baseOperationID) - { + if (baseClass == DataUse.class) { + switch (baseOperationID) { case tdlPackage.DATA_USE___RESOLVE_DATA_TYPE: return tdlPackage.DATA_INSTANCE_USE___RESOLVE_DATA_TYPE; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -418,8 +571,7 @@ public class DataInstanceUseImpl extends StaticDataUseImpl implements DataInstan @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.DATA_INSTANCE_USE___RESOLVE_DATA_TYPE: return resolveDataType(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataResourceMappingImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataResourceMappingImpl.java index 0322d595..ae67a87f 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataResourceMappingImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataResourceMappingImpl.java @@ -100,8 +100,7 @@ public class DataResourceMappingImpl extends PackageableElementImpl implements D @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_RESOURCE_MAPPING__RESOURCE_URI: return getResourceURI(); } @@ -116,8 +115,7 @@ public class DataResourceMappingImpl extends PackageableElementImpl implements D @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_RESOURCE_MAPPING__RESOURCE_URI: setResourceURI((String)newValue); return; @@ -133,8 +131,7 @@ public class DataResourceMappingImpl extends PackageableElementImpl implements D @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_RESOURCE_MAPPING__RESOURCE_URI: setResourceURI(RESOURCE_URI_EDEFAULT); return; @@ -150,8 +147,7 @@ public class DataResourceMappingImpl extends PackageableElementImpl implements D @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_RESOURCE_MAPPING__RESOURCE_URI: return RESOURCE_URI_EDEFAULT == null ? resourceURI != null : !RESOURCE_URI_EDEFAULT.equals(resourceURI); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataTypeImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataTypeImpl.java index 3c211afc..d4dce3ac 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataTypeImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataTypeImpl.java @@ -6,13 +6,11 @@ import java.lang.reflect.InvocationTargetException; import java.util.Collection; +import java.util.List; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.util.EObjectContainmentEList; @@ -76,23 +74,12 @@ public abstract class DataTypeImpl extends MappableDataElementImpl implements Da @Override public EList getConstraint() { - if (constraint == null) - { + if (constraint == null) { constraint = new EObjectContainmentEList(Constraint.class, this, tdlPackage.DATA_TYPE__CONSTRAINT); } return constraint; } - /** - * The cached invocation delegate for the '{@link #allConstraints() All Constraints}' operation. - * - * - * @see #allConstraints() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate ALL_CONSTRAINTS__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.DATA_TYPE___ALL_CONSTRAINTS).getInvocationDelegate(); - /** * * @@ -102,14 +89,11 @@ public abstract class DataTypeImpl extends MappableDataElementImpl implements Da @Override public EList allConstraints() { - try - { - return (EList)ALL_CONSTRAINTS__EINVOCATION_DELEGATE.dynamicInvoke(this, null); - } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); - } + /** + * self.constraint + */ + final /*@NonInvalid*/ List constraint = this.getConstraint(); + return (EList)constraint; } /** @@ -120,8 +104,7 @@ public abstract class DataTypeImpl extends MappableDataElementImpl implements Da @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_TYPE__CONSTRAINT: return ((InternalEList)getConstraint()).basicRemove(otherEnd, msgs); } @@ -136,8 +119,7 @@ public abstract class DataTypeImpl extends MappableDataElementImpl implements Da @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_TYPE__CONSTRAINT: return getConstraint(); } @@ -153,8 +135,7 @@ public abstract class DataTypeImpl extends MappableDataElementImpl implements Da @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_TYPE__CONSTRAINT: getConstraint().clear(); getConstraint().addAll((Collection)newValue); @@ -171,8 +152,7 @@ public abstract class DataTypeImpl extends MappableDataElementImpl implements Da @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_TYPE__CONSTRAINT: getConstraint().clear(); return; @@ -188,8 +168,7 @@ public abstract class DataTypeImpl extends MappableDataElementImpl implements Da @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_TYPE__CONSTRAINT: return constraint != null && !constraint.isEmpty(); } @@ -204,8 +183,7 @@ public abstract class DataTypeImpl extends MappableDataElementImpl implements Da @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.DATA_TYPE___ALL_CONSTRAINTS: return allConstraints(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataUseImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataUseImpl.java index fa8d2398..9c277e37 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataUseImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/DataUseImpl.java @@ -6,23 +6,34 @@ import java.lang.reflect.InvocationTargetException; import java.util.Collection; +import java.util.Iterator; +import java.util.List; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsTypeOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsKindOfOperation; +import org.eclipse.ocl.pivot.messages.PivotMessages; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.etsi.mts.tdl.DataElementUse; import org.etsi.mts.tdl.DataType; import org.etsi.mts.tdl.DataUse; import org.etsi.mts.tdl.MemberReference; +import org.etsi.mts.tdl.NamedElement; import org.etsi.mts.tdl.ParameterBinding; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -89,8 +100,7 @@ public abstract class DataUseImpl extends ElementImpl implements DataUse @Override public EList getArgument() { - if (argument == null) - { + if (argument == null) { argument = new EObjectContainmentEList(ParameterBinding.class, this, tdlPackage.DATA_USE__ARGUMENT); } return argument; @@ -104,23 +114,12 @@ public abstract class DataUseImpl extends ElementImpl implements DataUse @Override public EList getReduction() { - if (reduction == null) - { + if (reduction == null) { reduction = new EObjectContainmentEList(MemberReference.class, this, tdlPackage.DATA_USE__REDUCTION); } return reduction; } - /** - * The cached invocation delegate for the '{@link #resolveDataType() Resolve Data Type}' operation. - * - * - * @see #resolveDataType() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate RESOLVE_DATA_TYPE__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.DATA_USE___RESOLVE_DATA_TYPE).getInvocationDelegate(); - /** * * @@ -129,26 +128,12 @@ public abstract class DataUseImpl extends ElementImpl implements DataUse @Override public DataType resolveDataType() { - try - { - return (DataType)RESOLVE_DATA_TYPE__EINVOCATION_DELEGATE.dynamicInvoke(this, null); - } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); - } + /** + * null + */ + return null; } - /** - * The cached invocation delegate for the '{@link #isEffectivelyStatic() Is Effectively Static}' operation. - * - * - * @see #isEffectivelyStatic() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate IS_EFFECTIVELY_STATIC__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.DATA_USE___IS_EFFECTIVELY_STATIC).getInvocationDelegate(); - /** * * @@ -157,14 +142,223 @@ public abstract class DataUseImpl extends ElementImpl implements DataUse @Override public boolean isEffectivelyStatic() { - try - { - return (Boolean)IS_EFFECTIVELY_STATIC__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * ( + * self.oclIsKindOf(StaticDataUse) or + * self.oclIsKindOf(DataElementUse) and + * ( + * self.oclAsType(DataElementUse) + * .dataElement.oclIsUndefined() or + * self.oclAsType(DataElementUse) + * .dataElement.oclIsKindOf(DataInstance) or + * self.oclAsType(DataElementUse) + * .dataElement.oclIsKindOf(DataType) + * ) + * ) and + * self.argument->forAll(a | a.dataUse.isEffectivelyStatic()) + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + /*@Caught*/ Object CAUGHT_or_1; + try { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_StaticDataUse_0 = idResolver.getClass(tdlTables.CLSSid_StaticDataUse, null); + final /*@NonInvalid*/ boolean oclIsKindOf = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_StaticDataUse_0).booleanValue(); + final /*@Thrown*/ Boolean or_1; + if (oclIsKindOf) { + or_1 = ValueUtil.TRUE_VALUE; + } + else { + /*@Caught*/ Object CAUGHT_and; + try { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_DataElementUse_0 = idResolver.getClass(tdlTables.CLSSid_DataElementUse, null); + final /*@NonInvalid*/ boolean oclIsKindOf_0 = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_DataElementUse_0).booleanValue(); + final /*@Thrown*/ Boolean and; + if (!oclIsKindOf_0) { + and = ValueUtil.FALSE_VALUE; + } + else { + /*@Caught*/ Object CAUGHT_or_0; + try { + /*@Caught*/ Object CAUGHT_or; + try { + /*@Caught*/ Object CAUGHT_dataElement; + try { + final /*@Thrown*/ DataElementUse oclAsType = (DataElementUse)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_DataElementUse_0); + final /*@Thrown*/ NamedElement dataElement = oclAsType.getDataElement(); + CAUGHT_dataElement = dataElement; + } + catch (Exception e) { + CAUGHT_dataElement = ValueUtil.createInvalidValue(e); + } + final /*@NonInvalid*/ boolean oclIsUndefined = (CAUGHT_dataElement == null) || (CAUGHT_dataElement instanceof InvalidValueException); + final /*@Thrown*/ Boolean or; + if (oclIsUndefined) { + or = ValueUtil.TRUE_VALUE; + } + else { + /*@Caught*/ Object CAUGHT_oclIsKindOf_1; + try { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_DataInstance_0 = idResolver.getClass(tdlTables.CLSSid_DataInstance, null); + final /*@Thrown*/ DataElementUse oclAsType_0 = (DataElementUse)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_DataElementUse_0); + final /*@Thrown*/ NamedElement dataElement_0 = oclAsType_0.getDataElement(); + final /*@Thrown*/ boolean oclIsKindOf_1 = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, dataElement_0, TYP_tdl_c_c_DataInstance_0).booleanValue(); + CAUGHT_oclIsKindOf_1 = oclIsKindOf_1; + } + catch (Exception e) { + CAUGHT_oclIsKindOf_1 = ValueUtil.createInvalidValue(e); + } + if (CAUGHT_oclIsKindOf_1 == ValueUtil.TRUE_VALUE) { + or = ValueUtil.TRUE_VALUE; + } + else { + if (CAUGHT_oclIsKindOf_1 instanceof InvalidValueException) { + throw (InvalidValueException)CAUGHT_oclIsKindOf_1; + } + or = ValueUtil.FALSE_VALUE; + } + } + CAUGHT_or = or; + } + catch (Exception e) { + CAUGHT_or = ValueUtil.createInvalidValue(e); + } + final /*@Thrown*/ Boolean or_0; + if (CAUGHT_or == ValueUtil.TRUE_VALUE) { + or_0 = ValueUtil.TRUE_VALUE; + } + else { + /*@Caught*/ Object CAUGHT_oclIsKindOf_2; + try { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_DataType_0 = idResolver.getClass(tdlTables.CLSSid_DataType, null); + final /*@Thrown*/ DataElementUse oclAsType_1 = (DataElementUse)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_DataElementUse_0); + final /*@Thrown*/ NamedElement dataElement_1 = oclAsType_1.getDataElement(); + final /*@Thrown*/ boolean oclIsKindOf_2 = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, dataElement_1, TYP_tdl_c_c_DataType_0).booleanValue(); + CAUGHT_oclIsKindOf_2 = oclIsKindOf_2; + } + catch (Exception e) { + CAUGHT_oclIsKindOf_2 = ValueUtil.createInvalidValue(e); + } + if (CAUGHT_oclIsKindOf_2 == ValueUtil.TRUE_VALUE) { + or_0 = ValueUtil.TRUE_VALUE; + } + else { + if (CAUGHT_or instanceof InvalidValueException) { + throw (InvalidValueException)CAUGHT_or; + } + if (CAUGHT_oclIsKindOf_2 instanceof InvalidValueException) { + throw (InvalidValueException)CAUGHT_oclIsKindOf_2; + } + if (CAUGHT_or == null) { + or_0 = null; + } + else { + or_0 = ValueUtil.FALSE_VALUE; + } + } + } + CAUGHT_or_0 = or_0; + } + catch (Exception e) { + CAUGHT_or_0 = ValueUtil.createInvalidValue(e); + } + if (CAUGHT_or_0 == ValueUtil.FALSE_VALUE) { + and = ValueUtil.FALSE_VALUE; + } + else { + if (CAUGHT_or_0 instanceof InvalidValueException) { + throw (InvalidValueException)CAUGHT_or_0; + } + if (CAUGHT_or_0 == null) { + and = null; + } + else { + and = ValueUtil.TRUE_VALUE; + } + } + } + CAUGHT_and = and; + } + catch (Exception e) { + CAUGHT_and = ValueUtil.createInvalidValue(e); + } + if (CAUGHT_and == ValueUtil.TRUE_VALUE) { + or_1 = ValueUtil.TRUE_VALUE; + } + else { + if (CAUGHT_and instanceof InvalidValueException) { + throw (InvalidValueException)CAUGHT_and; + } + if (CAUGHT_and == null) { + or_1 = null; + } + else { + or_1 = ValueUtil.FALSE_VALUE; + } + } + } + CAUGHT_or_1 = or_1; + } + catch (Exception e) { + CAUGHT_or_1 = ValueUtil.createInvalidValue(e); + } + final /*@Thrown*/ Boolean and_0; + if (CAUGHT_or_1 == ValueUtil.FALSE_VALUE) { + and_0 = ValueUtil.FALSE_VALUE; + } + else { + final /*@NonInvalid*/ List argument = this.getArgument(); + final /*@NonInvalid*/ OrderedSetValue BOXED_argument = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_ParameterBinding, argument); + /*@Thrown*/ Object accumulator = ValueUtil.TRUE_VALUE; + Iterator ITERATOR_a = BOXED_argument.iterator(); + /*@NonInvalid*/ Boolean forAll; + while (true) { + if (!ITERATOR_a.hasNext()) { + if (accumulator == ValueUtil.TRUE_VALUE) { + forAll = ValueUtil.TRUE_VALUE; + } + else { + throw (InvalidValueException)accumulator; + } + break; + } + /*@NonInvalid*/ ParameterBinding a = (ParameterBinding)ITERATOR_a.next(); + /** + * a.dataUse.isEffectivelyStatic() + */ + final /*@NonInvalid*/ DataUse dataUse = a.getDataUse(); + final /*@NonInvalid*/ boolean isEffectivelyStatic = dataUse.isEffectivelyStatic(); + // + if (!isEffectivelyStatic) { // Normal unsuccessful body evaluation result + forAll = ValueUtil.FALSE_VALUE; + break; // Stop immediately + } + else if (isEffectivelyStatic) { // Normal successful body evaluation result + ; // Carry on + } + else { // Impossible badly typed result + accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "forAll"); + } + } + if (forAll == ValueUtil.FALSE_VALUE) { + and_0 = ValueUtil.FALSE_VALUE; + } + else { + if (CAUGHT_or_1 instanceof InvalidValueException) { + throw (InvalidValueException)CAUGHT_or_1; + } + if ((CAUGHT_or_1 == null) || (forAll == null)) { + and_0 = null; + } + else { + and_0 = ValueUtil.TRUE_VALUE; + } + } } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + if (and_0 == null) { + throw new InvalidValueException("Null body for \'tdl::DataUse::isEffectivelyStatic() : Boolean[1]\'"); } + return and_0; } /** @@ -175,8 +369,7 @@ public abstract class DataUseImpl extends ElementImpl implements DataUse @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_USE__ARGUMENT: return ((InternalEList)getArgument()).basicRemove(otherEnd, msgs); case tdlPackage.DATA_USE__REDUCTION: @@ -193,8 +386,7 @@ public abstract class DataUseImpl extends ElementImpl implements DataUse @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_USE__ARGUMENT: return getArgument(); case tdlPackage.DATA_USE__REDUCTION: @@ -212,8 +404,7 @@ public abstract class DataUseImpl extends ElementImpl implements DataUse @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_USE__ARGUMENT: getArgument().clear(); getArgument().addAll((Collection)newValue); @@ -234,8 +425,7 @@ public abstract class DataUseImpl extends ElementImpl implements DataUse @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_USE__ARGUMENT: getArgument().clear(); return; @@ -254,8 +444,7 @@ public abstract class DataUseImpl extends ElementImpl implements DataUse @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.DATA_USE__ARGUMENT: return argument != null && !argument.isEmpty(); case tdlPackage.DATA_USE__REDUCTION: @@ -272,8 +461,7 @@ public abstract class DataUseImpl extends ElementImpl implements DataUse @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.DATA_USE___RESOLVE_DATA_TYPE: return resolveDataType(); case tdlPackage.DATA_USE___IS_EFFECTIVELY_STATIC: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ElementImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ElementImpl.java index 7fc7e946..8722d63f 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ElementImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ElementImpl.java @@ -10,10 +10,7 @@ import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; @@ -22,11 +19,20 @@ import org.eclipse.emf.ecore.impl.EObjectImpl; import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.library.classifier.ClassifierOclContainerOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsTypeOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsKindOfOperation; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; import org.etsi.mts.tdl.Annotation; import org.etsi.mts.tdl.Comment; import org.etsi.mts.tdl.Element; import org.etsi.mts.tdl.TestDescription; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -114,8 +120,7 @@ public abstract class ElementImpl extends EObjectImpl implements Element @Override public EList getComment() { - if (comment == null) - { + if (comment == null) { comment = new EObjectContainmentWithInverseEList(Comment.class, this, tdlPackage.ELEMENT__COMMENT, tdlPackage.COMMENT__COMMENTED_ELEMENT); } return comment; @@ -129,8 +134,7 @@ public abstract class ElementImpl extends EObjectImpl implements Element @Override public EList getAnnotation() { - if (annotation == null) - { + if (annotation == null) { annotation = new EObjectContainmentWithInverseEList(Annotation.class, this, tdlPackage.ELEMENT__ANNOTATION, tdlPackage.ANNOTATION__ANNOTATED_ELEMENT); } return annotation; @@ -161,16 +165,6 @@ public abstract class ElementImpl extends EObjectImpl implements Element eNotify(new ENotificationImpl(this, Notification.SET, tdlPackage.ELEMENT__NAME, oldName, name)); } - /** - * The cached invocation delegate for the '{@link #container() Container}' operation. - * - * - * @see #container() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate CONTAINER__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.ELEMENT___CONTAINER).getInvocationDelegate(); - /** * * @@ -179,26 +173,44 @@ public abstract class ElementImpl extends EObjectImpl implements Element @Override public Element container() { - try - { - return (Element)CONTAINER__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if not self.oclContainer().oclIsUndefined() + * then self.oclContainer().oclAsType(Element) + * else null + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ Object oclContainer_0 = ClassifierOclContainerOperation.INSTANCE.evaluate(executor, this); + final /*@NonInvalid*/ boolean oclIsUndefined = oclContainer_0 == null; + final /*@NonInvalid*/ Boolean not; + if (!oclIsUndefined) { + not = ValueUtil.TRUE_VALUE; + } + else { + if (oclIsUndefined) { + not = ValueUtil.FALSE_VALUE; + } + else { + not = null; + } } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + if (not == null) { + throw new InvalidValueException("Null if condition"); } + /*@Thrown*/ Element local_0; + if (not) { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_Element_0 = idResolver.getClass(tdlTables.CLSSid_Element, null); + final /*@Thrown*/ Element oclAsType = (Element)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, oclContainer_0, TYP_tdl_c_c_Element_0); + local_0 = oclAsType; + } + else { + local_0 = null; + } + return local_0; } - /** - * The cached invocation delegate for the '{@link #getParentTestDescription() Get Parent Test Description}' operation. - * - * - * @see #getParentTestDescription() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate GET_PARENT_TEST_DESCRIPTION__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.ELEMENT___GET_PARENT_TEST_DESCRIPTION).getInvocationDelegate(); - /** * * @@ -207,14 +219,41 @@ public abstract class ElementImpl extends EObjectImpl implements Element @Override public TestDescription getParentTestDescription() { - try - { - return (TestDescription)GET_PARENT_TEST_DESCRIPTION__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if self.oclContainer().oclIsUndefined() + * then null + * else + * if self.container().oclIsKindOf(TestDescription) + * then self.container().oclAsType(TestDescription) + * else self.container().getParentTestDescription() + * endif + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ Object oclContainer = ClassifierOclContainerOperation.INSTANCE.evaluate(executor, this); + final /*@NonInvalid*/ boolean oclIsUndefined = oclContainer == null; + /*@Thrown*/ TestDescription local_1; + if (oclIsUndefined) { + local_1 = null; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_TestDescription_1 = idResolver.getClass(tdlTables.CLSSid_TestDescription, null); + final /*@NonInvalid*/ Element container_0 = this.container(); + final /*@NonInvalid*/ boolean oclIsKindOf = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, container_0, TYP_tdl_c_c_TestDescription_1).booleanValue(); + /*@Thrown*/ TestDescription local_0; + if (oclIsKindOf) { + final /*@Thrown*/ TestDescription oclAsType = (TestDescription)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container_0, TYP_tdl_c_c_TestDescription_1); + local_0 = oclAsType; + } + else { + final /*@NonInvalid*/ TestDescription getParentTestDescription = container_0.getParentTestDescription(); + local_0 = getParentTestDescription; + } + local_1 = local_0; } + return local_1; } /** @@ -226,8 +265,7 @@ public abstract class ElementImpl extends EObjectImpl implements Element @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ELEMENT__COMMENT: return ((InternalEList)(InternalEList)getComment()).basicAdd(otherEnd, msgs); case tdlPackage.ELEMENT__ANNOTATION: @@ -244,8 +282,7 @@ public abstract class ElementImpl extends EObjectImpl implements Element @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ELEMENT__COMMENT: return ((InternalEList)getComment()).basicRemove(otherEnd, msgs); case tdlPackage.ELEMENT__ANNOTATION: @@ -262,8 +299,7 @@ public abstract class ElementImpl extends EObjectImpl implements Element @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ELEMENT__COMMENT: return getComment(); case tdlPackage.ELEMENT__ANNOTATION: @@ -283,8 +319,7 @@ public abstract class ElementImpl extends EObjectImpl implements Element @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ELEMENT__COMMENT: getComment().clear(); getComment().addAll((Collection)newValue); @@ -308,8 +343,7 @@ public abstract class ElementImpl extends EObjectImpl implements Element @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ELEMENT__COMMENT: getComment().clear(); return; @@ -331,8 +365,7 @@ public abstract class ElementImpl extends EObjectImpl implements Element @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ELEMENT__COMMENT: return comment != null && !comment.isEmpty(); case tdlPackage.ELEMENT__ANNOTATION: @@ -351,8 +384,7 @@ public abstract class ElementImpl extends EObjectImpl implements Element @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.ELEMENT___CONTAINER: return container(); case tdlPackage.ELEMENT___GET_PARENT_TEST_DESCRIPTION: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ElementImportImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ElementImportImpl.java index a93be675..5e0be94e 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ElementImportImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ElementImportImpl.java @@ -84,8 +84,7 @@ public class ElementImportImpl extends ElementImpl implements ElementImport @Override public EList getImportedElement() { - if (importedElement == null) - { + if (importedElement == null) { importedElement = new EObjectResolvingEList(PackageableElement.class, this, tdlPackage.ELEMENT_IMPORT__IMPORTED_ELEMENT); } return importedElement; @@ -99,12 +98,10 @@ public class ElementImportImpl extends ElementImpl implements ElementImport @Override public org.etsi.mts.tdl.Package getImportedPackage() { - if (importedPackage != null && importedPackage.eIsProxy()) - { + if (importedPackage != null && importedPackage.eIsProxy()) { InternalEObject oldImportedPackage = (InternalEObject)importedPackage; importedPackage = (org.etsi.mts.tdl.Package)eResolveProxy(oldImportedPackage); - if (importedPackage != oldImportedPackage) - { + if (importedPackage != oldImportedPackage) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.ELEMENT_IMPORT__IMPORTED_PACKAGE, oldImportedPackage, importedPackage)); } @@ -144,8 +141,7 @@ public class ElementImportImpl extends ElementImpl implements ElementImport @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ELEMENT_IMPORT__IMPORTED_ELEMENT: return getImportedElement(); case tdlPackage.ELEMENT_IMPORT__IMPORTED_PACKAGE: @@ -164,8 +160,7 @@ public class ElementImportImpl extends ElementImpl implements ElementImport @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ELEMENT_IMPORT__IMPORTED_ELEMENT: getImportedElement().clear(); getImportedElement().addAll((Collection)newValue); @@ -185,8 +180,7 @@ public class ElementImportImpl extends ElementImpl implements ElementImport @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ELEMENT_IMPORT__IMPORTED_ELEMENT: getImportedElement().clear(); return; @@ -205,8 +199,7 @@ public class ElementImportImpl extends ElementImpl implements ElementImport @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ELEMENT_IMPORT__IMPORTED_ELEMENT: return importedElement != null && !importedElement.isEmpty(); case tdlPackage.ELEMENT_IMPORT__IMPORTED_PACKAGE: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/EnumDataTypeImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/EnumDataTypeImpl.java index 8ec7295a..b8731c41 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/EnumDataTypeImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/EnumDataTypeImpl.java @@ -72,8 +72,7 @@ public class EnumDataTypeImpl extends SimpleDataTypeImpl implements EnumDataType @Override public EList getValue() { - if (value == null) - { + if (value == null) { value = new EObjectContainmentEList(SimpleDataInstance.class, this, tdlPackage.ENUM_DATA_TYPE__VALUE); } return value; @@ -87,8 +86,7 @@ public class EnumDataTypeImpl extends SimpleDataTypeImpl implements EnumDataType @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ENUM_DATA_TYPE__VALUE: return ((InternalEList)getValue()).basicRemove(otherEnd, msgs); } @@ -103,8 +101,7 @@ public class EnumDataTypeImpl extends SimpleDataTypeImpl implements EnumDataType @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ENUM_DATA_TYPE__VALUE: return getValue(); } @@ -120,8 +117,7 @@ public class EnumDataTypeImpl extends SimpleDataTypeImpl implements EnumDataType @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ENUM_DATA_TYPE__VALUE: getValue().clear(); getValue().addAll((Collection)newValue); @@ -138,8 +134,7 @@ public class EnumDataTypeImpl extends SimpleDataTypeImpl implements EnumDataType @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ENUM_DATA_TYPE__VALUE: getValue().clear(); return; @@ -155,8 +150,7 @@ public class EnumDataTypeImpl extends SimpleDataTypeImpl implements EnumDataType @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.ENUM_DATA_TYPE__VALUE: return value != null && !value.isEmpty(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ExceptionalBehaviourImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ExceptionalBehaviourImpl.java index c4c703c2..c2705794 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ExceptionalBehaviourImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ExceptionalBehaviourImpl.java @@ -4,23 +4,36 @@ package org.etsi.mts.tdl.impl; import java.lang.reflect.InvocationTargetException; +import java.util.Iterator; +import java.util.List; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.ids.IdResolver.IdResolverExtension; +import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsSetOperation; +import org.eclipse.ocl.pivot.messages.PivotMessages; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SetValue; import org.etsi.mts.tdl.Behaviour; import org.etsi.mts.tdl.Block; import org.etsi.mts.tdl.ComponentInstance; import org.etsi.mts.tdl.ExceptionalBehaviour; +import org.etsi.mts.tdl.TestConfiguration; +import org.etsi.mts.tdl.TestDescription; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -99,8 +112,7 @@ public abstract class ExceptionalBehaviourImpl extends BehaviourImpl implements { Block oldBlock = block; block = newBlock; - if (eNotificationRequired()) - { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, tdlPackage.EXCEPTIONAL_BEHAVIOUR__BLOCK, oldBlock, newBlock); if (msgs == null) msgs = notification; else msgs.add(notification); } @@ -115,8 +127,7 @@ public abstract class ExceptionalBehaviourImpl extends BehaviourImpl implements @Override public void setBlock(Block newBlock) { - if (newBlock != block) - { + if (newBlock != block) { NotificationChain msgs = null; if (block != null) msgs = ((InternalEObject)block).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - tdlPackage.EXCEPTIONAL_BEHAVIOUR__BLOCK, null, msgs); @@ -137,12 +148,10 @@ public abstract class ExceptionalBehaviourImpl extends BehaviourImpl implements @Override public ComponentInstance getGuardedComponent() { - if (guardedComponent != null && guardedComponent.eIsProxy()) - { + if (guardedComponent != null && guardedComponent.eIsProxy()) { InternalEObject oldGuardedComponent = (InternalEObject)guardedComponent; guardedComponent = (ComponentInstance)eResolveProxy(oldGuardedComponent); - if (guardedComponent != oldGuardedComponent) - { + if (guardedComponent != oldGuardedComponent) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.EXCEPTIONAL_BEHAVIOUR__GUARDED_COMPONENT, oldGuardedComponent, guardedComponent)); } @@ -174,16 +183,6 @@ public abstract class ExceptionalBehaviourImpl extends BehaviourImpl implements eNotify(new ENotificationImpl(this, Notification.SET, tdlPackage.EXCEPTIONAL_BEHAVIOUR__GUARDED_COMPONENT, oldGuardedComponent, guardedComponent)); } - /** - * The cached invocation delegate for the '{@link #getParticipatingComponents() Get Participating Components}' operation. - * - * - * @see #getParticipatingComponents() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.EXCEPTIONAL_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS).getInvocationDelegate(); - /** * * @@ -193,14 +192,71 @@ public abstract class ExceptionalBehaviourImpl extends BehaviourImpl implements @Override public EList getParticipatingComponents() { - try - { - return (EList)GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if + * self.getParentTestDescription() + * ->exists(td | td.isLocallyOrdered) + * then self.block.getParticipatingComponents()->asOrderedSet() + * else + * self.getParentTestDescription() + * .testConfiguration.componentInstance->asOrderedSet() + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ TestDescription getParentTestDescription = this.getParentTestDescription(); + final /*@NonInvalid*/ SetValue oclAsSet = OclAnyOclAsSetOperation.INSTANCE.evaluate(executor, tdlTables.SET_CLSSid_TestDescription, getParentTestDescription); + /*@Thrown*/ Object accumulator = ValueUtil.FALSE_VALUE; + Iterator ITERATOR_td = oclAsSet.iterator(); + /*@NonInvalid*/ Boolean exists; + while (true) { + if (!ITERATOR_td.hasNext()) { + if (accumulator == ValueUtil.FALSE_VALUE) { + exists = ValueUtil.FALSE_VALUE; + } + else { + throw (InvalidValueException)accumulator; + } + break; + } + /*@NonInvalid*/ TestDescription td = (TestDescription)ITERATOR_td.next(); + /** + * td.isLocallyOrdered + */ + final /*@NonInvalid*/ boolean isLocallyOrdered = td.isIsLocallyOrdered(); + // + if (isLocallyOrdered) { // Normal successful body evaluation result + exists = ValueUtil.TRUE_VALUE; + break; // Stop immediately + } + else if (!isLocallyOrdered) { // Normal unsuccessful body evaluation result + ; // Carry on + } + else { // Impossible badly typed result + accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "exists"); + } + } + if (exists == null) { + throw new InvalidValueException("Null if condition"); + } + /*@NonInvalid*/ OrderedSetValue local_0; + if (exists) { + final /*@NonInvalid*/ Block block = this.getBlock(); + final /*@NonInvalid*/ List getParticipatingComponents = block.getParticipatingComponents(); + final /*@NonInvalid*/ OrderedSetValue BOXED_getParticipatingComponents = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_ComponentInstance, getParticipatingComponents); + final /*@NonInvalid*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(BOXED_getParticipatingComponents); + local_0 = asOrderedSet; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + final /*@NonInvalid*/ TestConfiguration testConfiguration = getParentTestDescription.getTestConfiguration(); + final /*@NonInvalid*/ List componentInstance = testConfiguration.getComponentInstance(); + final /*@NonInvalid*/ SetValue BOXED_componentInstance = idResolver.createSetOfAll(tdlTables.SET_CLSSid_ComponentInstance, componentInstance); + final /*@NonInvalid*/ OrderedSetValue asOrderedSet_0 = CollectionAsOrderedSetOperation.INSTANCE.evaluate(BOXED_componentInstance); + local_0 = asOrderedSet_0; } + final /*@NonInvalid*/ List ECORE_local_0 = ((IdResolverExtension)idResolver).ecoreValueOfAll(ComponentInstance.class, local_0); + return (EList)ECORE_local_0; } /** @@ -211,8 +267,7 @@ public abstract class ExceptionalBehaviourImpl extends BehaviourImpl implements @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.EXCEPTIONAL_BEHAVIOUR__BLOCK: return basicSetBlock(null, msgs); } @@ -227,8 +282,7 @@ public abstract class ExceptionalBehaviourImpl extends BehaviourImpl implements @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.EXCEPTIONAL_BEHAVIOUR__BLOCK: return getBlock(); case tdlPackage.EXCEPTIONAL_BEHAVIOUR__GUARDED_COMPONENT: @@ -246,8 +300,7 @@ public abstract class ExceptionalBehaviourImpl extends BehaviourImpl implements @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.EXCEPTIONAL_BEHAVIOUR__BLOCK: setBlock((Block)newValue); return; @@ -266,8 +319,7 @@ public abstract class ExceptionalBehaviourImpl extends BehaviourImpl implements @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.EXCEPTIONAL_BEHAVIOUR__BLOCK: setBlock((Block)null); return; @@ -286,8 +338,7 @@ public abstract class ExceptionalBehaviourImpl extends BehaviourImpl implements @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.EXCEPTIONAL_BEHAVIOUR__BLOCK: return block != null; case tdlPackage.EXCEPTIONAL_BEHAVIOUR__GUARDED_COMPONENT: @@ -304,10 +355,8 @@ public abstract class ExceptionalBehaviourImpl extends BehaviourImpl implements @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == Behaviour.class) - { - switch (baseOperationID) - { + if (baseClass == Behaviour.class) { + switch (baseOperationID) { case tdlPackage.BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return tdlPackage.EXCEPTIONAL_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -323,8 +372,7 @@ public abstract class ExceptionalBehaviourImpl extends BehaviourImpl implements @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.EXCEPTIONAL_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return getParticipatingComponents(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ExtensionImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ExtensionImpl.java index 7e957109..8be8f0ea 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ExtensionImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ExtensionImpl.java @@ -4,21 +4,41 @@ package org.etsi.mts.tdl.impl; import java.lang.reflect.InvocationTargetException; +import java.util.List; import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.common.util.BasicEList; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.ocl.pivot.StandardLibrary; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.ids.IdResolver.IdResolverExtension; +import org.eclipse.ocl.pivot.ids.TypeId; +import org.eclipse.ocl.pivot.internal.library.executor.ExecutorSingleIterationManager; +import org.eclipse.ocl.pivot.library.AbstractBinaryOperation; +import org.eclipse.ocl.pivot.library.LibraryIteration.LibraryIterationExtension; +import org.eclipse.ocl.pivot.library.collection.CollectionIncludesOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsSetOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsTypeOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsKindOfOperation; +import org.eclipse.ocl.pivot.oclstdlib.OCLstdlibTables; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SetValue; +import org.etsi.mts.tdl.AnnotationType; +import org.etsi.mts.tdl.ComponentType; import org.etsi.mts.tdl.Extension; +import org.etsi.mts.tdl.GateType; import org.etsi.mts.tdl.PackageableElement; +import org.etsi.mts.tdl.SimpleDataType; +import org.etsi.mts.tdl.StructuredDataType; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -74,12 +94,10 @@ public class ExtensionImpl extends ElementImpl implements Extension @Override public PackageableElement getExtending() { - if (extending != null && extending.eIsProxy()) - { + if (extending != null && extending.eIsProxy()) { InternalEObject oldExtending = (InternalEObject)extending; extending = (PackageableElement)eResolveProxy(oldExtending); - if (extending != oldExtending) - { + if (extending != oldExtending) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.EXTENSION__EXTENDING, oldExtending, extending)); } @@ -111,16 +129,6 @@ public class ExtensionImpl extends ElementImpl implements Extension eNotify(new ENotificationImpl(this, Notification.SET, tdlPackage.EXTENSION__EXTENDING, oldExtending, extending)); } - /** - * The cached invocation delegate for the '{@link #transitiveExtending() Transitive Extending}' operation. - * - * - * @see #transitiveExtending() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate TRANSITIVE_EXTENDING__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.EXTENSION___TRANSITIVE_EXTENDING).getInvocationDelegate(); - /** * * @@ -130,42 +138,170 @@ public class ExtensionImpl extends ElementImpl implements Extension @Override public EList transitiveExtending() { - try - { - return (EList)TRANSITIVE_EXTENDING__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if self.extending.oclIsKindOf(AnnotationType) + * then + * OrderedSet{self.extending.oclAsType(AnnotationType).extension + * } + * else + * if self.extending.oclIsKindOf(ComponentType) + * then + * OrderedSet{self.extending.oclAsType(ComponentType).extension + * } + * else + * if self.extending.oclIsKindOf(GateType) + * then + * OrderedSet{self.extending.oclAsType(GateType).extension + * } + * else + * if self.extending.oclIsKindOf(StructuredDataType) + * then + * self.extending.oclAsType(StructuredDataType).extension + * else + * if self.extending.oclIsKindOf(SimpleDataType) + * then + * OrderedSet{ + * self.extending.oclAsType(SimpleDataType).extension + * } + * else OrderedSet{} + * endif + * endif + * endif + * endif + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_AnnotationType_0 = idResolver.getClass(tdlTables.CLSSid_AnnotationType, null); + final /*@NonInvalid*/ PackageableElement extending = this.getExtending(); + final /*@NonInvalid*/ boolean oclIsKindOf = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, extending, TYP_tdl_c_c_AnnotationType_0).booleanValue(); + /*@Thrown*/ OrderedSetValue local_4; + if (oclIsKindOf) { + final /*@Thrown*/ AnnotationType oclAsType = (AnnotationType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, extending, TYP_tdl_c_c_AnnotationType_0); + final /*@Thrown*/ Extension extension = oclAsType.getExtension(); + final /*@Thrown*/ OrderedSetValue OrderedSet = ValueUtil.createOrderedSetOfEach(tdlTables.ORD_CLSSid_Extension, extension); + local_4 = OrderedSet; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_ComponentType_0 = idResolver.getClass(tdlTables.CLSSid_ComponentType, null); + final /*@NonInvalid*/ boolean oclIsKindOf_0 = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, extending, TYP_tdl_c_c_ComponentType_0).booleanValue(); + /*@Thrown*/ OrderedSetValue local_3; + if (oclIsKindOf_0) { + final /*@Thrown*/ ComponentType oclAsType_0 = (ComponentType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, extending, TYP_tdl_c_c_ComponentType_0); + final /*@Thrown*/ Extension extension_0 = oclAsType_0.getExtension(); + final /*@Thrown*/ OrderedSetValue OrderedSet_0 = ValueUtil.createOrderedSetOfEach(tdlTables.ORD_CLSSid_Extension, extension_0); + local_3 = OrderedSet_0; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_GateType_0 = idResolver.getClass(tdlTables.CLSSid_GateType, null); + final /*@NonInvalid*/ boolean oclIsKindOf_1 = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, extending, TYP_tdl_c_c_GateType_0).booleanValue(); + /*@Thrown*/ OrderedSetValue local_2; + if (oclIsKindOf_1) { + final /*@Thrown*/ GateType oclAsType_1 = (GateType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, extending, TYP_tdl_c_c_GateType_0); + final /*@Thrown*/ Extension extension_1 = oclAsType_1.getExtension(); + final /*@Thrown*/ OrderedSetValue OrderedSet_1 = ValueUtil.createOrderedSetOfEach(tdlTables.ORD_CLSSid_Extension, extension_1); + local_2 = OrderedSet_1; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_StructuredDataType_0 = idResolver.getClass(tdlTables.CLSSid_StructuredDataType, null); + final /*@NonInvalid*/ boolean oclIsKindOf_2 = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, extending, TYP_tdl_c_c_StructuredDataType_0).booleanValue(); + /*@Thrown*/ OrderedSetValue local_1; + if (oclIsKindOf_2) { + final /*@Thrown*/ StructuredDataType oclAsType_2 = (StructuredDataType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, extending, TYP_tdl_c_c_StructuredDataType_0); + final /*@Thrown*/ List extension_2 = oclAsType_2.getExtension(); + final /*@Thrown*/ OrderedSetValue BOXED_extension_2 = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_Extension, extension_2); + local_1 = BOXED_extension_2; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_SimpleDataType_0 = idResolver.getClass(tdlTables.CLSSid_SimpleDataType, null); + final /*@NonInvalid*/ boolean oclIsKindOf_3 = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, extending, TYP_tdl_c_c_SimpleDataType_0).booleanValue(); + /*@Thrown*/ OrderedSetValue local_0; + if (oclIsKindOf_3) { + final /*@Thrown*/ SimpleDataType oclAsType_3 = (SimpleDataType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, extending, TYP_tdl_c_c_SimpleDataType_0); + final /*@Thrown*/ Extension extension_3 = oclAsType_3.getExtension(); + final /*@Thrown*/ OrderedSetValue OrderedSet_2 = ValueUtil.createOrderedSetOfEach(tdlTables.ORD_CLSSid_Extension, extension_3); + local_0 = OrderedSet_2; + } + else { + local_0 = tdlTables.OrderedSet; + } + local_1 = local_0; + } + local_2 = local_1; + } + local_3 = local_2; + } + local_4 = local_3; } + final /*@Thrown*/ List ECORE_local_4 = ((IdResolverExtension)idResolver).ecoreValueOfAll(Extension.class, local_4); + return (EList)ECORE_local_4; } - /** - * The cached invocation delegate for the '{@link #isExtending(org.etsi.mts.tdl.PackageableElement) Is Extending}' operation. - * - * - * @see #isExtending(org.etsi.mts.tdl.PackageableElement) - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate IS_EXTENDING_PACKAGEABLE_ELEMENT__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.EXTENSION___IS_EXTENDING__PACKAGEABLEELEMENT).getInvocationDelegate(); - /** * * * @generated */ @Override - public Boolean isExtending(PackageableElement e) + public Boolean isExtending(final PackageableElement e) { - try - { - return (Boolean)IS_EXTENDING_PACKAGEABLE_ELEMENT__EINVOCATION_DELEGATE.dynamicInvoke(this, new BasicEList.UnmodifiableEList(1, new Object[]{e})); + /** + * + * if self.extending = e + * then true + * else + * if self->closure(transitiveExtending())->includes(e) + * then true + * else false + * endif + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ StandardLibrary standardLibrary = idResolver.getStandardLibrary(); + final /*@NonInvalid*/ PackageableElement extending = this.getExtending(); + final /*@NonInvalid*/ boolean eq = extending.equals(e); + /*@NonInvalid*/ boolean local_2; + if (eq) { + local_2 = true; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + final /*@NonInvalid*/ SetValue oclAsSet = OclAnyOclAsSetOperation.INSTANCE.evaluate(executor, tdlTables.SET_CLSSid_Extension, this); + final org.eclipse.ocl.pivot.Class TYPE_closure_0 = executor.getStaticTypeOfValue(null, oclAsSet); + final LibraryIterationExtension IMPL_closure_0 = (LibraryIterationExtension)TYPE_closure_0.lookupImplementation(standardLibrary, OCLstdlibTables.Operations._Set__closure); + final /*@NonNull*/ Object ACC_closure_0 = IMPL_closure_0.createAccumulatorValue(executor, tdlTables.SET_CLSSid_Extension, tdlTables.ORD_CLSSid_Extension); + /** + * Implementation of the iterator body. + */ + final AbstractBinaryOperation BODY_closure_0 = new AbstractBinaryOperation() { + /** + * transitiveExtending() + */ + @Override + public /*@Nullable*/ Object evaluate(final Executor executor, final TypeId typeId, final /*@Nullable*/ Object oclAsSet, final /*@NonInvalid*/ Object _1) { + final /*@NonInvalid*/ Extension local_0 = (Extension)_1; + if (local_0 == null) { + throw new InvalidValueException("Null source for \'tdl::Extension::transitiveExtending() : OrderedSet(tdl::Extension[*|?])\'"); + } + final /*@Thrown*/ List transitiveExtending = local_0.transitiveExtending(); + final /*@Thrown*/ OrderedSetValue BOXED_transitiveExtending = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_Extension, transitiveExtending); + return BOXED_transitiveExtending; + } + }; + final ExecutorSingleIterationManager MGR_closure_0 = new ExecutorSingleIterationManager(executor, tdlTables.SET_CLSSid_Extension, BODY_closure_0, oclAsSet, ACC_closure_0); + final /*@Thrown*/ SetValue closure = (SetValue)IMPL_closure_0.evaluateIteration(MGR_closure_0); + final /*@Thrown*/ boolean includes = CollectionIncludesOperation.INSTANCE.evaluate(closure, e).booleanValue(); + /*@NonInvalid*/ boolean local_1; + if (includes) { + local_1 = true; + } + else { + local_1 = false; + } + local_2 = local_1; } + return local_2; } /** @@ -176,8 +312,7 @@ public class ExtensionImpl extends ElementImpl implements Extension @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.EXTENSION__EXTENDING: if (resolve) return getExtending(); return basicGetExtending(); @@ -193,8 +328,7 @@ public class ExtensionImpl extends ElementImpl implements Extension @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.EXTENSION__EXTENDING: setExtending((PackageableElement)newValue); return; @@ -210,8 +344,7 @@ public class ExtensionImpl extends ElementImpl implements Extension @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.EXTENSION__EXTENDING: setExtending((PackageableElement)null); return; @@ -227,8 +360,7 @@ public class ExtensionImpl extends ElementImpl implements Extension @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.EXTENSION__EXTENDING: return extending != null; } @@ -243,8 +375,7 @@ public class ExtensionImpl extends ElementImpl implements Extension @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.EXTENSION___TRANSITIVE_EXTENDING: return transitiveExtending(); case tdlPackage.EXTENSION___IS_EXTENDING__PACKAGEABLEELEMENT: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/FormalParameterUseImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/FormalParameterUseImpl.java index 1b5d0a5a..5c2e8da7 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/FormalParameterUseImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/FormalParameterUseImpl.java @@ -7,10 +7,7 @@ import java.lang.reflect.InvocationTargetException; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; @@ -75,12 +72,10 @@ public class FormalParameterUseImpl extends DynamicDataUseImpl implements Formal @Override public FormalParameter getParameter() { - if (parameter != null && parameter.eIsProxy()) - { + if (parameter != null && parameter.eIsProxy()) { InternalEObject oldParameter = (InternalEObject)parameter; parameter = (FormalParameter)eResolveProxy(oldParameter); - if (parameter != oldParameter) - { + if (parameter != oldParameter) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.FORMAL_PARAMETER_USE__PARAMETER, oldParameter, parameter)); } @@ -112,16 +107,6 @@ public class FormalParameterUseImpl extends DynamicDataUseImpl implements Formal eNotify(new ENotificationImpl(this, Notification.SET, tdlPackage.FORMAL_PARAMETER_USE__PARAMETER, oldParameter, parameter)); } - /** - * The cached invocation delegate for the '{@link #resolveDataType() Resolve Data Type}' operation. - * - * - * @see #resolveDataType() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate RESOLVE_DATA_TYPE__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.FORMAL_PARAMETER_USE___RESOLVE_DATA_TYPE).getInvocationDelegate(); - /** * * @@ -130,14 +115,12 @@ public class FormalParameterUseImpl extends DynamicDataUseImpl implements Formal @Override public DataType resolveDataType() { - try - { - return (DataType)RESOLVE_DATA_TYPE__EINVOCATION_DELEGATE.dynamicInvoke(this, null); - } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); - } + /** + * self.parameter.dataType + */ + final /*@NonInvalid*/ FormalParameter parameter = this.getParameter(); + final /*@NonInvalid*/ DataType dataType = parameter.getDataType(); + return dataType; } /** @@ -148,8 +131,7 @@ public class FormalParameterUseImpl extends DynamicDataUseImpl implements Formal @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.FORMAL_PARAMETER_USE__PARAMETER: if (resolve) return getParameter(); return basicGetParameter(); @@ -165,8 +147,7 @@ public class FormalParameterUseImpl extends DynamicDataUseImpl implements Formal @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.FORMAL_PARAMETER_USE__PARAMETER: setParameter((FormalParameter)newValue); return; @@ -182,8 +163,7 @@ public class FormalParameterUseImpl extends DynamicDataUseImpl implements Formal @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.FORMAL_PARAMETER_USE__PARAMETER: setParameter((FormalParameter)null); return; @@ -199,8 +179,7 @@ public class FormalParameterUseImpl extends DynamicDataUseImpl implements Formal @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.FORMAL_PARAMETER_USE__PARAMETER: return parameter != null; } @@ -215,10 +194,8 @@ public class FormalParameterUseImpl extends DynamicDataUseImpl implements Formal @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == DataUse.class) - { - switch (baseOperationID) - { + if (baseClass == DataUse.class) { + switch (baseOperationID) { case tdlPackage.DATA_USE___RESOLVE_DATA_TYPE: return tdlPackage.FORMAL_PARAMETER_USE___RESOLVE_DATA_TYPE; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -234,8 +211,7 @@ public class FormalParameterUseImpl extends DynamicDataUseImpl implements Formal @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.FORMAL_PARAMETER_USE___RESOLVE_DATA_TYPE: return resolveDataType(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/FunctionCallImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/FunctionCallImpl.java index eae8b11c..f6b2be2e 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/FunctionCallImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/FunctionCallImpl.java @@ -7,10 +7,7 @@ import java.lang.reflect.InvocationTargetException; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; @@ -75,12 +72,10 @@ public class FunctionCallImpl extends DynamicDataUseImpl implements FunctionCall @Override public Function getFunction() { - if (function != null && function.eIsProxy()) - { + if (function != null && function.eIsProxy()) { InternalEObject oldFunction = (InternalEObject)function; function = (Function)eResolveProxy(oldFunction); - if (function != oldFunction) - { + if (function != oldFunction) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.FUNCTION_CALL__FUNCTION, oldFunction, function)); } @@ -112,16 +107,6 @@ public class FunctionCallImpl extends DynamicDataUseImpl implements FunctionCall eNotify(new ENotificationImpl(this, Notification.SET, tdlPackage.FUNCTION_CALL__FUNCTION, oldFunction, function)); } - /** - * The cached invocation delegate for the '{@link #resolveDataType() Resolve Data Type}' operation. - * - * - * @see #resolveDataType() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate RESOLVE_DATA_TYPE__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.FUNCTION_CALL___RESOLVE_DATA_TYPE).getInvocationDelegate(); - /** * * @@ -130,14 +115,12 @@ public class FunctionCallImpl extends DynamicDataUseImpl implements FunctionCall @Override public DataType resolveDataType() { - try - { - return (DataType)RESOLVE_DATA_TYPE__EINVOCATION_DELEGATE.dynamicInvoke(this, null); - } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); - } + /** + * self.function.returnType + */ + final /*@NonInvalid*/ Function function = this.getFunction(); + final /*@NonInvalid*/ DataType returnType = function.getReturnType(); + return returnType; } /** @@ -148,8 +131,7 @@ public class FunctionCallImpl extends DynamicDataUseImpl implements FunctionCall @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.FUNCTION_CALL__FUNCTION: if (resolve) return getFunction(); return basicGetFunction(); @@ -165,8 +147,7 @@ public class FunctionCallImpl extends DynamicDataUseImpl implements FunctionCall @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.FUNCTION_CALL__FUNCTION: setFunction((Function)newValue); return; @@ -182,8 +163,7 @@ public class FunctionCallImpl extends DynamicDataUseImpl implements FunctionCall @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.FUNCTION_CALL__FUNCTION: setFunction((Function)null); return; @@ -199,8 +179,7 @@ public class FunctionCallImpl extends DynamicDataUseImpl implements FunctionCall @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.FUNCTION_CALL__FUNCTION: return function != null; } @@ -215,10 +194,8 @@ public class FunctionCallImpl extends DynamicDataUseImpl implements FunctionCall @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == DataUse.class) - { - switch (baseOperationID) - { + if (baseClass == DataUse.class) { + switch (baseOperationID) { case tdlPackage.DATA_USE___RESOLVE_DATA_TYPE: return tdlPackage.FUNCTION_CALL___RESOLVE_DATA_TYPE; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -234,8 +211,7 @@ public class FunctionCallImpl extends DynamicDataUseImpl implements FunctionCall @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.FUNCTION_CALL___RESOLVE_DATA_TYPE: return resolveDataType(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/FunctionImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/FunctionImpl.java index 1ae3ad34..4f8c01e8 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/FunctionImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/FunctionImpl.java @@ -67,12 +67,10 @@ public class FunctionImpl extends ActionImpl implements Function @Override public DataType getReturnType() { - if (returnType != null && returnType.eIsProxy()) - { + if (returnType != null && returnType.eIsProxy()) { InternalEObject oldReturnType = (InternalEObject)returnType; returnType = (DataType)eResolveProxy(oldReturnType); - if (returnType != oldReturnType) - { + if (returnType != oldReturnType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.FUNCTION__RETURN_TYPE, oldReturnType, returnType)); } @@ -112,8 +110,7 @@ public class FunctionImpl extends ActionImpl implements Function @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.FUNCTION__RETURN_TYPE: if (resolve) return getReturnType(); return basicGetReturnType(); @@ -129,8 +126,7 @@ public class FunctionImpl extends ActionImpl implements Function @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.FUNCTION__RETURN_TYPE: setReturnType((DataType)newValue); return; @@ -146,8 +142,7 @@ public class FunctionImpl extends ActionImpl implements Function @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.FUNCTION__RETURN_TYPE: setReturnType((DataType)null); return; @@ -163,8 +158,7 @@ public class FunctionImpl extends ActionImpl implements Function @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.FUNCTION__RETURN_TYPE: return returnType != null; } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/GateInstanceImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/GateInstanceImpl.java index 62df394f..371fb42c 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/GateInstanceImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/GateInstanceImpl.java @@ -67,12 +67,10 @@ public class GateInstanceImpl extends NamedElementImpl implements GateInstance @Override public GateType getType() { - if (type != null && type.eIsProxy()) - { + if (type != null && type.eIsProxy()) { InternalEObject oldType = (InternalEObject)type; type = (GateType)eResolveProxy(oldType); - if (type != oldType) - { + if (type != oldType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.GATE_INSTANCE__TYPE, oldType, type)); } @@ -112,8 +110,7 @@ public class GateInstanceImpl extends NamedElementImpl implements GateInstance @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.GATE_INSTANCE__TYPE: if (resolve) return getType(); return basicGetType(); @@ -129,8 +126,7 @@ public class GateInstanceImpl extends NamedElementImpl implements GateInstance @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.GATE_INSTANCE__TYPE: setType((GateType)newValue); return; @@ -146,8 +142,7 @@ public class GateInstanceImpl extends NamedElementImpl implements GateInstance @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.GATE_INSTANCE__TYPE: setType((GateType)null); return; @@ -163,8 +158,7 @@ public class GateInstanceImpl extends NamedElementImpl implements GateInstance @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.GATE_INSTANCE__TYPE: return type != null; } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/GateReferenceImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/GateReferenceImpl.java index 9b994ebf..af634d10 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/GateReferenceImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/GateReferenceImpl.java @@ -79,12 +79,10 @@ public class GateReferenceImpl extends ElementImpl implements GateReference @Override public ComponentInstance getComponent() { - if (component != null && component.eIsProxy()) - { + if (component != null && component.eIsProxy()) { InternalEObject oldComponent = (InternalEObject)component; component = (ComponentInstance)eResolveProxy(oldComponent); - if (component != oldComponent) - { + if (component != oldComponent) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.GATE_REFERENCE__COMPONENT, oldComponent, component)); } @@ -124,12 +122,10 @@ public class GateReferenceImpl extends ElementImpl implements GateReference @Override public GateInstance getGate() { - if (gate != null && gate.eIsProxy()) - { + if (gate != null && gate.eIsProxy()) { InternalEObject oldGate = (InternalEObject)gate; gate = (GateInstance)eResolveProxy(oldGate); - if (gate != oldGate) - { + if (gate != oldGate) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.GATE_REFERENCE__GATE, oldGate, gate)); } @@ -169,8 +165,7 @@ public class GateReferenceImpl extends ElementImpl implements GateReference @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.GATE_REFERENCE__COMPONENT: if (resolve) return getComponent(); return basicGetComponent(); @@ -189,8 +184,7 @@ public class GateReferenceImpl extends ElementImpl implements GateReference @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.GATE_REFERENCE__COMPONENT: setComponent((ComponentInstance)newValue); return; @@ -209,8 +203,7 @@ public class GateReferenceImpl extends ElementImpl implements GateReference @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.GATE_REFERENCE__COMPONENT: setComponent((ComponentInstance)null); return; @@ -229,8 +222,7 @@ public class GateReferenceImpl extends ElementImpl implements GateReference @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.GATE_REFERENCE__COMPONENT: return component != null; case tdlPackage.GATE_REFERENCE__GATE: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/GateTypeImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/GateTypeImpl.java index de5c8d91..4303fc1a 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/GateTypeImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/GateTypeImpl.java @@ -6,25 +6,36 @@ import java.lang.reflect.InvocationTargetException; import java.util.Collection; +import java.util.List; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.ids.IdResolver.IdResolverExtension; +import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; +import org.eclipse.ocl.pivot.library.collection.CollectionUnionOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsTypeOperation; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SetValue; import org.etsi.mts.tdl.DataType; import org.etsi.mts.tdl.Extension; import org.etsi.mts.tdl.GateType; import org.etsi.mts.tdl.GateTypeKind; +import org.etsi.mts.tdl.PackageableElement; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -112,8 +123,7 @@ public class GateTypeImpl extends PackageableElementImpl implements GateType @Override public EList getDataType() { - if (dataType == null) - { + if (dataType == null) { dataType = new EObjectResolvingEList(DataType.class, this, tdlPackage.GATE_TYPE__DATA_TYPE); } return dataType; @@ -164,8 +174,7 @@ public class GateTypeImpl extends PackageableElementImpl implements GateType { Extension oldExtension = extension; extension = newExtension; - if (eNotificationRequired()) - { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, tdlPackage.GATE_TYPE__EXTENSION, oldExtension, newExtension); if (msgs == null) msgs = notification; else msgs.add(notification); } @@ -180,8 +189,7 @@ public class GateTypeImpl extends PackageableElementImpl implements GateType @Override public void setExtension(Extension newExtension) { - if (newExtension != extension) - { + if (newExtension != extension) { NotificationChain msgs = null; if (extension != null) msgs = ((InternalEObject)extension).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - tdlPackage.GATE_TYPE__EXTENSION, null, msgs); @@ -194,16 +202,6 @@ public class GateTypeImpl extends PackageableElementImpl implements GateType eNotify(new ENotificationImpl(this, Notification.SET, tdlPackage.GATE_TYPE__EXTENSION, newExtension, newExtension)); } - /** - * The cached invocation delegate for the '{@link #allDataTypes() All Data Types}' operation. - * - * - * @see #allDataTypes() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate ALL_DATA_TYPES__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.GATE_TYPE___ALL_DATA_TYPES).getInvocationDelegate(); - /** * * @@ -213,14 +211,57 @@ public class GateTypeImpl extends PackageableElementImpl implements GateType @Override public EList allDataTypes() { - try - { - return (EList)ALL_DATA_TYPES__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if not self.extension.oclIsUndefined() + * then + * self.extension.extending.oclAsType(GateType) + * .allDataTypes() + * ->union(self.dataType) + * ->asOrderedSet() + * else self.dataType + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ List dataType_0 = this.getDataType(); + final /*@NonInvalid*/ Extension extension = this.getExtension(); + final /*@NonInvalid*/ OrderedSetValue BOXED_dataType_0 = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_DataType, dataType_0); + final /*@NonInvalid*/ boolean oclIsUndefined = extension == null; + final /*@NonInvalid*/ Boolean not; + if (!oclIsUndefined) { + not = ValueUtil.TRUE_VALUE; + } + else { + if (oclIsUndefined) { + not = ValueUtil.FALSE_VALUE; + } + else { + not = null; + } + } + if (not == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ OrderedSetValue local_0; + if (not) { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_GateType_0 = idResolver.getClass(tdlTables.CLSSid_GateType, null); + if (extension == null) { + throw new InvalidValueException("Null source for \'\'http://www.etsi.org/spec/TDL/1.4.1\'::Extension::extending\'"); + } + final /*@Thrown*/ PackageableElement extending = extension.getExtending(); + final /*@Thrown*/ GateType oclAsType = (GateType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, extending, TYP_tdl_c_c_GateType_0); + final /*@Thrown*/ List allDataTypes = oclAsType.allDataTypes(); + final /*@Thrown*/ OrderedSetValue BOXED_allDataTypes = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_DataType, allDataTypes); + final /*@Thrown*/ SetValue union = (SetValue)CollectionUnionOperation.INSTANCE.evaluate(BOXED_allDataTypes, BOXED_dataType_0); + final /*@Thrown*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(union); + local_0 = asOrderedSet; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + local_0 = BOXED_dataType_0; } + final /*@Thrown*/ List ECORE_local_0 = ((IdResolverExtension)idResolver).ecoreValueOfAll(DataType.class, local_0); + return (EList)ECORE_local_0; } /** @@ -231,8 +272,7 @@ public class GateTypeImpl extends PackageableElementImpl implements GateType @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.GATE_TYPE__EXTENSION: return basicSetExtension(null, msgs); } @@ -247,8 +287,7 @@ public class GateTypeImpl extends PackageableElementImpl implements GateType @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.GATE_TYPE__DATA_TYPE: return getDataType(); case tdlPackage.GATE_TYPE__KIND: @@ -268,8 +307,7 @@ public class GateTypeImpl extends PackageableElementImpl implements GateType @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.GATE_TYPE__DATA_TYPE: getDataType().clear(); getDataType().addAll((Collection)newValue); @@ -292,8 +330,7 @@ public class GateTypeImpl extends PackageableElementImpl implements GateType @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.GATE_TYPE__DATA_TYPE: getDataType().clear(); return; @@ -315,8 +352,7 @@ public class GateTypeImpl extends PackageableElementImpl implements GateType @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.GATE_TYPE__DATA_TYPE: return dataType != null && !dataType.isEmpty(); case tdlPackage.GATE_TYPE__KIND: @@ -335,8 +371,7 @@ public class GateTypeImpl extends PackageableElementImpl implements GateType @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.GATE_TYPE___ALL_DATA_TYPES: return allDataTypes(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/InlineActionImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/InlineActionImpl.java index bcc5ed23..caef55d7 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/InlineActionImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/InlineActionImpl.java @@ -100,8 +100,7 @@ public class InlineActionImpl extends ActionBehaviourImpl implements InlineActio @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.INLINE_ACTION__BODY: return getBody(); } @@ -116,8 +115,7 @@ public class InlineActionImpl extends ActionBehaviourImpl implements InlineActio @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.INLINE_ACTION__BODY: setBody((String)newValue); return; @@ -133,8 +131,7 @@ public class InlineActionImpl extends ActionBehaviourImpl implements InlineActio @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.INLINE_ACTION__BODY: setBody(BODY_EDEFAULT); return; @@ -150,8 +147,7 @@ public class InlineActionImpl extends ActionBehaviourImpl implements InlineActio @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.INLINE_ACTION__BODY: return BODY_EDEFAULT == null ? body != null : !BODY_EDEFAULT.equals(body); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/InteractionImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/InteractionImpl.java index b3daddeb..a2a3694d 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/InteractionImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/InteractionImpl.java @@ -6,14 +6,13 @@ import java.lang.reflect.InvocationTargetException; import java.util.Collection; +import java.util.Iterator; +import java.util.List; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; @@ -21,13 +20,30 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.ids.IdResolver.IdResolverExtension; +import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; +import org.eclipse.ocl.pivot.library.collection.CollectionIncludingOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsSetOperation; +import org.eclipse.ocl.pivot.messages.PivotMessages; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.BagValue; +import org.eclipse.ocl.pivot.values.BagValue.Accumulator; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SetValue; import org.etsi.mts.tdl.AtomicBehaviour; import org.etsi.mts.tdl.Behaviour; import org.etsi.mts.tdl.ComponentInstance; import org.etsi.mts.tdl.GateReference; import org.etsi.mts.tdl.Interaction; import org.etsi.mts.tdl.Target; +import org.etsi.mts.tdl.TestConfiguration; +import org.etsi.mts.tdl.TestDescription; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -94,12 +110,10 @@ public class InteractionImpl extends AtomicBehaviourImpl implements Interaction @Override public GateReference getSourceGate() { - if (sourceGate != null && sourceGate.eIsProxy()) - { + if (sourceGate != null && sourceGate.eIsProxy()) { InternalEObject oldSourceGate = (InternalEObject)sourceGate; sourceGate = (GateReference)eResolveProxy(oldSourceGate); - if (sourceGate != oldSourceGate) - { + if (sourceGate != oldSourceGate) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.INTERACTION__SOURCE_GATE, oldSourceGate, sourceGate)); } @@ -139,23 +153,12 @@ public class InteractionImpl extends AtomicBehaviourImpl implements Interaction @Override public EList getTarget() { - if (target == null) - { + if (target == null) { target = new EObjectContainmentEList(Target.class, this, tdlPackage.INTERACTION__TARGET); } return target; } - /** - * The cached invocation delegate for the '{@link #getParticipatingComponents() Get Participating Components}' operation. - * - * - * @see #getParticipatingComponents() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.INTERACTION___GET_PARTICIPATING_COMPONENTS).getInvocationDelegate(); - /** * * @@ -165,14 +168,93 @@ public class InteractionImpl extends AtomicBehaviourImpl implements Interaction @Override public EList getParticipatingComponents() { - try - { - return (EList)GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if + * self.getParentTestDescription() + * ->exists(td | td.isLocallyOrdered) + * then + * self.target->collect(targetGate.component) + * ->including(sourceGate.component) + * ->asOrderedSet() + * else + * self.getParentTestDescription() + * .testConfiguration.componentInstance->asOrderedSet() + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ TestDescription getParentTestDescription = this.getParentTestDescription(); + final /*@NonInvalid*/ SetValue oclAsSet = OclAnyOclAsSetOperation.INSTANCE.evaluate(executor, tdlTables.SET_CLSSid_TestDescription, getParentTestDescription); + /*@Thrown*/ Object accumulator = ValueUtil.FALSE_VALUE; + Iterator ITERATOR_td = oclAsSet.iterator(); + /*@NonInvalid*/ Boolean exists; + while (true) { + if (!ITERATOR_td.hasNext()) { + if (accumulator == ValueUtil.FALSE_VALUE) { + exists = ValueUtil.FALSE_VALUE; + } + else { + throw (InvalidValueException)accumulator; + } + break; + } + /*@NonInvalid*/ TestDescription td = (TestDescription)ITERATOR_td.next(); + /** + * td.isLocallyOrdered + */ + final /*@NonInvalid*/ boolean isLocallyOrdered = td.isIsLocallyOrdered(); + // + if (isLocallyOrdered) { // Normal successful body evaluation result + exists = ValueUtil.TRUE_VALUE; + break; // Stop immediately + } + else if (!isLocallyOrdered) { // Normal unsuccessful body evaluation result + ; // Carry on + } + else { // Impossible badly typed result + accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "exists"); + } + } + if (exists == null) { + throw new InvalidValueException("Null if condition"); + } + /*@NonInvalid*/ OrderedSetValue local_0; + if (exists) { + final /*@NonInvalid*/ List target = this.getTarget(); + final /*@NonInvalid*/ SetValue BOXED_target = idResolver.createSetOfAll(tdlTables.SET_CLSSid_Target, target); + /*@Thrown*/ Accumulator accumulator_0 = ValueUtil.createBagAccumulatorValue(tdlTables.BAG_CLSSid_ComponentInstance); + Iterator ITERATOR__1 = BOXED_target.iterator(); + /*@NonInvalid*/ BagValue collect; + while (true) { + if (!ITERATOR__1.hasNext()) { + collect = accumulator_0; + break; + } + /*@NonInvalid*/ Target _1 = (Target)ITERATOR__1.next(); + /** + * targetGate.component + */ + final /*@NonInvalid*/ GateReference targetGate = _1.getTargetGate(); + final /*@NonInvalid*/ ComponentInstance component = targetGate.getComponent(); + // + accumulator_0.add(component); + } + final /*@NonInvalid*/ GateReference sourceGate = this.getSourceGate(); + final /*@NonInvalid*/ ComponentInstance component_0 = sourceGate.getComponent(); + final /*@NonInvalid*/ BagValue including = (BagValue)CollectionIncludingOperation.INSTANCE.evaluate(collect, component_0); + final /*@NonInvalid*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(including); + local_0 = asOrderedSet; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + final /*@NonInvalid*/ TestConfiguration testConfiguration = getParentTestDescription.getTestConfiguration(); + final /*@NonInvalid*/ List componentInstance = testConfiguration.getComponentInstance(); + final /*@NonInvalid*/ SetValue BOXED_componentInstance = idResolver.createSetOfAll(tdlTables.SET_CLSSid_ComponentInstance, componentInstance); + final /*@NonInvalid*/ OrderedSetValue asOrderedSet_0 = CollectionAsOrderedSetOperation.INSTANCE.evaluate(BOXED_componentInstance); + local_0 = asOrderedSet_0; } + final /*@NonInvalid*/ List ECORE_local_0 = ((IdResolverExtension)idResolver).ecoreValueOfAll(ComponentInstance.class, local_0); + return (EList)ECORE_local_0; } /** @@ -183,8 +265,7 @@ public class InteractionImpl extends AtomicBehaviourImpl implements Interaction @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.INTERACTION__TARGET: return ((InternalEList)getTarget()).basicRemove(otherEnd, msgs); } @@ -199,8 +280,7 @@ public class InteractionImpl extends AtomicBehaviourImpl implements Interaction @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.INTERACTION__SOURCE_GATE: if (resolve) return getSourceGate(); return basicGetSourceGate(); @@ -219,8 +299,7 @@ public class InteractionImpl extends AtomicBehaviourImpl implements Interaction @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.INTERACTION__SOURCE_GATE: setSourceGate((GateReference)newValue); return; @@ -240,8 +319,7 @@ public class InteractionImpl extends AtomicBehaviourImpl implements Interaction @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.INTERACTION__SOURCE_GATE: setSourceGate((GateReference)null); return; @@ -260,8 +338,7 @@ public class InteractionImpl extends AtomicBehaviourImpl implements Interaction @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.INTERACTION__SOURCE_GATE: return sourceGate != null; case tdlPackage.INTERACTION__TARGET: @@ -278,18 +355,14 @@ public class InteractionImpl extends AtomicBehaviourImpl implements Interaction @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == Behaviour.class) - { - switch (baseOperationID) - { + if (baseClass == Behaviour.class) { + switch (baseOperationID) { case tdlPackage.BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return tdlPackage.INTERACTION___GET_PARTICIPATING_COMPONENTS; default: return super.eDerivedOperationID(baseOperationID, baseClass); } } - if (baseClass == AtomicBehaviour.class) - { - switch (baseOperationID) - { + if (baseClass == AtomicBehaviour.class) { + switch (baseOperationID) { case tdlPackage.ATOMIC_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return tdlPackage.INTERACTION___GET_PARTICIPATING_COMPONENTS; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -305,8 +378,7 @@ public class InteractionImpl extends AtomicBehaviourImpl implements Interaction @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.INTERACTION___GET_PARTICIPATING_COMPONENTS: return getParticipatingComponents(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/LiteralValueUseImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/LiteralValueUseImpl.java index b232b009..0f708c06 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/LiteralValueUseImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/LiteralValueUseImpl.java @@ -6,21 +6,39 @@ import java.lang.reflect.InvocationTargetException; import java.math.BigInteger; +import java.util.Iterator; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.library.classifier.ClassifierAllInstancesOperation; +import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; +import org.eclipse.ocl.pivot.library.collection.OrderedCollectionFirstOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsTypeOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsTypeOfOperation; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SetValue; +import org.eclipse.ocl.pivot.values.SetValue.Accumulator; import org.etsi.mts.tdl.DataType; import org.etsi.mts.tdl.DataUse; +import org.etsi.mts.tdl.Element; import org.etsi.mts.tdl.LiteralValueUse; +import org.etsi.mts.tdl.Member; +import org.etsi.mts.tdl.MemberAssignment; +import org.etsi.mts.tdl.Parameter; +import org.etsi.mts.tdl.ParameterBinding; +import org.etsi.mts.tdl.SimpleDataType; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -214,12 +232,10 @@ public class LiteralValueUseImpl extends StaticDataUseImpl implements LiteralVal @Override public DataType getDataType() { - if (dataType != null && dataType.eIsProxy()) - { + if (dataType != null && dataType.eIsProxy()) { InternalEObject oldDataType = (InternalEObject)dataType; dataType = (DataType)eResolveProxy(oldDataType); - if (dataType != oldDataType) - { + if (dataType != oldDataType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.LITERAL_VALUE_USE__DATA_TYPE, oldDataType, dataType)); } @@ -251,16 +267,6 @@ public class LiteralValueUseImpl extends StaticDataUseImpl implements LiteralVal eNotify(new ENotificationImpl(this, Notification.SET, tdlPackage.LITERAL_VALUE_USE__DATA_TYPE, oldDataType, dataType)); } - /** - * The cached invocation delegate for the '{@link #resolveDataType() Resolve Data Type}' operation. - * - * - * @see #resolveDataType() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate RESOLVE_DATA_TYPE__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.LITERAL_VALUE_USE___RESOLVE_DATA_TYPE).getInvocationDelegate(); - /** * * @@ -269,14 +275,210 @@ public class LiteralValueUseImpl extends StaticDataUseImpl implements LiteralVal @Override public DataType resolveDataType() { - try - { - return (DataType)RESOLVE_DATA_TYPE__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if not self.dataType.oclIsUndefined() + * then self.dataType + * else + * if self.container().oclIsTypeOf(MemberAssignment) + * then + * self.container() + * .oclAsType(MemberAssignment).member.dataType + * else + * if self.container().oclIsTypeOf(ParameterBinding) + * then + * self.container() + * .oclAsType(ParameterBinding).parameter.dataType + * else + * if not self.intValue.oclIsUndefined() + * then + * SimpleDataType.allInstances() + * ->select(t | t.name = 'Integer') + * ->asOrderedSet() + * ->first() + * else + * if not self.boolValue.oclIsUndefined() + * then + * SimpleDataType.allInstances() + * ->select(t | t.name = 'Boolean') + * ->asOrderedSet() + * ->first() + * else + * SimpleDataType.allInstances() + * ->select(t | t.name = 'String') + * ->asOrderedSet() + * ->first() + * endif + * endif + * endif + * endif + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ DataType dataType_0 = this.getDataType(); + final /*@NonInvalid*/ boolean oclIsUndefined = dataType_0 == null; + final /*@NonInvalid*/ Boolean not; + if (!oclIsUndefined) { + not = ValueUtil.TRUE_VALUE; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + if (oclIsUndefined) { + not = ValueUtil.FALSE_VALUE; + } + else { + not = null; + } + } + if (not == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ DataType local_4; + if (not) { + local_4 = dataType_0; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_MemberAssignment_0 = idResolver.getClass(tdlTables.CLSSid_MemberAssignment, null); + final /*@NonInvalid*/ Element container = this.container(); + final /*@NonInvalid*/ boolean oclIsTypeOf = OclAnyOclIsTypeOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_MemberAssignment_0).booleanValue(); + /*@Thrown*/ DataType local_3; + if (oclIsTypeOf) { + final /*@Thrown*/ MemberAssignment oclAsType = (MemberAssignment)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_MemberAssignment_0); + final /*@Thrown*/ Member member = oclAsType.getMember(); + final /*@Thrown*/ DataType dataType_1 = member.getDataType(); + local_3 = dataType_1; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_ParameterBinding_0 = idResolver.getClass(tdlTables.CLSSid_ParameterBinding, null); + final /*@NonInvalid*/ boolean oclIsTypeOf_0 = OclAnyOclIsTypeOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_ParameterBinding_0).booleanValue(); + /*@Thrown*/ DataType local_2; + if (oclIsTypeOf_0) { + final /*@Thrown*/ ParameterBinding oclAsType_0 = (ParameterBinding)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_ParameterBinding_0); + final /*@Thrown*/ Parameter parameter = oclAsType_0.getParameter(); + final /*@Thrown*/ DataType dataType_2 = parameter.getDataType(); + local_2 = dataType_2; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_SimpleDataType_0 = idResolver.getClass(tdlTables.CLSSid_SimpleDataType, null); + final /*@NonInvalid*/ SetValue allInstances = ClassifierAllInstancesOperation.INSTANCE.evaluate(executor, tdlTables.SET_CLSSid_SimpleDataType, TYP_tdl_c_c_SimpleDataType_0); + final /*@NonInvalid*/ BigInteger intValue = this.getIntValue(); + final /*@NonInvalid*/ boolean oclIsUndefined_0 = intValue == null; + final /*@NonInvalid*/ Boolean not_0; + if (!oclIsUndefined_0) { + not_0 = ValueUtil.TRUE_VALUE; + } + else { + if (oclIsUndefined_0) { + not_0 = ValueUtil.FALSE_VALUE; + } + else { + not_0 = null; + } + } + if (not_0 == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ SimpleDataType local_1; + if (not_0) { + /*@Thrown*/ Accumulator accumulator = ValueUtil.createSetAccumulatorValue(tdlTables.SET_CLSSid_SimpleDataType); + Iterator ITERATOR_t = allInstances.iterator(); + /*@NonInvalid*/ SetValue select; + while (true) { + if (!ITERATOR_t.hasNext()) { + select = accumulator; + break; + } + /*@NonInvalid*/ SimpleDataType t = (SimpleDataType)ITERATOR_t.next(); + /** + * t.name = 'Integer' + */ + final /*@NonInvalid*/ String name = t.getName(); + final /*@NonInvalid*/ boolean eq = tdlTables.STR_Integer.equals(name); + // + if (eq) { + accumulator.add(t); + } + } + final /*@NonInvalid*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(select); + final /*@Thrown*/ SimpleDataType first = (SimpleDataType)OrderedCollectionFirstOperation.INSTANCE.evaluate(asOrderedSet); + local_1 = first; + } + else { + final /*@NonInvalid*/ Boolean boolValue = this.getBoolValue(); + final /*@NonInvalid*/ boolean oclIsUndefined_1 = boolValue == null; + final /*@NonInvalid*/ Boolean not_1; + if (!oclIsUndefined_1) { + not_1 = ValueUtil.TRUE_VALUE; + } + else { + if (oclIsUndefined_1) { + not_1 = ValueUtil.FALSE_VALUE; + } + else { + not_1 = null; + } + } + if (not_1 == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ SimpleDataType local_0; + if (not_1) { + /*@Thrown*/ Accumulator accumulator_0 = ValueUtil.createSetAccumulatorValue(tdlTables.SET_CLSSid_SimpleDataType); + Iterator ITERATOR_t_0 = allInstances.iterator(); + /*@NonInvalid*/ SetValue select_0; + while (true) { + if (!ITERATOR_t_0.hasNext()) { + select_0 = accumulator_0; + break; + } + /*@NonInvalid*/ SimpleDataType t_0 = (SimpleDataType)ITERATOR_t_0.next(); + /** + * t.name = 'Boolean' + */ + final /*@NonInvalid*/ String name_0 = t_0.getName(); + final /*@NonInvalid*/ boolean eq_0 = tdlTables.STR_Boolean.equals(name_0); + // + if (eq_0) { + accumulator_0.add(t_0); + } + } + final /*@NonInvalid*/ OrderedSetValue asOrderedSet_0 = CollectionAsOrderedSetOperation.INSTANCE.evaluate(select_0); + final /*@Thrown*/ SimpleDataType first_0 = (SimpleDataType)OrderedCollectionFirstOperation.INSTANCE.evaluate(asOrderedSet_0); + local_0 = first_0; + } + else { + /*@Thrown*/ Accumulator accumulator_1 = ValueUtil.createSetAccumulatorValue(tdlTables.SET_CLSSid_SimpleDataType); + Iterator ITERATOR_t_1 = allInstances.iterator(); + /*@NonInvalid*/ SetValue select_1; + while (true) { + if (!ITERATOR_t_1.hasNext()) { + select_1 = accumulator_1; + break; + } + /*@NonInvalid*/ SimpleDataType t_1 = (SimpleDataType)ITERATOR_t_1.next(); + /** + * t.name = 'String' + */ + final /*@NonInvalid*/ String name_1 = t_1.getName(); + final /*@NonInvalid*/ boolean eq_1 = tdlTables.STR_String.equals(name_1); + // + if (eq_1) { + accumulator_1.add(t_1); + } + } + final /*@NonInvalid*/ OrderedSetValue asOrderedSet_1 = CollectionAsOrderedSetOperation.INSTANCE.evaluate(select_1); + final /*@Thrown*/ SimpleDataType first_1 = (SimpleDataType)OrderedCollectionFirstOperation.INSTANCE.evaluate(asOrderedSet_1); + local_0 = first_1; + } + local_1 = local_0; + } + local_2 = local_1; + } + local_3 = local_2; + } + local_4 = local_3; } + return local_4; } /** @@ -287,8 +489,7 @@ public class LiteralValueUseImpl extends StaticDataUseImpl implements LiteralVal @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.LITERAL_VALUE_USE__VALUE: return getValue(); case tdlPackage.LITERAL_VALUE_USE__INT_VALUE: @@ -310,8 +511,7 @@ public class LiteralValueUseImpl extends StaticDataUseImpl implements LiteralVal @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.LITERAL_VALUE_USE__VALUE: setValue((String)newValue); return; @@ -336,8 +536,7 @@ public class LiteralValueUseImpl extends StaticDataUseImpl implements LiteralVal @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.LITERAL_VALUE_USE__VALUE: setValue(VALUE_EDEFAULT); return; @@ -362,8 +561,7 @@ public class LiteralValueUseImpl extends StaticDataUseImpl implements LiteralVal @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.LITERAL_VALUE_USE__VALUE: return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); case tdlPackage.LITERAL_VALUE_USE__INT_VALUE: @@ -384,10 +582,8 @@ public class LiteralValueUseImpl extends StaticDataUseImpl implements LiteralVal @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == DataUse.class) - { - switch (baseOperationID) - { + if (baseClass == DataUse.class) { + switch (baseOperationID) { case tdlPackage.DATA_USE___RESOLVE_DATA_TYPE: return tdlPackage.LITERAL_VALUE_USE___RESOLVE_DATA_TYPE; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -403,8 +599,7 @@ public class LiteralValueUseImpl extends StaticDataUseImpl implements LiteralVal @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.LITERAL_VALUE_USE___RESOLVE_DATA_TYPE: return resolveDataType(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/LocalExpressionImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/LocalExpressionImpl.java index 3db1568e..166f9f75 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/LocalExpressionImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/LocalExpressionImpl.java @@ -92,8 +92,7 @@ public class LocalExpressionImpl extends ElementImpl implements LocalExpression { DataUse oldExpression = expression; expression = newExpression; - if (eNotificationRequired()) - { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, tdlPackage.LOCAL_EXPRESSION__EXPRESSION, oldExpression, newExpression); if (msgs == null) msgs = notification; else msgs.add(notification); } @@ -108,8 +107,7 @@ public class LocalExpressionImpl extends ElementImpl implements LocalExpression @Override public void setExpression(DataUse newExpression) { - if (newExpression != expression) - { + if (newExpression != expression) { NotificationChain msgs = null; if (expression != null) msgs = ((InternalEObject)expression).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - tdlPackage.LOCAL_EXPRESSION__EXPRESSION, null, msgs); @@ -130,12 +128,10 @@ public class LocalExpressionImpl extends ElementImpl implements LocalExpression @Override public ComponentInstance getComponentInstance() { - if (componentInstance != null && componentInstance.eIsProxy()) - { + if (componentInstance != null && componentInstance.eIsProxy()) { InternalEObject oldComponentInstance = (InternalEObject)componentInstance; componentInstance = (ComponentInstance)eResolveProxy(oldComponentInstance); - if (componentInstance != oldComponentInstance) - { + if (componentInstance != oldComponentInstance) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.LOCAL_EXPRESSION__COMPONENT_INSTANCE, oldComponentInstance, componentInstance)); } @@ -175,8 +171,7 @@ public class LocalExpressionImpl extends ElementImpl implements LocalExpression @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.LOCAL_EXPRESSION__EXPRESSION: return basicSetExpression(null, msgs); } @@ -191,8 +186,7 @@ public class LocalExpressionImpl extends ElementImpl implements LocalExpression @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.LOCAL_EXPRESSION__EXPRESSION: return getExpression(); case tdlPackage.LOCAL_EXPRESSION__COMPONENT_INSTANCE: @@ -210,8 +204,7 @@ public class LocalExpressionImpl extends ElementImpl implements LocalExpression @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.LOCAL_EXPRESSION__EXPRESSION: setExpression((DataUse)newValue); return; @@ -230,8 +223,7 @@ public class LocalExpressionImpl extends ElementImpl implements LocalExpression @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.LOCAL_EXPRESSION__EXPRESSION: setExpression((DataUse)null); return; @@ -250,8 +242,7 @@ public class LocalExpressionImpl extends ElementImpl implements LocalExpression @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.LOCAL_EXPRESSION__EXPRESSION: return expression != null; case tdlPackage.LOCAL_EXPRESSION__COMPONENT_INSTANCE: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/MemberAssignmentImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/MemberAssignmentImpl.java index 0fcfe77e..2db54152 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/MemberAssignmentImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/MemberAssignmentImpl.java @@ -80,12 +80,10 @@ public class MemberAssignmentImpl extends ElementImpl implements MemberAssignmen @Override public Member getMember() { - if (member != null && member.eIsProxy()) - { + if (member != null && member.eIsProxy()) { InternalEObject oldMember = (InternalEObject)member; member = (Member)eResolveProxy(oldMember); - if (member != oldMember) - { + if (member != oldMember) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.MEMBER_ASSIGNMENT__MEMBER, oldMember, member)); } @@ -137,8 +135,7 @@ public class MemberAssignmentImpl extends ElementImpl implements MemberAssignmen { DataUse oldMemberSpec = memberSpec; memberSpec = newMemberSpec; - if (eNotificationRequired()) - { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, tdlPackage.MEMBER_ASSIGNMENT__MEMBER_SPEC, oldMemberSpec, newMemberSpec); if (msgs == null) msgs = notification; else msgs.add(notification); } @@ -153,8 +150,7 @@ public class MemberAssignmentImpl extends ElementImpl implements MemberAssignmen @Override public void setMemberSpec(DataUse newMemberSpec) { - if (newMemberSpec != memberSpec) - { + if (newMemberSpec != memberSpec) { NotificationChain msgs = null; if (memberSpec != null) msgs = ((InternalEObject)memberSpec).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - tdlPackage.MEMBER_ASSIGNMENT__MEMBER_SPEC, null, msgs); @@ -175,8 +171,7 @@ public class MemberAssignmentImpl extends ElementImpl implements MemberAssignmen @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MEMBER_ASSIGNMENT__MEMBER_SPEC: return basicSetMemberSpec(null, msgs); } @@ -191,8 +186,7 @@ public class MemberAssignmentImpl extends ElementImpl implements MemberAssignmen @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MEMBER_ASSIGNMENT__MEMBER: if (resolve) return getMember(); return basicGetMember(); @@ -210,8 +204,7 @@ public class MemberAssignmentImpl extends ElementImpl implements MemberAssignmen @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MEMBER_ASSIGNMENT__MEMBER: setMember((Member)newValue); return; @@ -230,8 +223,7 @@ public class MemberAssignmentImpl extends ElementImpl implements MemberAssignmen @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MEMBER_ASSIGNMENT__MEMBER: setMember((Member)null); return; @@ -250,8 +242,7 @@ public class MemberAssignmentImpl extends ElementImpl implements MemberAssignmen @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MEMBER_ASSIGNMENT__MEMBER: return member != null; case tdlPackage.MEMBER_ASSIGNMENT__MEMBER_SPEC: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/MemberImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/MemberImpl.java index 00691893..5032ffd2 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/MemberImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/MemberImpl.java @@ -121,8 +121,7 @@ public class MemberImpl extends ParameterImpl implements Member @Override public EList getConstraint() { - if (constraint == null) - { + if (constraint == null) { constraint = new EObjectContainmentEList(Constraint.class, this, tdlPackage.MEMBER__CONSTRAINT); } return constraint; @@ -136,8 +135,7 @@ public class MemberImpl extends ParameterImpl implements Member @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MEMBER__CONSTRAINT: return ((InternalEList)getConstraint()).basicRemove(otherEnd, msgs); } @@ -152,8 +150,7 @@ public class MemberImpl extends ParameterImpl implements Member @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MEMBER__IS_OPTIONAL: return isIsOptional(); case tdlPackage.MEMBER__CONSTRAINT: @@ -171,8 +168,7 @@ public class MemberImpl extends ParameterImpl implements Member @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MEMBER__IS_OPTIONAL: setIsOptional((Boolean)newValue); return; @@ -192,8 +188,7 @@ public class MemberImpl extends ParameterImpl implements Member @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MEMBER__IS_OPTIONAL: setIsOptional(IS_OPTIONAL_EDEFAULT); return; @@ -212,8 +207,7 @@ public class MemberImpl extends ParameterImpl implements Member @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MEMBER__IS_OPTIONAL: return isOptional != IS_OPTIONAL_EDEFAULT; case tdlPackage.MEMBER__CONSTRAINT: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/MemberReferenceImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/MemberReferenceImpl.java index 4424ce92..32cd7b1b 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/MemberReferenceImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/MemberReferenceImpl.java @@ -80,12 +80,10 @@ public class MemberReferenceImpl extends ElementImpl implements MemberReference @Override public Member getMember() { - if (member != null && member.eIsProxy()) - { + if (member != null && member.eIsProxy()) { InternalEObject oldMember = (InternalEObject)member; member = (Member)eResolveProxy(oldMember); - if (member != oldMember) - { + if (member != oldMember) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.MEMBER_REFERENCE__MEMBER, oldMember, member)); } @@ -137,8 +135,7 @@ public class MemberReferenceImpl extends ElementImpl implements MemberReference { DataUse oldCollectionIndex = collectionIndex; collectionIndex = newCollectionIndex; - if (eNotificationRequired()) - { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, tdlPackage.MEMBER_REFERENCE__COLLECTION_INDEX, oldCollectionIndex, newCollectionIndex); if (msgs == null) msgs = notification; else msgs.add(notification); } @@ -153,8 +150,7 @@ public class MemberReferenceImpl extends ElementImpl implements MemberReference @Override public void setCollectionIndex(DataUse newCollectionIndex) { - if (newCollectionIndex != collectionIndex) - { + if (newCollectionIndex != collectionIndex) { NotificationChain msgs = null; if (collectionIndex != null) msgs = ((InternalEObject)collectionIndex).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - tdlPackage.MEMBER_REFERENCE__COLLECTION_INDEX, null, msgs); @@ -175,8 +171,7 @@ public class MemberReferenceImpl extends ElementImpl implements MemberReference @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MEMBER_REFERENCE__COLLECTION_INDEX: return basicSetCollectionIndex(null, msgs); } @@ -191,8 +186,7 @@ public class MemberReferenceImpl extends ElementImpl implements MemberReference @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MEMBER_REFERENCE__MEMBER: if (resolve) return getMember(); return basicGetMember(); @@ -210,8 +204,7 @@ public class MemberReferenceImpl extends ElementImpl implements MemberReference @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MEMBER_REFERENCE__MEMBER: setMember((Member)newValue); return; @@ -230,8 +223,7 @@ public class MemberReferenceImpl extends ElementImpl implements MemberReference @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MEMBER_REFERENCE__MEMBER: setMember((Member)null); return; @@ -250,8 +242,7 @@ public class MemberReferenceImpl extends ElementImpl implements MemberReference @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MEMBER_REFERENCE__MEMBER: return member != null; case tdlPackage.MEMBER_REFERENCE__COLLECTION_INDEX: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/MessageImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/MessageImpl.java index 4a382832..24faf735 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/MessageImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/MessageImpl.java @@ -126,8 +126,7 @@ public class MessageImpl extends InteractionImpl implements Message { DataUse oldArgument = argument; argument = newArgument; - if (eNotificationRequired()) - { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, tdlPackage.MESSAGE__ARGUMENT, oldArgument, newArgument); if (msgs == null) msgs = notification; else msgs.add(notification); } @@ -142,8 +141,7 @@ public class MessageImpl extends InteractionImpl implements Message @Override public void setArgument(DataUse newArgument) { - if (newArgument != argument) - { + if (newArgument != argument) { NotificationChain msgs = null; if (argument != null) msgs = ((InternalEObject)argument).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - tdlPackage.MESSAGE__ARGUMENT, null, msgs); @@ -164,8 +162,7 @@ public class MessageImpl extends InteractionImpl implements Message @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MESSAGE__ARGUMENT: return basicSetArgument(null, msgs); } @@ -180,8 +177,7 @@ public class MessageImpl extends InteractionImpl implements Message @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MESSAGE__IS_TRIGGER: return isIsTrigger(); case tdlPackage.MESSAGE__ARGUMENT: @@ -198,8 +194,7 @@ public class MessageImpl extends InteractionImpl implements Message @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MESSAGE__IS_TRIGGER: setIsTrigger((Boolean)newValue); return; @@ -218,8 +213,7 @@ public class MessageImpl extends InteractionImpl implements Message @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MESSAGE__IS_TRIGGER: setIsTrigger(IS_TRIGGER_EDEFAULT); return; @@ -238,8 +232,7 @@ public class MessageImpl extends InteractionImpl implements Message @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MESSAGE__IS_TRIGGER: return isTrigger != IS_TRIGGER_EDEFAULT; case tdlPackage.MESSAGE__ARGUMENT: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/MultipleCombinedBehaviourImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/MultipleCombinedBehaviourImpl.java index d0bbd7f8..63f23ca7 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/MultipleCombinedBehaviourImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/MultipleCombinedBehaviourImpl.java @@ -6,23 +6,42 @@ import java.lang.reflect.InvocationTargetException; import java.util.Collection; +import java.util.Iterator; +import java.util.List; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.ids.IdResolver.IdResolverExtension; +import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; +import org.eclipse.ocl.pivot.library.collection.CollectionUnionOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsSetOperation; +import org.eclipse.ocl.pivot.messages.PivotMessages; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.BagValue; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SequenceValue; +import org.eclipse.ocl.pivot.values.SequenceValue.Accumulator; +import org.eclipse.ocl.pivot.values.SetValue; import org.etsi.mts.tdl.Behaviour; import org.etsi.mts.tdl.Block; import org.etsi.mts.tdl.ComponentInstance; +import org.etsi.mts.tdl.ExceptionalBehaviour; import org.etsi.mts.tdl.MultipleCombinedBehaviour; +import org.etsi.mts.tdl.PeriodicBehaviour; +import org.etsi.mts.tdl.TestConfiguration; +import org.etsi.mts.tdl.TestDescription; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -78,23 +97,12 @@ public abstract class MultipleCombinedBehaviourImpl extends CombinedBehaviourImp @Override public EList getBlock() { - if (block == null) - { + if (block == null) { block = new EObjectContainmentEList(Block.class, this, tdlPackage.MULTIPLE_COMBINED_BEHAVIOUR__BLOCK); } return block; } - /** - * The cached invocation delegate for the '{@link #getParticipatingComponents() Get Participating Components}' operation. - * - * - * @see #getParticipatingComponents() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.MULTIPLE_COMBINED_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS).getInvocationDelegate(); - /** * * @@ -104,14 +112,137 @@ public abstract class MultipleCombinedBehaviourImpl extends CombinedBehaviourImp @Override public EList getParticipatingComponents() { - try - { - return (EList)GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if + * self.getParentTestDescription() + * ->exists(td | td.isLocallyOrdered) + * then + * self.periodic.getParticipatingComponents() + * ->union(self.exceptional.getParticipatingComponents()) + * ->union(self.block.getParticipatingComponents()) + * ->asOrderedSet() + * else + * self.getParentTestDescription() + * .testConfiguration.componentInstance->asOrderedSet() + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ TestDescription getParentTestDescription = this.getParentTestDescription(); + final /*@NonInvalid*/ SetValue oclAsSet = OclAnyOclAsSetOperation.INSTANCE.evaluate(executor, tdlTables.SET_CLSSid_TestDescription, getParentTestDescription); + /*@Thrown*/ Object accumulator = ValueUtil.FALSE_VALUE; + Iterator ITERATOR_td = oclAsSet.iterator(); + /*@NonInvalid*/ Boolean exists; + while (true) { + if (!ITERATOR_td.hasNext()) { + if (accumulator == ValueUtil.FALSE_VALUE) { + exists = ValueUtil.FALSE_VALUE; + } + else { + throw (InvalidValueException)accumulator; + } + break; + } + /*@NonInvalid*/ TestDescription td = (TestDescription)ITERATOR_td.next(); + /** + * td.isLocallyOrdered + */ + final /*@NonInvalid*/ boolean isLocallyOrdered = td.isIsLocallyOrdered(); + // + if (isLocallyOrdered) { // Normal successful body evaluation result + exists = ValueUtil.TRUE_VALUE; + break; // Stop immediately + } + else if (!isLocallyOrdered) { // Normal unsuccessful body evaluation result + ; // Carry on + } + else { // Impossible badly typed result + accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "exists"); + } + } + if (exists == null) { + throw new InvalidValueException("Null if condition"); + } + /*@NonInvalid*/ OrderedSetValue local_0; + if (exists) { + final /*@NonInvalid*/ List periodic = this.getPeriodic(); + final /*@NonInvalid*/ OrderedSetValue BOXED_periodic = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_PeriodicBehaviour, periodic); + /*@Thrown*/ Accumulator accumulator_0 = ValueUtil.createSequenceAccumulatorValue(tdlTables.SEQ_CLSSid_ComponentInstance); + Iterator ITERATOR__1 = BOXED_periodic.iterator(); + /*@NonInvalid*/ SequenceValue collect; + while (true) { + if (!ITERATOR__1.hasNext()) { + collect = accumulator_0; + break; + } + /*@NonInvalid*/ PeriodicBehaviour _1 = (PeriodicBehaviour)ITERATOR__1.next(); + /** + * getParticipatingComponents() + */ + final /*@NonInvalid*/ List getParticipatingComponents = _1.getParticipatingComponents(); + final /*@NonInvalid*/ OrderedSetValue BOXED_getParticipatingComponents = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_ComponentInstance, getParticipatingComponents); + // + for (Object value : BOXED_getParticipatingComponents.flatten().getElements()) { + accumulator_0.add(value); + } + } + final /*@NonInvalid*/ List exceptional = this.getExceptional(); + final /*@NonInvalid*/ OrderedSetValue BOXED_exceptional = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_ExceptionalBehaviour, exceptional); + /*@Thrown*/ Accumulator accumulator_1 = ValueUtil.createSequenceAccumulatorValue(tdlTables.SEQ_CLSSid_ComponentInstance); + Iterator ITERATOR__1_0 = BOXED_exceptional.iterator(); + /*@NonInvalid*/ SequenceValue collect_0; + while (true) { + if (!ITERATOR__1_0.hasNext()) { + collect_0 = accumulator_1; + break; + } + /*@NonInvalid*/ ExceptionalBehaviour _1_0 = (ExceptionalBehaviour)ITERATOR__1_0.next(); + /** + * getParticipatingComponents() + */ + final /*@NonInvalid*/ List getParticipatingComponents_0 = _1_0.getParticipatingComponents(); + final /*@NonInvalid*/ OrderedSetValue BOXED_getParticipatingComponents_0 = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_ComponentInstance, getParticipatingComponents_0); + // + for (Object value : BOXED_getParticipatingComponents_0.flatten().getElements()) { + accumulator_1.add(value); + } + } + final /*@NonInvalid*/ BagValue union = (BagValue)CollectionUnionOperation.INSTANCE.evaluate(collect, collect_0); + final /*@NonInvalid*/ List block = this.getBlock(); + final /*@NonInvalid*/ OrderedSetValue BOXED_block = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_Block, block); + /*@Thrown*/ Accumulator accumulator_2 = ValueUtil.createSequenceAccumulatorValue(tdlTables.SEQ_CLSSid_ComponentInstance); + Iterator ITERATOR__1_1 = BOXED_block.iterator(); + /*@NonInvalid*/ SequenceValue collect_1; + while (true) { + if (!ITERATOR__1_1.hasNext()) { + collect_1 = accumulator_2; + break; + } + /*@NonInvalid*/ Block _1_1 = (Block)ITERATOR__1_1.next(); + /** + * getParticipatingComponents() + */ + final /*@NonInvalid*/ List getParticipatingComponents_1 = _1_1.getParticipatingComponents(); + final /*@NonInvalid*/ OrderedSetValue BOXED_getParticipatingComponents_1 = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_ComponentInstance, getParticipatingComponents_1); + // + for (Object value : BOXED_getParticipatingComponents_1.flatten().getElements()) { + accumulator_2.add(value); + } + } + final /*@NonInvalid*/ BagValue union_0 = (BagValue)CollectionUnionOperation.INSTANCE.evaluate(union, collect_1); + final /*@NonInvalid*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(union_0); + local_0 = asOrderedSet; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + final /*@NonInvalid*/ TestConfiguration testConfiguration = getParentTestDescription.getTestConfiguration(); + final /*@NonInvalid*/ List componentInstance = testConfiguration.getComponentInstance(); + final /*@NonInvalid*/ SetValue BOXED_componentInstance = idResolver.createSetOfAll(tdlTables.SET_CLSSid_ComponentInstance, componentInstance); + final /*@NonInvalid*/ OrderedSetValue asOrderedSet_0 = CollectionAsOrderedSetOperation.INSTANCE.evaluate(BOXED_componentInstance); + local_0 = asOrderedSet_0; } + final /*@NonInvalid*/ List ECORE_local_0 = ((IdResolverExtension)idResolver).ecoreValueOfAll(ComponentInstance.class, local_0); + return (EList)ECORE_local_0; } /** @@ -122,8 +253,7 @@ public abstract class MultipleCombinedBehaviourImpl extends CombinedBehaviourImp @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MULTIPLE_COMBINED_BEHAVIOUR__BLOCK: return ((InternalEList)getBlock()).basicRemove(otherEnd, msgs); } @@ -138,8 +268,7 @@ public abstract class MultipleCombinedBehaviourImpl extends CombinedBehaviourImp @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MULTIPLE_COMBINED_BEHAVIOUR__BLOCK: return getBlock(); } @@ -155,8 +284,7 @@ public abstract class MultipleCombinedBehaviourImpl extends CombinedBehaviourImp @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MULTIPLE_COMBINED_BEHAVIOUR__BLOCK: getBlock().clear(); getBlock().addAll((Collection)newValue); @@ -173,8 +301,7 @@ public abstract class MultipleCombinedBehaviourImpl extends CombinedBehaviourImp @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MULTIPLE_COMBINED_BEHAVIOUR__BLOCK: getBlock().clear(); return; @@ -190,8 +317,7 @@ public abstract class MultipleCombinedBehaviourImpl extends CombinedBehaviourImp @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.MULTIPLE_COMBINED_BEHAVIOUR__BLOCK: return block != null && !block.isEmpty(); } @@ -206,10 +332,8 @@ public abstract class MultipleCombinedBehaviourImpl extends CombinedBehaviourImp @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == Behaviour.class) - { - switch (baseOperationID) - { + if (baseClass == Behaviour.class) { + switch (baseOperationID) { case tdlPackage.BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return tdlPackage.MULTIPLE_COMBINED_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -225,8 +349,7 @@ public abstract class MultipleCombinedBehaviourImpl extends CombinedBehaviourImp @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.MULTIPLE_COMBINED_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return getParticipatingComponents(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/NamedElementImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/NamedElementImpl.java index 41de9af2..3be4bd01 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/NamedElementImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/NamedElementImpl.java @@ -2,11 +2,32 @@ */ package org.etsi.mts.tdl.impl; +import java.util.Iterator; import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; - +import org.eclipse.ocl.pivot.StandardLibrary; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.ids.TypeId; +import org.eclipse.ocl.pivot.internal.library.executor.ExecutorSingleIterationManager; +import org.eclipse.ocl.pivot.library.AbstractBinaryOperation; +import org.eclipse.ocl.pivot.library.LibraryIteration.LibraryIterationExtension; +import org.eclipse.ocl.pivot.library.classifier.ClassifierOclContainerOperation; +import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; +import org.eclipse.ocl.pivot.library.collection.OrderedCollectionFirstOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsSetOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsTypeOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsKindOfOperation; +import org.eclipse.ocl.pivot.library.string.StringConcatOperation; +import org.eclipse.ocl.pivot.oclstdlib.OCLstdlibTables; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SetValue; +import org.eclipse.ocl.pivot.values.SetValue.Accumulator; import org.etsi.mts.tdl.NamedElement; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -24,15 +45,14 @@ import org.etsi.mts.tdl.tdlPackage; public abstract class NamedElementImpl extends ElementImpl implements NamedElement { /** - * The cached setting delegate for the '{@link #getQualifiedName() Qualified Name}' attribute. + * The default value of the '{@link #getQualifiedName() Qualified Name}' attribute. * * * @see #getQualifiedName() * @generated * @ordered */ - protected EStructuralFeature.Internal.SettingDelegate QUALIFIED_NAME__ESETTING_DELEGATE = ((EStructuralFeature.Internal)tdlPackage.Literals.NAMED_ELEMENT__QUALIFIED_NAME).getSettingDelegate(); - + protected static final String QUALIFIED_NAME_EDEFAULT = null; /** * * @@ -62,7 +82,131 @@ public abstract class NamedElementImpl extends ElementImpl implements NamedEleme @Override public String getQualifiedName() { - return (String)QUALIFIED_NAME__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false); + /** + * + * if self.name.oclIsUndefined() + * then '' + * else + * if not self.oclContainer().oclIsUndefined() + * then + * if self.oclContainer().oclIsKindOf(NamedElement) + * then + * self.oclContainer() + * .oclAsType(NamedElement).qualifiedName + '::' + self.name + * else + * self.oclContainer() + * .oclAsType(OclElement) + * ->closure(oclContainer()) + * ->select(c | c.oclIsKindOf(NamedElement)) + * ->asOrderedSet() + * ->first() + * .oclAsType(NamedElement).qualifiedName + '::' + self.name + * endif + * else self.name + * endif + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ String name_2 = this.getName(); + final /*@NonInvalid*/ StandardLibrary standardLibrary = idResolver.getStandardLibrary(); + final /*@NonInvalid*/ boolean oclIsUndefined = name_2 == null; + /*@Thrown*/ String local_2; + if (oclIsUndefined) { + local_2 = tdlTables.STR_; + } + else { + final /*@NonInvalid*/ Object oclContainer_0 = ClassifierOclContainerOperation.INSTANCE.evaluate(executor, this); + final /*@NonInvalid*/ boolean oclIsUndefined_0 = oclContainer_0 == null; + final /*@NonInvalid*/ Boolean not; + if (!oclIsUndefined_0) { + not = ValueUtil.TRUE_VALUE; + } + else { + if (oclIsUndefined_0) { + not = ValueUtil.FALSE_VALUE; + } + else { + not = null; + } + } + if (not == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ String local_1; + if (not) { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_NamedElement_0 = idResolver.getClass(tdlTables.CLSSid_NamedElement, null); + final /*@Thrown*/ boolean oclIsKindOf = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, oclContainer_0, TYP_tdl_c_c_NamedElement_0).booleanValue(); + /*@Thrown*/ String local_0; + if (oclIsKindOf) { + final /*@Thrown*/ NamedElement oclAsType = (NamedElement)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, oclContainer_0, TYP_tdl_c_c_NamedElement_0); + final /*@Thrown*/ String qualifiedName = oclAsType.getQualifiedName(); + final /*@Thrown*/ String sum = StringConcatOperation.INSTANCE.evaluate(qualifiedName, tdlTables.STR__c_c); + final /*@Thrown*/ String sum_0 = StringConcatOperation.INSTANCE.evaluate(sum, name_2); + local_0 = sum_0; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_OclElement_0 = idResolver.getClass(tdlTables.CLSSid_OclElement, null); + final /*@Thrown*/ Object oclAsType_0 = OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, oclContainer_0, TYP_OclElement_0); + final /*@Thrown*/ SetValue oclAsSet = OclAnyOclAsSetOperation.INSTANCE.evaluate(executor, tdlTables.SET_CLSSid_OclElement, oclAsType_0); + final org.eclipse.ocl.pivot.Class TYPE_closure_0 = executor.getStaticTypeOfValue(null, oclAsSet); + final LibraryIterationExtension IMPL_closure_0 = (LibraryIterationExtension)TYPE_closure_0.lookupImplementation(standardLibrary, OCLstdlibTables.Operations._Set__closure); + final /*@NonNull*/ Object ACC_closure_0 = IMPL_closure_0.createAccumulatorValue(executor, tdlTables.SET_CLSSid_OclElement, tdlTables.CLSSid_OclElement); + /** + * Implementation of the iterator body. + */ + final AbstractBinaryOperation BODY_closure_0 = new AbstractBinaryOperation() { + /** + * oclContainer() + */ + @Override + public /*@Nullable*/ Object evaluate(final Executor executor, final TypeId typeId, final /*@Nullable*/ Object oclAsSet, final /*@NonInvalid*/ Object _1) { + if (_1 == null) { + throw new InvalidValueException("Null \'\'OclElement\'\' rather than \'\'OclVoid\'\' value required"); + } + final /*@Thrown*/ Object oclContainer_3 = ClassifierOclContainerOperation.INSTANCE.evaluate(executor, _1); + return oclContainer_3; + } + }; + final ExecutorSingleIterationManager MGR_closure_0 = new ExecutorSingleIterationManager(executor, tdlTables.SET_CLSSid_OclElement, BODY_closure_0, oclAsSet, ACC_closure_0); + final /*@Thrown*/ SetValue closure = (SetValue)IMPL_closure_0.evaluateIteration(MGR_closure_0); + /*@Thrown*/ Accumulator accumulator = ValueUtil.createSetAccumulatorValue(tdlTables.SET_CLSSid_OclElement); + Iterator ITERATOR_c = closure.iterator(); + /*@Thrown*/ SetValue select; + while (true) { + if (!ITERATOR_c.hasNext()) { + select = accumulator; + break; + } + /*@NonInvalid*/ Object c = (Object)ITERATOR_c.next(); + /** + * c.oclIsKindOf(NamedElement) + */ + final /*@Thrown*/ boolean oclIsKindOf_0 = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, c, TYP_tdl_c_c_NamedElement_0).booleanValue(); + // + if (oclIsKindOf_0 == ValueUtil.TRUE_VALUE) { + accumulator.add(c); + } + } + final /*@Thrown*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(select); + final /*@Thrown*/ Object first = OrderedCollectionFirstOperation.INSTANCE.evaluate(asOrderedSet); + final /*@Thrown*/ NamedElement oclAsType_1 = (NamedElement)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, first, TYP_tdl_c_c_NamedElement_0); + final /*@Thrown*/ String qualifiedName_0 = oclAsType_1.getQualifiedName(); + final /*@Thrown*/ String sum_1 = StringConcatOperation.INSTANCE.evaluate(qualifiedName_0, tdlTables.STR__c_c); + final /*@Thrown*/ String sum_2 = StringConcatOperation.INSTANCE.evaluate(sum_1, name_2); + local_0 = sum_2; + } + local_1 = local_0; + } + else { + local_1 = name_2; + } + local_2 = local_1; + } + if (local_2 == null) { + throw new InvalidValueException("Null body for \'tdl::NamedElement::qualifiedName\'"); + } + return local_2; } /** @@ -73,8 +217,7 @@ public abstract class NamedElementImpl extends ElementImpl implements NamedEleme @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.NAMED_ELEMENT__QUALIFIED_NAME: return getQualifiedName(); } @@ -89,10 +232,9 @@ public abstract class NamedElementImpl extends ElementImpl implements NamedEleme @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.NAMED_ELEMENT__QUALIFIED_NAME: - return QUALIFIED_NAME__ESETTING_DELEGATE.dynamicIsSet(this, null, 0); + return QUALIFIED_NAME_EDEFAULT == null ? getQualifiedName() != null : !QUALIFIED_NAME_EDEFAULT.equals(getQualifiedName()); } return super.eIsSet(featureID); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/PackageImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/PackageImpl.java index 7686ed48..49b7eeb2 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/PackageImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/PackageImpl.java @@ -94,8 +94,7 @@ public class PackageImpl extends NamedElementImpl implements org.etsi.mts.tdl.Pa @Override public EList getPackagedElement() { - if (packagedElement == null) - { + if (packagedElement == null) { packagedElement = new EObjectContainmentEList(PackageableElement.class, this, tdlPackage.PACKAGE__PACKAGED_ELEMENT); } return packagedElement; @@ -109,8 +108,7 @@ public class PackageImpl extends NamedElementImpl implements org.etsi.mts.tdl.Pa @Override public EList getImport() { - if (import_ == null) - { + if (import_ == null) { import_ = new EObjectContainmentEList(ElementImport.class, this, tdlPackage.PACKAGE__IMPORT); } return import_; @@ -124,8 +122,7 @@ public class PackageImpl extends NamedElementImpl implements org.etsi.mts.tdl.Pa @Override public EList getNestedPackage() { - if (nestedPackage == null) - { + if (nestedPackage == null) { nestedPackage = new EObjectContainmentEList(org.etsi.mts.tdl.Package.class, this, tdlPackage.PACKAGE__NESTED_PACKAGE); } return nestedPackage; @@ -139,8 +136,7 @@ public class PackageImpl extends NamedElementImpl implements org.etsi.mts.tdl.Pa @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PACKAGE__PACKAGED_ELEMENT: return ((InternalEList)getPackagedElement()).basicRemove(otherEnd, msgs); case tdlPackage.PACKAGE__IMPORT: @@ -159,8 +155,7 @@ public class PackageImpl extends NamedElementImpl implements org.etsi.mts.tdl.Pa @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PACKAGE__PACKAGED_ELEMENT: return getPackagedElement(); case tdlPackage.PACKAGE__IMPORT: @@ -180,8 +175,7 @@ public class PackageImpl extends NamedElementImpl implements org.etsi.mts.tdl.Pa @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PACKAGE__PACKAGED_ELEMENT: getPackagedElement().clear(); getPackagedElement().addAll((Collection)newValue); @@ -206,8 +200,7 @@ public class PackageImpl extends NamedElementImpl implements org.etsi.mts.tdl.Pa @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PACKAGE__PACKAGED_ELEMENT: getPackagedElement().clear(); return; @@ -229,8 +222,7 @@ public class PackageImpl extends NamedElementImpl implements org.etsi.mts.tdl.Pa @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PACKAGE__PACKAGED_ELEMENT: return packagedElement != null && !packagedElement.isEmpty(); case tdlPackage.PACKAGE__IMPORT: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/PackageableElementImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/PackageableElementImpl.java index 3b96ccc2..6132df86 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/PackageableElementImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/PackageableElementImpl.java @@ -4,15 +4,34 @@ package org.etsi.mts.tdl.impl; import java.lang.reflect.InvocationTargetException; -import org.eclipse.emf.common.util.BasicEList; +import java.util.Iterator; +import java.util.List; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; - +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.library.classifier.ClassifierAllInstancesOperation; +import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; +import org.eclipse.ocl.pivot.library.collection.OrderedCollectionFirstOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsTypeOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsKindOfOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclTypeOperation; +import org.eclipse.ocl.pivot.messages.PivotMessages; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SetValue; +import org.eclipse.ocl.pivot.values.SetValue.Accumulator; +import org.etsi.mts.tdl.AnnotationType; +import org.etsi.mts.tdl.ComponentType; +import org.etsi.mts.tdl.Extension; +import org.etsi.mts.tdl.GateType; import org.etsi.mts.tdl.PackageableElement; +import org.etsi.mts.tdl.SimpleDataType; +import org.etsi.mts.tdl.StructuredDataType; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -44,88 +63,430 @@ public abstract class PackageableElementImpl extends NamedElementImpl implements return tdlPackage.Literals.PACKAGEABLE_ELEMENT; } - /** - * The cached invocation delegate for the '{@link #conformsTo(java.lang.String) Conforms To}' operation. - * - * - * @see #conformsTo(java.lang.String) - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate CONFORMS_TO_STRING__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.PACKAGEABLE_ELEMENT___CONFORMS_TO__STRING).getInvocationDelegate(); - /** * * * @generated */ @Override - public Boolean conformsTo(String n) + public Boolean conformsTo(final String n) { - try - { - return (Boolean)CONFORMS_TO_STRING__EINVOCATION_DELEGATE.dynamicInvoke(this, new BasicEList.UnmodifiableEList(1, new Object[]{n})); + /** + * + * if self.getElementNamed(n).oclIsUndefined() + * then false + * else self.conformsTo(self.getElementNamed(n)) + * endif + */ + /*@Caught*/ Object CAUGHT_getElementNamed; + try { + final /*@Thrown*/ PackageableElement getElementNamed = this.getElementNamed(n); + CAUGHT_getElementNamed = getElementNamed; + } + catch (Exception e) { + CAUGHT_getElementNamed = ValueUtil.createInvalidValue(e); } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + final /*@NonInvalid*/ boolean oclIsUndefined = CAUGHT_getElementNamed instanceof InvalidValueException; + /*@Thrown*/ boolean local_0; + if (oclIsUndefined) { + local_0 = false; } + else { + final /*@Thrown*/ PackageableElement getElementNamed_0 = this.getElementNamed(n); + final /*@Thrown*/ boolean conformsTo = this.conformsTo(getElementNamed_0); + local_0 = conformsTo; + } + return local_0; } - /** - * The cached invocation delegate for the '{@link #getElementNamed(java.lang.String) Get Element Named}' operation. - * - * - * @see #getElementNamed(java.lang.String) - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate GET_ELEMENT_NAMED_STRING__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.PACKAGEABLE_ELEMENT___GET_ELEMENT_NAMED__STRING).getInvocationDelegate(); - /** * * * @generated */ @Override - public PackageableElement getElementNamed(String n) + public PackageableElement getElementNamed(final String n) { - try - { - return (PackageableElement)GET_ELEMENT_NAMED_STRING__EINVOCATION_DELEGATE.dynamicInvoke(this, new BasicEList.UnmodifiableEList(1, new Object[]{n})); - } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + /** + * + * self.oclType() + * .allInstances() + * ->select(e | e.name = n) + * ->asOrderedSet() + * ->first() + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class oclType = (org.eclipse.ocl.pivot.Class)OclAnyOclTypeOperation.INSTANCE.evaluate(executor, this); + final /*@NonInvalid*/ SetValue allInstances = ClassifierAllInstancesOperation.INSTANCE.evaluate(executor, tdlTables.SET_CLSSid_PackageableElement, oclType); + /*@Thrown*/ Accumulator accumulator = ValueUtil.createSetAccumulatorValue(tdlTables.SET_CLSSid_PackageableElement); + Iterator ITERATOR_e_1 = allInstances.iterator(); + /*@NonInvalid*/ SetValue select; + while (true) { + if (!ITERATOR_e_1.hasNext()) { + select = accumulator; + break; + } + /*@NonInvalid*/ PackageableElement e_1 = (PackageableElement)ITERATOR_e_1.next(); + /** + * e.name = n + */ + final /*@NonInvalid*/ String name = e_1.getName(); + final /*@NonInvalid*/ boolean eq = (name != null) ? name.equals(n) : (n == null); + // + if (eq) { + accumulator.add(e_1); + } } + final /*@NonInvalid*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(select); + final /*@Thrown*/ PackageableElement first = (PackageableElement)OrderedCollectionFirstOperation.INSTANCE.evaluate(asOrderedSet); + return first; } - /** - * The cached invocation delegate for the '{@link #conformsTo(org.etsi.mts.tdl.PackageableElement) Conforms To}' operation. - * - * - * @see #conformsTo(org.etsi.mts.tdl.PackageableElement) - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate CONFORMS_TO_PACKAGEABLE_ELEMENT__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.PACKAGEABLE_ELEMENT___CONFORMS_TO__PACKAGEABLEELEMENT).getInvocationDelegate(); - /** * * * @generated */ @Override - public Boolean conformsTo(PackageableElement n) + public Boolean conformsTo(final PackageableElement n) { - try - { - return (Boolean)CONFORMS_TO_PACKAGEABLE_ELEMENT__EINVOCATION_DELEGATE.dynamicInvoke(this, new BasicEList.UnmodifiableEList(1, new Object[]{n})); + /** + * + * if self = n + * then true + * else + * if + * self.oclIsKindOf(AnnotationType) and + * not self.oclAsType(AnnotationType) + * .extension.oclIsUndefined() + * then self.oclAsType(AnnotationType).extension.isExtending(n) + * else + * if + * self.oclIsKindOf(ComponentType) and + * not self.oclAsType(ComponentType) + * .extension.oclIsUndefined() + * then self.oclAsType(ComponentType).extension.isExtending(n) + * else + * if + * self.oclIsKindOf(GateType) and + * not self.oclAsType(GateType) + * .extension.oclIsUndefined() + * then self.oclAsType(GateType).extension.isExtending(n) + * else + * if self.oclIsKindOf(StructuredDataType) + * then + * self.oclAsType(StructuredDataType) + * .extension->exists(ex | ex.isExtending(n)) + * else + * if + * self.oclIsKindOf(SimpleDataType) and + * not self.oclAsType(SimpleDataType) + * .extension.oclIsUndefined() + * then + * self.oclAsType(SimpleDataType) + * .extension.isExtending(n) + * else false + * endif + * endif + * endif + * endif + * endif + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ boolean eq = this.equals(n); + /*@Thrown*/ Boolean local_5; + if (eq) { + local_5 = ValueUtil.TRUE_VALUE; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_AnnotationType_0 = idResolver.getClass(tdlTables.CLSSid_AnnotationType, null); + final /*@NonInvalid*/ boolean oclIsKindOf = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_AnnotationType_0).booleanValue(); + final /*@Thrown*/ Boolean and; + if (!oclIsKindOf) { + and = ValueUtil.FALSE_VALUE; + } + else { + /*@Caught*/ Object CAUGHT_extension; + try { + final /*@Thrown*/ AnnotationType oclAsType = (AnnotationType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_AnnotationType_0); + final /*@Thrown*/ Extension extension = oclAsType.getExtension(); + CAUGHT_extension = extension; + } + catch (Exception e) { + CAUGHT_extension = ValueUtil.createInvalidValue(e); + } + final /*@NonInvalid*/ boolean oclIsUndefined = (CAUGHT_extension == null) || (CAUGHT_extension instanceof InvalidValueException); + final /*@NonInvalid*/ Boolean not; + if (!oclIsUndefined) { + not = ValueUtil.TRUE_VALUE; + } + else { + if (oclIsUndefined) { + not = ValueUtil.FALSE_VALUE; + } + else { + not = null; + } + } + if (not == ValueUtil.FALSE_VALUE) { + and = ValueUtil.FALSE_VALUE; + } + else { + if (not == null) { + and = null; + } + else { + and = ValueUtil.TRUE_VALUE; + } + } + } + if (and == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ Boolean local_4; + if (and) { + final /*@Thrown*/ AnnotationType oclAsType_0 = (AnnotationType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_AnnotationType_0); + final /*@Thrown*/ Extension extension_0 = oclAsType_0.getExtension(); + if (extension_0 == null) { + throw new InvalidValueException("Null source for \'tdl::Extension::isExtending(tdl::PackageableElement[?]) : Boolean[?]\'"); + } + final /*@Thrown*/ boolean isExtending = extension_0.isExtending(n); + local_4 = isExtending; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_ComponentType_0 = idResolver.getClass(tdlTables.CLSSid_ComponentType, null); + final /*@NonInvalid*/ boolean oclIsKindOf_0 = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_ComponentType_0).booleanValue(); + final /*@Thrown*/ Boolean and_0; + if (!oclIsKindOf_0) { + and_0 = ValueUtil.FALSE_VALUE; + } + else { + /*@Caught*/ Object CAUGHT_extension_1; + try { + final /*@Thrown*/ ComponentType oclAsType_1 = (ComponentType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_ComponentType_0); + final /*@Thrown*/ Extension extension_1 = oclAsType_1.getExtension(); + CAUGHT_extension_1 = extension_1; + } + catch (Exception e) { + CAUGHT_extension_1 = ValueUtil.createInvalidValue(e); + } + final /*@NonInvalid*/ boolean oclIsUndefined_0 = (CAUGHT_extension_1 == null) || (CAUGHT_extension_1 instanceof InvalidValueException); + final /*@NonInvalid*/ Boolean not_0; + if (!oclIsUndefined_0) { + not_0 = ValueUtil.TRUE_VALUE; + } + else { + if (oclIsUndefined_0) { + not_0 = ValueUtil.FALSE_VALUE; + } + else { + not_0 = null; + } + } + if (not_0 == ValueUtil.FALSE_VALUE) { + and_0 = ValueUtil.FALSE_VALUE; + } + else { + if (not_0 == null) { + and_0 = null; + } + else { + and_0 = ValueUtil.TRUE_VALUE; + } + } + } + if (and_0 == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ Boolean local_3; + if (and_0) { + final /*@Thrown*/ ComponentType oclAsType_2 = (ComponentType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_ComponentType_0); + final /*@Thrown*/ Extension extension_2 = oclAsType_2.getExtension(); + if (extension_2 == null) { + throw new InvalidValueException("Null source for \'tdl::Extension::isExtending(tdl::PackageableElement[?]) : Boolean[?]\'"); + } + final /*@Thrown*/ boolean isExtending_0 = extension_2.isExtending(n); + local_3 = isExtending_0; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_GateType_0 = idResolver.getClass(tdlTables.CLSSid_GateType, null); + final /*@NonInvalid*/ boolean oclIsKindOf_1 = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_GateType_0).booleanValue(); + final /*@Thrown*/ Boolean and_1; + if (!oclIsKindOf_1) { + and_1 = ValueUtil.FALSE_VALUE; + } + else { + /*@Caught*/ Object CAUGHT_extension_3; + try { + final /*@Thrown*/ GateType oclAsType_3 = (GateType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_GateType_0); + final /*@Thrown*/ Extension extension_3 = oclAsType_3.getExtension(); + CAUGHT_extension_3 = extension_3; + } + catch (Exception e) { + CAUGHT_extension_3 = ValueUtil.createInvalidValue(e); + } + final /*@NonInvalid*/ boolean oclIsUndefined_1 = (CAUGHT_extension_3 == null) || (CAUGHT_extension_3 instanceof InvalidValueException); + final /*@NonInvalid*/ Boolean not_1; + if (!oclIsUndefined_1) { + not_1 = ValueUtil.TRUE_VALUE; + } + else { + if (oclIsUndefined_1) { + not_1 = ValueUtil.FALSE_VALUE; + } + else { + not_1 = null; + } + } + if (not_1 == ValueUtil.FALSE_VALUE) { + and_1 = ValueUtil.FALSE_VALUE; + } + else { + if (not_1 == null) { + and_1 = null; + } + else { + and_1 = ValueUtil.TRUE_VALUE; + } + } + } + if (and_1 == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ Boolean local_2; + if (and_1) { + final /*@Thrown*/ GateType oclAsType_4 = (GateType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_GateType_0); + final /*@Thrown*/ Extension extension_4 = oclAsType_4.getExtension(); + if (extension_4 == null) { + throw new InvalidValueException("Null source for \'tdl::Extension::isExtending(tdl::PackageableElement[?]) : Boolean[?]\'"); + } + final /*@Thrown*/ boolean isExtending_1 = extension_4.isExtending(n); + local_2 = isExtending_1; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_StructuredDataType_0 = idResolver.getClass(tdlTables.CLSSid_StructuredDataType, null); + final /*@NonInvalid*/ boolean oclIsKindOf_2 = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_StructuredDataType_0).booleanValue(); + /*@Thrown*/ Boolean local_1; + if (oclIsKindOf_2) { + final /*@Thrown*/ StructuredDataType oclAsType_5 = (StructuredDataType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_StructuredDataType_0); + final /*@Thrown*/ List extension_5 = oclAsType_5.getExtension(); + final /*@Thrown*/ OrderedSetValue BOXED_extension_5 = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_Extension, extension_5); + /*@Thrown*/ Object accumulator = ValueUtil.FALSE_VALUE; + Iterator ITERATOR_ex = BOXED_extension_5.iterator(); + /*@Thrown*/ Boolean exists; + while (true) { + if (!ITERATOR_ex.hasNext()) { + if (accumulator == ValueUtil.FALSE_VALUE) { + exists = ValueUtil.FALSE_VALUE; + } + else { + throw (InvalidValueException)accumulator; + } + break; + } + /*@NonInvalid*/ Extension ex = (Extension)ITERATOR_ex.next(); + /** + * ex.isExtending(n) + */ + /*@Caught*/ Object CAUGHT_isExtending_2; + try { + if (ex == null) { + throw new InvalidValueException("Null source for \'tdl::Extension::isExtending(tdl::PackageableElement[?]) : Boolean[?]\'"); + } + final /*@Thrown*/ boolean isExtending_2 = ex.isExtending(n); + CAUGHT_isExtending_2 = isExtending_2; + } + catch (Exception e) { + CAUGHT_isExtending_2 = ValueUtil.createInvalidValue(e); + } + // + if (CAUGHT_isExtending_2 == ValueUtil.TRUE_VALUE) { // Normal successful body evaluation result + exists = ValueUtil.TRUE_VALUE; + break; // Stop immediately + } + else if (CAUGHT_isExtending_2 == ValueUtil.FALSE_VALUE) { // Normal unsuccessful body evaluation result + ; // Carry on + } + else if (CAUGHT_isExtending_2 instanceof InvalidValueException) { // Abnormal exception evaluation result + accumulator = CAUGHT_isExtending_2; // Cache an exception failure + } + else { // Impossible badly typed result + accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "exists"); + } + } + local_1 = exists; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_SimpleDataType_0 = idResolver.getClass(tdlTables.CLSSid_SimpleDataType, null); + final /*@NonInvalid*/ boolean oclIsKindOf_3 = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_SimpleDataType_0).booleanValue(); + final /*@Thrown*/ Boolean and_2; + if (!oclIsKindOf_3) { + and_2 = ValueUtil.FALSE_VALUE; + } + else { + /*@Caught*/ Object CAUGHT_extension_6; + try { + final /*@Thrown*/ SimpleDataType oclAsType_6 = (SimpleDataType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_SimpleDataType_0); + final /*@Thrown*/ Extension extension_6 = oclAsType_6.getExtension(); + CAUGHT_extension_6 = extension_6; + } + catch (Exception e) { + CAUGHT_extension_6 = ValueUtil.createInvalidValue(e); + } + final /*@NonInvalid*/ boolean oclIsUndefined_2 = (CAUGHT_extension_6 == null) || (CAUGHT_extension_6 instanceof InvalidValueException); + final /*@NonInvalid*/ Boolean not_2; + if (!oclIsUndefined_2) { + not_2 = ValueUtil.TRUE_VALUE; + } + else { + if (oclIsUndefined_2) { + not_2 = ValueUtil.FALSE_VALUE; + } + else { + not_2 = null; + } + } + if (not_2 == ValueUtil.FALSE_VALUE) { + and_2 = ValueUtil.FALSE_VALUE; + } + else { + if (not_2 == null) { + and_2 = null; + } + else { + and_2 = ValueUtil.TRUE_VALUE; + } + } + } + if (and_2 == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ boolean local_0; + if (and_2) { + final /*@Thrown*/ SimpleDataType oclAsType_7 = (SimpleDataType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_SimpleDataType_0); + final /*@Thrown*/ Extension extension_7 = oclAsType_7.getExtension(); + if (extension_7 == null) { + throw new InvalidValueException("Null source for \'tdl::Extension::isExtending(tdl::PackageableElement[?]) : Boolean[?]\'"); + } + final /*@Thrown*/ boolean isExtending_3 = extension_7.isExtending(n); + local_0 = isExtending_3; + } + else { + local_0 = false; + } + local_1 = local_0; + } + local_2 = local_1; + } + local_3 = local_2; + } + local_4 = local_3; + } + local_5 = local_4; } + return local_5; } /** @@ -136,8 +497,7 @@ public abstract class PackageableElementImpl extends NamedElementImpl implements @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.PACKAGEABLE_ELEMENT___CONFORMS_TO__STRING: return conformsTo((String)arguments.get(0)); case tdlPackage.PACKAGEABLE_ELEMENT___GET_ELEMENT_NAMED__STRING: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ParameterBindingImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ParameterBindingImpl.java index 1a4aac30..6d48bab4 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ParameterBindingImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ParameterBindingImpl.java @@ -6,14 +6,12 @@ import java.lang.reflect.InvocationTargetException; import java.util.Collection; +import java.util.List; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; @@ -21,12 +19,24 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.library.collection.CollectionIsEmptyOperation; +import org.eclipse.ocl.pivot.library.collection.OrderedCollectionLastOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsTypeOperation; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.etsi.mts.tdl.CollectionDataType; import org.etsi.mts.tdl.DataType; import org.etsi.mts.tdl.DataUse; +import org.etsi.mts.tdl.Member; import org.etsi.mts.tdl.MemberReference; import org.etsi.mts.tdl.Parameter; import org.etsi.mts.tdl.ParameterBinding; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -116,8 +126,7 @@ public class ParameterBindingImpl extends ElementImpl implements ParameterBindin { DataUse oldDataUse = dataUse; dataUse = newDataUse; - if (eNotificationRequired()) - { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, tdlPackage.PARAMETER_BINDING__DATA_USE, oldDataUse, newDataUse); if (msgs == null) msgs = notification; else msgs.add(notification); } @@ -132,8 +141,7 @@ public class ParameterBindingImpl extends ElementImpl implements ParameterBindin @Override public void setDataUse(DataUse newDataUse) { - if (newDataUse != dataUse) - { + if (newDataUse != dataUse) { NotificationChain msgs = null; if (dataUse != null) msgs = ((InternalEObject)dataUse).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - tdlPackage.PARAMETER_BINDING__DATA_USE, null, msgs); @@ -154,12 +162,10 @@ public class ParameterBindingImpl extends ElementImpl implements ParameterBindin @Override public Parameter getParameter() { - if (parameter != null && parameter.eIsProxy()) - { + if (parameter != null && parameter.eIsProxy()) { InternalEObject oldParameter = (InternalEObject)parameter; parameter = (Parameter)eResolveProxy(oldParameter); - if (parameter != oldParameter) - { + if (parameter != oldParameter) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.PARAMETER_BINDING__PARAMETER, oldParameter, parameter)); } @@ -199,23 +205,12 @@ public class ParameterBindingImpl extends ElementImpl implements ParameterBindin @Override public EList getReduction() { - if (reduction == null) - { + if (reduction == null) { reduction = new EObjectContainmentEList(MemberReference.class, this, tdlPackage.PARAMETER_BINDING__REDUCTION); } return reduction; } - /** - * The cached invocation delegate for the '{@link #resolveParameterType() Resolve Parameter Type}' operation. - * - * - * @see #resolveParameterType() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate RESOLVE_PARAMETER_TYPE__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.PARAMETER_BINDING___RESOLVE_PARAMETER_TYPE).getInvocationDelegate(); - /** * * @@ -224,14 +219,91 @@ public class ParameterBindingImpl extends ElementImpl implements ParameterBindin @Override public DataType resolveParameterType() { - try - { - return (DataType)RESOLVE_PARAMETER_TYPE__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if self.reduction->isEmpty() + * then self.parameter.dataType + * else + * if self.reduction->last().member.oclIsUndefined() + * then + * if self.reduction->last().collectionIndex.oclIsUndefined() + * then self.parameter.dataType + * else + * self.parameter.dataType.oclAsType(CollectionDataType).itemType + * endif + * else self.reduction->last().member.dataType + * endif + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ List reduction = this.getReduction(); + final /*@NonInvalid*/ OrderedSetValue BOXED_reduction = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_MemberReference, reduction); + final /*@NonInvalid*/ boolean isEmpty = CollectionIsEmptyOperation.INSTANCE.evaluate(BOXED_reduction).booleanValue(); + /*@Thrown*/ DataType local_2; + if (isEmpty) { + final /*@NonInvalid*/ Parameter parameter = this.getParameter(); + final /*@NonInvalid*/ DataType dataType = parameter.getDataType(); + local_2 = dataType; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + /*@Caught*/ Object CAUGHT_member; + try { + final /*@Thrown*/ MemberReference last = (MemberReference)OrderedCollectionLastOperation.INSTANCE.evaluate(BOXED_reduction); + if (last == null) { + throw new InvalidValueException("Null source for \'\'http://www.etsi.org/spec/TDL/1.4.1\'::MemberReference::member\'"); + } + final /*@Thrown*/ Member member = last.getMember(); + CAUGHT_member = member; + } + catch (Exception e) { + CAUGHT_member = ValueUtil.createInvalidValue(e); + } + final /*@NonInvalid*/ boolean oclIsUndefined = (CAUGHT_member == null) || (CAUGHT_member instanceof InvalidValueException); + /*@Thrown*/ DataType local_1; + if (oclIsUndefined) { + final /*@NonInvalid*/ Parameter parameter_0 = this.getParameter(); + final /*@NonInvalid*/ DataType dataType_0 = parameter_0.getDataType(); + /*@Caught*/ Object CAUGHT_collectionIndex; + try { + final /*@Thrown*/ MemberReference last_0 = (MemberReference)OrderedCollectionLastOperation.INSTANCE.evaluate(BOXED_reduction); + if (last_0 == null) { + throw new InvalidValueException("Null source for \'\'http://www.etsi.org/spec/TDL/1.4.1\'::MemberReference::collectionIndex\'"); + } + final /*@Thrown*/ DataUse collectionIndex = last_0.getCollectionIndex(); + CAUGHT_collectionIndex = collectionIndex; + } + catch (Exception e) { + CAUGHT_collectionIndex = ValueUtil.createInvalidValue(e); + } + final /*@NonInvalid*/ boolean oclIsUndefined_0 = (CAUGHT_collectionIndex == null) || (CAUGHT_collectionIndex instanceof InvalidValueException); + /*@Thrown*/ DataType local_0; + if (oclIsUndefined_0) { + local_0 = dataType_0; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_CollectionDataType_0 = idResolver.getClass(tdlTables.CLSSid_CollectionDataType, null); + final /*@Thrown*/ CollectionDataType oclAsType = (CollectionDataType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, dataType_0, TYP_tdl_c_c_CollectionDataType_0); + final /*@Thrown*/ DataType itemType = oclAsType.getItemType(); + local_0 = itemType; + } + local_1 = local_0; + } + else { + final /*@Thrown*/ MemberReference last_1 = (MemberReference)OrderedCollectionLastOperation.INSTANCE.evaluate(BOXED_reduction); + if (last_1 == null) { + throw new InvalidValueException("Null source for \'\'http://www.etsi.org/spec/TDL/1.4.1\'::MemberReference::member\'"); + } + final /*@Thrown*/ Member member_0 = last_1.getMember(); + if (member_0 == null) { + throw new InvalidValueException("Null source for \'\'http://www.etsi.org/spec/TDL/1.4.1\'::Parameter::dataType\'"); + } + final /*@Thrown*/ DataType dataType_2 = member_0.getDataType(); + local_1 = dataType_2; + } + local_2 = local_1; } + return local_2; } /** @@ -242,8 +314,7 @@ public class ParameterBindingImpl extends ElementImpl implements ParameterBindin @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PARAMETER_BINDING__DATA_USE: return basicSetDataUse(null, msgs); case tdlPackage.PARAMETER_BINDING__REDUCTION: @@ -260,8 +331,7 @@ public class ParameterBindingImpl extends ElementImpl implements ParameterBindin @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PARAMETER_BINDING__DATA_USE: return getDataUse(); case tdlPackage.PARAMETER_BINDING__PARAMETER: @@ -282,8 +352,7 @@ public class ParameterBindingImpl extends ElementImpl implements ParameterBindin @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PARAMETER_BINDING__DATA_USE: setDataUse((DataUse)newValue); return; @@ -306,8 +375,7 @@ public class ParameterBindingImpl extends ElementImpl implements ParameterBindin @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PARAMETER_BINDING__DATA_USE: setDataUse((DataUse)null); return; @@ -329,8 +397,7 @@ public class ParameterBindingImpl extends ElementImpl implements ParameterBindin @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PARAMETER_BINDING__DATA_USE: return dataUse != null; case tdlPackage.PARAMETER_BINDING__PARAMETER: @@ -349,8 +416,7 @@ public class ParameterBindingImpl extends ElementImpl implements ParameterBindin @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.PARAMETER_BINDING___RESOLVE_PARAMETER_TYPE: return resolveParameterType(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ParameterImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ParameterImpl.java index 860f947f..35e9b03e 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ParameterImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ParameterImpl.java @@ -67,12 +67,10 @@ public abstract class ParameterImpl extends NamedElementImpl implements Paramete @Override public DataType getDataType() { - if (dataType != null && dataType.eIsProxy()) - { + if (dataType != null && dataType.eIsProxy()) { InternalEObject oldDataType = (InternalEObject)dataType; dataType = (DataType)eResolveProxy(oldDataType); - if (dataType != oldDataType) - { + if (dataType != oldDataType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.PARAMETER__DATA_TYPE, oldDataType, dataType)); } @@ -112,8 +110,7 @@ public abstract class ParameterImpl extends NamedElementImpl implements Paramete @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PARAMETER__DATA_TYPE: if (resolve) return getDataType(); return basicGetDataType(); @@ -129,8 +126,7 @@ public abstract class ParameterImpl extends NamedElementImpl implements Paramete @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PARAMETER__DATA_TYPE: setDataType((DataType)newValue); return; @@ -146,8 +142,7 @@ public abstract class ParameterImpl extends NamedElementImpl implements Paramete @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PARAMETER__DATA_TYPE: setDataType((DataType)null); return; @@ -163,8 +158,7 @@ public abstract class ParameterImpl extends NamedElementImpl implements Paramete @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PARAMETER__DATA_TYPE: return dataType != null; } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ParameterMappingImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ParameterMappingImpl.java index 1b5caebe..85414007 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ParameterMappingImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ParameterMappingImpl.java @@ -113,12 +113,10 @@ public class ParameterMappingImpl extends ElementImpl implements ParameterMappin @Override public Parameter getParameter() { - if (parameter != null && parameter.eIsProxy()) - { + if (parameter != null && parameter.eIsProxy()) { InternalEObject oldParameter = (InternalEObject)parameter; parameter = (Parameter)eResolveProxy(oldParameter); - if (parameter != oldParameter) - { + if (parameter != oldParameter) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.PARAMETER_MAPPING__PARAMETER, oldParameter, parameter)); } @@ -158,8 +156,7 @@ public class ParameterMappingImpl extends ElementImpl implements ParameterMappin @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PARAMETER_MAPPING__PARAMETER_URI: return getParameterURI(); case tdlPackage.PARAMETER_MAPPING__PARAMETER: @@ -177,8 +174,7 @@ public class ParameterMappingImpl extends ElementImpl implements ParameterMappin @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PARAMETER_MAPPING__PARAMETER_URI: setParameterURI((String)newValue); return; @@ -197,8 +193,7 @@ public class ParameterMappingImpl extends ElementImpl implements ParameterMappin @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PARAMETER_MAPPING__PARAMETER_URI: setParameterURI(PARAMETER_URI_EDEFAULT); return; @@ -217,8 +212,7 @@ public class ParameterMappingImpl extends ElementImpl implements ParameterMappin @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PARAMETER_MAPPING__PARAMETER_URI: return PARAMETER_URI_EDEFAULT == null ? parameterURI != null : !PARAMETER_URI_EDEFAULT.equals(parameterURI); case tdlPackage.PARAMETER_MAPPING__PARAMETER: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/PeriodicBehaviourImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/PeriodicBehaviourImpl.java index d3b8472c..73586a0b 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/PeriodicBehaviourImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/PeriodicBehaviourImpl.java @@ -6,14 +6,13 @@ import java.lang.reflect.InvocationTargetException; import java.util.Collection; +import java.util.Iterator; +import java.util.List; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; @@ -21,12 +20,26 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.ids.IdResolver.IdResolverExtension; +import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsSetOperation; +import org.eclipse.ocl.pivot.messages.PivotMessages; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SetValue; import org.etsi.mts.tdl.Behaviour; import org.etsi.mts.tdl.Block; import org.etsi.mts.tdl.ComponentInstance; import org.etsi.mts.tdl.LocalExpression; import org.etsi.mts.tdl.PeriodicBehaviour; +import org.etsi.mts.tdl.TestConfiguration; +import org.etsi.mts.tdl.TestDescription; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -105,8 +118,7 @@ public class PeriodicBehaviourImpl extends BehaviourImpl implements PeriodicBeha { Block oldBlock = block; block = newBlock; - if (eNotificationRequired()) - { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, tdlPackage.PERIODIC_BEHAVIOUR__BLOCK, oldBlock, newBlock); if (msgs == null) msgs = notification; else msgs.add(notification); } @@ -121,8 +133,7 @@ public class PeriodicBehaviourImpl extends BehaviourImpl implements PeriodicBeha @Override public void setBlock(Block newBlock) { - if (newBlock != block) - { + if (newBlock != block) { NotificationChain msgs = null; if (block != null) msgs = ((InternalEObject)block).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - tdlPackage.PERIODIC_BEHAVIOUR__BLOCK, null, msgs); @@ -143,23 +154,12 @@ public class PeriodicBehaviourImpl extends BehaviourImpl implements PeriodicBeha @Override public EList getPeriod() { - if (period == null) - { + if (period == null) { period = new EObjectContainmentEList(LocalExpression.class, this, tdlPackage.PERIODIC_BEHAVIOUR__PERIOD); } return period; } - /** - * The cached invocation delegate for the '{@link #getParticipatingComponents() Get Participating Components}' operation. - * - * - * @see #getParticipatingComponents() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.PERIODIC_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS).getInvocationDelegate(); - /** * * @@ -169,14 +169,71 @@ public class PeriodicBehaviourImpl extends BehaviourImpl implements PeriodicBeha @Override public EList getParticipatingComponents() { - try - { - return (EList)GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if + * self.getParentTestDescription() + * ->exists(td | td.isLocallyOrdered) + * then self.block.getParticipatingComponents()->asOrderedSet() + * else + * self.getParentTestDescription() + * .testConfiguration.componentInstance->asOrderedSet() + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ TestDescription getParentTestDescription = this.getParentTestDescription(); + final /*@NonInvalid*/ SetValue oclAsSet = OclAnyOclAsSetOperation.INSTANCE.evaluate(executor, tdlTables.SET_CLSSid_TestDescription, getParentTestDescription); + /*@Thrown*/ Object accumulator = ValueUtil.FALSE_VALUE; + Iterator ITERATOR_td = oclAsSet.iterator(); + /*@NonInvalid*/ Boolean exists; + while (true) { + if (!ITERATOR_td.hasNext()) { + if (accumulator == ValueUtil.FALSE_VALUE) { + exists = ValueUtil.FALSE_VALUE; + } + else { + throw (InvalidValueException)accumulator; + } + break; + } + /*@NonInvalid*/ TestDescription td = (TestDescription)ITERATOR_td.next(); + /** + * td.isLocallyOrdered + */ + final /*@NonInvalid*/ boolean isLocallyOrdered = td.isIsLocallyOrdered(); + // + if (isLocallyOrdered) { // Normal successful body evaluation result + exists = ValueUtil.TRUE_VALUE; + break; // Stop immediately + } + else if (!isLocallyOrdered) { // Normal unsuccessful body evaluation result + ; // Carry on + } + else { // Impossible badly typed result + accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "exists"); + } + } + if (exists == null) { + throw new InvalidValueException("Null if condition"); + } + /*@NonInvalid*/ OrderedSetValue local_0; + if (exists) { + final /*@NonInvalid*/ Block block = this.getBlock(); + final /*@NonInvalid*/ List getParticipatingComponents = block.getParticipatingComponents(); + final /*@NonInvalid*/ OrderedSetValue BOXED_getParticipatingComponents = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_ComponentInstance, getParticipatingComponents); + final /*@NonInvalid*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(BOXED_getParticipatingComponents); + local_0 = asOrderedSet; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + final /*@NonInvalid*/ TestConfiguration testConfiguration = getParentTestDescription.getTestConfiguration(); + final /*@NonInvalid*/ List componentInstance = testConfiguration.getComponentInstance(); + final /*@NonInvalid*/ SetValue BOXED_componentInstance = idResolver.createSetOfAll(tdlTables.SET_CLSSid_ComponentInstance, componentInstance); + final /*@NonInvalid*/ OrderedSetValue asOrderedSet_0 = CollectionAsOrderedSetOperation.INSTANCE.evaluate(BOXED_componentInstance); + local_0 = asOrderedSet_0; } + final /*@NonInvalid*/ List ECORE_local_0 = ((IdResolverExtension)idResolver).ecoreValueOfAll(ComponentInstance.class, local_0); + return (EList)ECORE_local_0; } /** @@ -187,8 +244,7 @@ public class PeriodicBehaviourImpl extends BehaviourImpl implements PeriodicBeha @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PERIODIC_BEHAVIOUR__BLOCK: return basicSetBlock(null, msgs); case tdlPackage.PERIODIC_BEHAVIOUR__PERIOD: @@ -205,8 +261,7 @@ public class PeriodicBehaviourImpl extends BehaviourImpl implements PeriodicBeha @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PERIODIC_BEHAVIOUR__BLOCK: return getBlock(); case tdlPackage.PERIODIC_BEHAVIOUR__PERIOD: @@ -224,8 +279,7 @@ public class PeriodicBehaviourImpl extends BehaviourImpl implements PeriodicBeha @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PERIODIC_BEHAVIOUR__BLOCK: setBlock((Block)newValue); return; @@ -245,8 +299,7 @@ public class PeriodicBehaviourImpl extends BehaviourImpl implements PeriodicBeha @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PERIODIC_BEHAVIOUR__BLOCK: setBlock((Block)null); return; @@ -265,8 +318,7 @@ public class PeriodicBehaviourImpl extends BehaviourImpl implements PeriodicBeha @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PERIODIC_BEHAVIOUR__BLOCK: return block != null; case tdlPackage.PERIODIC_BEHAVIOUR__PERIOD: @@ -283,10 +335,8 @@ public class PeriodicBehaviourImpl extends BehaviourImpl implements PeriodicBeha @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == Behaviour.class) - { - switch (baseOperationID) - { + if (baseClass == Behaviour.class) { + switch (baseOperationID) { case tdlPackage.BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return tdlPackage.PERIODIC_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -302,8 +352,7 @@ public class PeriodicBehaviourImpl extends BehaviourImpl implements PeriodicBeha @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.PERIODIC_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return getParticipatingComponents(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/PredefinedFunctionCallImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/PredefinedFunctionCallImpl.java index c87fcacb..45601afb 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/PredefinedFunctionCallImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/PredefinedFunctionCallImpl.java @@ -6,14 +6,13 @@ import java.lang.reflect.InvocationTargetException; import java.util.Collection; +import java.util.Iterator; +import java.util.List; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; @@ -21,11 +20,22 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; +import org.eclipse.ocl.pivot.library.collection.OrderedCollectionFirstOperation; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SequenceValue; +import org.eclipse.ocl.pivot.values.SequenceValue.Accumulator; import org.etsi.mts.tdl.DataType; import org.etsi.mts.tdl.DataUse; import org.etsi.mts.tdl.PredefinedFunction; import org.etsi.mts.tdl.PredefinedFunctionCall; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -92,12 +102,10 @@ public class PredefinedFunctionCallImpl extends DynamicDataUseImpl implements Pr @Override public PredefinedFunction getFunction() { - if (function != null && function.eIsProxy()) - { + if (function != null && function.eIsProxy()) { InternalEObject oldFunction = (InternalEObject)function; function = (PredefinedFunction)eResolveProxy(oldFunction); - if (function != oldFunction) - { + if (function != oldFunction) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.PREDEFINED_FUNCTION_CALL__FUNCTION, oldFunction, function)); } @@ -137,23 +145,12 @@ public class PredefinedFunctionCallImpl extends DynamicDataUseImpl implements Pr @Override public EList getActualParameters() { - if (actualParameters == null) - { + if (actualParameters == null) { actualParameters = new EObjectContainmentEList(DataUse.class, this, tdlPackage.PREDEFINED_FUNCTION_CALL__ACTUAL_PARAMETERS); } return actualParameters; } - /** - * The cached invocation delegate for the '{@link #resolveDataType() Resolve Data Type}' operation. - * - * - * @see #resolveDataType() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate RESOLVE_DATA_TYPE__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.PREDEFINED_FUNCTION_CALL___RESOLVE_DATA_TYPE).getInvocationDelegate(); - /** * * @@ -162,14 +159,61 @@ public class PredefinedFunctionCallImpl extends DynamicDataUseImpl implements Pr @Override public DataType resolveDataType() { - try - { - return (DataType)RESOLVE_DATA_TYPE__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if not self.function.returnType.oclIsUndefined() + * then self.function.returnType + * else self.actualParameters.resolveDataType()->asOrderedSet()->first() + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ PredefinedFunction function_0 = this.getFunction(); + final /*@NonInvalid*/ DataType returnType_0 = function_0.getReturnType(); + final /*@NonInvalid*/ boolean oclIsUndefined = returnType_0 == null; + final /*@NonInvalid*/ Boolean not; + if (!oclIsUndefined) { + not = ValueUtil.TRUE_VALUE; + } + else { + if (oclIsUndefined) { + not = ValueUtil.FALSE_VALUE; + } + else { + not = null; + } } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + if (not == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ DataType local_0; + if (not) { + local_0 = returnType_0; + } + else { + final /*@NonInvalid*/ List actualParameters = this.getActualParameters(); + final /*@NonInvalid*/ OrderedSetValue BOXED_actualParameters = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_DataUse, actualParameters); + /*@Thrown*/ Accumulator accumulator = ValueUtil.createSequenceAccumulatorValue(tdlTables.SEQ_CLSSid_DataType); + Iterator ITERATOR__1 = BOXED_actualParameters.iterator(); + /*@NonInvalid*/ SequenceValue collect; + while (true) { + if (!ITERATOR__1.hasNext()) { + collect = accumulator; + break; + } + /*@NonInvalid*/ DataUse _1 = (DataUse)ITERATOR__1.next(); + /** + * resolveDataType() + */ + final /*@NonInvalid*/ DataType resolveDataType = _1.resolveDataType(); + // + accumulator.add(resolveDataType); + } + final /*@NonInvalid*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(collect); + final /*@Thrown*/ DataType first = (DataType)OrderedCollectionFirstOperation.INSTANCE.evaluate(asOrderedSet); + local_0 = first; } + return local_0; } /** @@ -180,8 +224,7 @@ public class PredefinedFunctionCallImpl extends DynamicDataUseImpl implements Pr @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PREDEFINED_FUNCTION_CALL__ACTUAL_PARAMETERS: return ((InternalEList)getActualParameters()).basicRemove(otherEnd, msgs); } @@ -196,8 +239,7 @@ public class PredefinedFunctionCallImpl extends DynamicDataUseImpl implements Pr @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PREDEFINED_FUNCTION_CALL__FUNCTION: if (resolve) return getFunction(); return basicGetFunction(); @@ -216,8 +258,7 @@ public class PredefinedFunctionCallImpl extends DynamicDataUseImpl implements Pr @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PREDEFINED_FUNCTION_CALL__FUNCTION: setFunction((PredefinedFunction)newValue); return; @@ -237,8 +278,7 @@ public class PredefinedFunctionCallImpl extends DynamicDataUseImpl implements Pr @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PREDEFINED_FUNCTION_CALL__FUNCTION: setFunction((PredefinedFunction)null); return; @@ -257,8 +297,7 @@ public class PredefinedFunctionCallImpl extends DynamicDataUseImpl implements Pr @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PREDEFINED_FUNCTION_CALL__FUNCTION: return function != null; case tdlPackage.PREDEFINED_FUNCTION_CALL__ACTUAL_PARAMETERS: @@ -275,10 +314,8 @@ public class PredefinedFunctionCallImpl extends DynamicDataUseImpl implements Pr @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == DataUse.class) - { - switch (baseOperationID) - { + if (baseClass == DataUse.class) { + switch (baseOperationID) { case tdlPackage.DATA_USE___RESOLVE_DATA_TYPE: return tdlPackage.PREDEFINED_FUNCTION_CALL___RESOLVE_DATA_TYPE; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -294,8 +331,7 @@ public class PredefinedFunctionCallImpl extends DynamicDataUseImpl implements Pr @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.PREDEFINED_FUNCTION_CALL___RESOLVE_DATA_TYPE: return resolveDataType(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/PredefinedFunctionImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/PredefinedFunctionImpl.java index ad22cf52..22ff4921 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/PredefinedFunctionImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/PredefinedFunctionImpl.java @@ -67,12 +67,10 @@ public class PredefinedFunctionImpl extends PackageableElementImpl implements Pr @Override public DataType getReturnType() { - if (returnType != null && returnType.eIsProxy()) - { + if (returnType != null && returnType.eIsProxy()) { InternalEObject oldReturnType = (InternalEObject)returnType; returnType = (DataType)eResolveProxy(oldReturnType); - if (returnType != oldReturnType) - { + if (returnType != oldReturnType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.PREDEFINED_FUNCTION__RETURN_TYPE, oldReturnType, returnType)); } @@ -112,8 +110,7 @@ public class PredefinedFunctionImpl extends PackageableElementImpl implements Pr @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PREDEFINED_FUNCTION__RETURN_TYPE: if (resolve) return getReturnType(); return basicGetReturnType(); @@ -129,8 +126,7 @@ public class PredefinedFunctionImpl extends PackageableElementImpl implements Pr @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PREDEFINED_FUNCTION__RETURN_TYPE: setReturnType((DataType)newValue); return; @@ -146,8 +142,7 @@ public class PredefinedFunctionImpl extends PackageableElementImpl implements Pr @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PREDEFINED_FUNCTION__RETURN_TYPE: setReturnType((DataType)null); return; @@ -163,8 +158,7 @@ public class PredefinedFunctionImpl extends PackageableElementImpl implements Pr @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PREDEFINED_FUNCTION__RETURN_TYPE: return returnType != null; } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ProcedureCallImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ProcedureCallImpl.java index 46187798..d100ea96 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ProcedureCallImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ProcedureCallImpl.java @@ -98,12 +98,10 @@ public class ProcedureCallImpl extends InteractionImpl implements ProcedureCall @Override public ProcedureSignature getSignature() { - if (signature != null && signature.eIsProxy()) - { + if (signature != null && signature.eIsProxy()) { InternalEObject oldSignature = (InternalEObject)signature; signature = (ProcedureSignature)eResolveProxy(oldSignature); - if (signature != oldSignature) - { + if (signature != oldSignature) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.PROCEDURE_CALL__SIGNATURE, oldSignature, signature)); } @@ -143,8 +141,7 @@ public class ProcedureCallImpl extends InteractionImpl implements ProcedureCall @Override public EList getArgument() { - if (argument == null) - { + if (argument == null) { argument = new EObjectContainmentEList(ParameterBinding.class, this, tdlPackage.PROCEDURE_CALL__ARGUMENT); } return argument; @@ -158,12 +155,10 @@ public class ProcedureCallImpl extends InteractionImpl implements ProcedureCall @Override public ProcedureCall getReplyTo() { - if (replyTo != null && replyTo.eIsProxy()) - { + if (replyTo != null && replyTo.eIsProxy()) { InternalEObject oldReplyTo = (InternalEObject)replyTo; replyTo = (ProcedureCall)eResolveProxy(oldReplyTo); - if (replyTo != oldReplyTo) - { + if (replyTo != oldReplyTo) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.PROCEDURE_CALL__REPLY_TO, oldReplyTo, replyTo)); } @@ -203,8 +198,7 @@ public class ProcedureCallImpl extends InteractionImpl implements ProcedureCall @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PROCEDURE_CALL__ARGUMENT: return ((InternalEList)getArgument()).basicRemove(otherEnd, msgs); } @@ -219,8 +213,7 @@ public class ProcedureCallImpl extends InteractionImpl implements ProcedureCall @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PROCEDURE_CALL__SIGNATURE: if (resolve) return getSignature(); return basicGetSignature(); @@ -242,8 +235,7 @@ public class ProcedureCallImpl extends InteractionImpl implements ProcedureCall @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PROCEDURE_CALL__SIGNATURE: setSignature((ProcedureSignature)newValue); return; @@ -266,8 +258,7 @@ public class ProcedureCallImpl extends InteractionImpl implements ProcedureCall @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PROCEDURE_CALL__SIGNATURE: setSignature((ProcedureSignature)null); return; @@ -289,8 +280,7 @@ public class ProcedureCallImpl extends InteractionImpl implements ProcedureCall @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PROCEDURE_CALL__SIGNATURE: return signature != null; case tdlPackage.PROCEDURE_CALL__ARGUMENT: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ProcedureParameterImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ProcedureParameterImpl.java index d4743bc3..7cdccb95 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ProcedureParameterImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ProcedureParameterImpl.java @@ -101,8 +101,7 @@ public class ProcedureParameterImpl extends ParameterImpl implements ProcedurePa @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PROCEDURE_PARAMETER__KIND: return getKind(); } @@ -117,8 +116,7 @@ public class ProcedureParameterImpl extends ParameterImpl implements ProcedurePa @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PROCEDURE_PARAMETER__KIND: setKind((ParameterKind)newValue); return; @@ -134,8 +132,7 @@ public class ProcedureParameterImpl extends ParameterImpl implements ProcedurePa @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PROCEDURE_PARAMETER__KIND: setKind(KIND_EDEFAULT); return; @@ -151,8 +148,7 @@ public class ProcedureParameterImpl extends ParameterImpl implements ProcedurePa @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PROCEDURE_PARAMETER__KIND: return kind != KIND_EDEFAULT; } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ProcedureSignatureImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ProcedureSignatureImpl.java index 9737c1d9..d8765851 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ProcedureSignatureImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ProcedureSignatureImpl.java @@ -72,8 +72,7 @@ public class ProcedureSignatureImpl extends DataTypeImpl implements ProcedureSig @Override public EList getParameter() { - if (parameter == null) - { + if (parameter == null) { parameter = new EObjectContainmentEList(ProcedureParameter.class, this, tdlPackage.PROCEDURE_SIGNATURE__PARAMETER); } return parameter; @@ -87,8 +86,7 @@ public class ProcedureSignatureImpl extends DataTypeImpl implements ProcedureSig @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PROCEDURE_SIGNATURE__PARAMETER: return ((InternalEList)getParameter()).basicRemove(otherEnd, msgs); } @@ -103,8 +101,7 @@ public class ProcedureSignatureImpl extends DataTypeImpl implements ProcedureSig @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PROCEDURE_SIGNATURE__PARAMETER: return getParameter(); } @@ -120,8 +117,7 @@ public class ProcedureSignatureImpl extends DataTypeImpl implements ProcedureSig @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PROCEDURE_SIGNATURE__PARAMETER: getParameter().clear(); getParameter().addAll((Collection)newValue); @@ -138,8 +134,7 @@ public class ProcedureSignatureImpl extends DataTypeImpl implements ProcedureSig @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PROCEDURE_SIGNATURE__PARAMETER: getParameter().clear(); return; @@ -155,8 +150,7 @@ public class ProcedureSignatureImpl extends DataTypeImpl implements ProcedureSig @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.PROCEDURE_SIGNATURE__PARAMETER: return parameter != null && !parameter.isEmpty(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/QuiescenceImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/QuiescenceImpl.java index b4995de2..c54db99c 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/QuiescenceImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/QuiescenceImpl.java @@ -4,24 +4,42 @@ package org.etsi.mts.tdl.impl; import java.lang.reflect.InvocationTargetException; +import java.util.Iterator; +import java.util.List; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.ids.IdResolver.IdResolverExtension; +import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; +import org.eclipse.ocl.pivot.library.collection.CollectionIncludingOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsSetOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsTypeOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsKindOfOperation; +import org.eclipse.ocl.pivot.messages.PivotMessages; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SetValue; import org.etsi.mts.tdl.AtomicBehaviour; import org.etsi.mts.tdl.Behaviour; +import org.etsi.mts.tdl.Block; import org.etsi.mts.tdl.ComponentInstance; +import org.etsi.mts.tdl.Element; import org.etsi.mts.tdl.GateReference; import org.etsi.mts.tdl.Quiescence; +import org.etsi.mts.tdl.TestConfiguration; +import org.etsi.mts.tdl.TestDescription; import org.etsi.mts.tdl.TimeOperation; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -77,12 +95,10 @@ public class QuiescenceImpl extends TimeOperationImpl implements Quiescence @Override public GateReference getGateReference() { - if (gateReference != null && gateReference.eIsProxy()) - { + if (gateReference != null && gateReference.eIsProxy()) { InternalEObject oldGateReference = (InternalEObject)gateReference; gateReference = (GateReference)eResolveProxy(oldGateReference); - if (gateReference != oldGateReference) - { + if (gateReference != oldGateReference) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.QUIESCENCE__GATE_REFERENCE, oldGateReference, gateReference)); } @@ -114,16 +130,6 @@ public class QuiescenceImpl extends TimeOperationImpl implements Quiescence eNotify(new ENotificationImpl(this, Notification.SET, tdlPackage.QUIESCENCE__GATE_REFERENCE, oldGateReference, gateReference)); } - /** - * The cached invocation delegate for the '{@link #getParticipatingComponents() Get Participating Components}' operation. - * - * - * @see #getParticipatingComponents() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.QUIESCENCE___GET_PARTICIPATING_COMPONENTS).getInvocationDelegate(); - /** * * @@ -133,14 +139,167 @@ public class QuiescenceImpl extends TimeOperationImpl implements Quiescence @Override public EList getParticipatingComponents() { - try - { - return (EList)GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if + * self.getParentTestDescription() + * ->exists(td | td.isLocallyOrdered) and + * self.container() + * .oclIsKindOf(Block) + * then + * if + * not self.componentInstance.oclIsUndefined() or + * not self.gateReference.oclIsUndefined() + * then + * self.componentInstance->including(self.gateReference.component) + * ->asOrderedSet() + * else + * self.container() + * .oclAsType(Block) + * .getParticipatingComponentsExcluding(self) + * ->asOrderedSet() + * endif + * else + * self.getParentTestDescription() + * .testConfiguration.componentInstance->asOrderedSet() + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_Block_0 = idResolver.getClass(tdlTables.CLSSid_Block, null); + final /*@NonInvalid*/ Element container = this.container(); + final /*@NonInvalid*/ TestDescription getParentTestDescription_0 = this.getParentTestDescription(); + final /*@NonInvalid*/ SetValue oclAsSet = OclAnyOclAsSetOperation.INSTANCE.evaluate(executor, tdlTables.SET_CLSSid_TestDescription, getParentTestDescription_0); + /*@Thrown*/ Object accumulator = ValueUtil.FALSE_VALUE; + Iterator ITERATOR_td = oclAsSet.iterator(); + /*@NonInvalid*/ Boolean exists; + while (true) { + if (!ITERATOR_td.hasNext()) { + if (accumulator == ValueUtil.FALSE_VALUE) { + exists = ValueUtil.FALSE_VALUE; + } + else { + throw (InvalidValueException)accumulator; + } + break; + } + /*@NonInvalid*/ TestDescription td = (TestDescription)ITERATOR_td.next(); + /** + * td.isLocallyOrdered + */ + final /*@NonInvalid*/ boolean isLocallyOrdered = td.isIsLocallyOrdered(); + // + if (isLocallyOrdered) { // Normal successful body evaluation result + exists = ValueUtil.TRUE_VALUE; + break; // Stop immediately + } + else if (!isLocallyOrdered) { // Normal unsuccessful body evaluation result + ; // Carry on + } + else { // Impossible badly typed result + accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "exists"); + } + } + final /*@Thrown*/ Boolean and; + if (exists == ValueUtil.FALSE_VALUE) { + and = ValueUtil.FALSE_VALUE; + } + else { + final /*@NonInvalid*/ boolean oclIsKindOf = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_Block_0).booleanValue(); + if (!oclIsKindOf) { + and = ValueUtil.FALSE_VALUE; + } + else { + if (exists == null) { + and = null; + } + else { + and = ValueUtil.TRUE_VALUE; + } + } + } + if (and == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ OrderedSetValue local_1; + if (and) { + final /*@NonInvalid*/ ComponentInstance componentInstance_0 = this.getComponentInstance(); + final /*@NonInvalid*/ GateReference gateReference_0 = this.getGateReference(); + final /*@NonInvalid*/ boolean oclIsUndefined = componentInstance_0 == null; + final /*@NonInvalid*/ Boolean not; + if (!oclIsUndefined) { + not = ValueUtil.TRUE_VALUE; + } + else { + if (oclIsUndefined) { + not = ValueUtil.FALSE_VALUE; + } + else { + not = null; + } + } + final /*@Thrown*/ Boolean or; + if (not == ValueUtil.TRUE_VALUE) { + or = ValueUtil.TRUE_VALUE; + } + else { + final /*@NonInvalid*/ boolean oclIsUndefined_0 = gateReference_0 == null; + final /*@NonInvalid*/ Boolean not_0; + if (!oclIsUndefined_0) { + not_0 = ValueUtil.TRUE_VALUE; + } + else { + if (oclIsUndefined_0) { + not_0 = ValueUtil.FALSE_VALUE; + } + else { + not_0 = null; + } + } + if (not_0 == ValueUtil.TRUE_VALUE) { + or = ValueUtil.TRUE_VALUE; + } + else { + if ((not == null) || (not_0 == null)) { + or = null; + } + else { + or = ValueUtil.FALSE_VALUE; + } + } + } + if (or == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ OrderedSetValue local_0; + if (or) { + final /*@Thrown*/ SetValue oclAsSet_0 = OclAnyOclAsSetOperation.INSTANCE.evaluate(executor, tdlTables.SET_CLSSid_ComponentInstance, componentInstance_0); + if (gateReference_0 == null) { + throw new InvalidValueException("Null source for \'\'http://www.etsi.org/spec/TDL/1.4.1\'::GateReference::component\'"); + } + final /*@Thrown*/ ComponentInstance component = gateReference_0.getComponent(); + final /*@Thrown*/ SetValue including = (SetValue)CollectionIncludingOperation.INSTANCE.evaluate(oclAsSet_0, component); + final /*@Thrown*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(including); + local_0 = asOrderedSet; + } + else { + final /*@Thrown*/ Block oclAsType = (Block)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_Block_0); + final /*@Thrown*/ List getParticipatingComponentsExcluding = oclAsType.getParticipatingComponentsExcluding(this); + final /*@Thrown*/ OrderedSetValue BOXED_getParticipatingComponentsExcluding = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_ComponentInstance, getParticipatingComponentsExcluding); + final /*@Thrown*/ OrderedSetValue asOrderedSet_0 = CollectionAsOrderedSetOperation.INSTANCE.evaluate(BOXED_getParticipatingComponentsExcluding); + local_0 = asOrderedSet_0; + } + local_1 = local_0; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + final /*@NonInvalid*/ TestConfiguration testConfiguration = getParentTestDescription_0.getTestConfiguration(); + final /*@NonInvalid*/ List componentInstance_1 = testConfiguration.getComponentInstance(); + final /*@NonInvalid*/ SetValue BOXED_componentInstance_1 = idResolver.createSetOfAll(tdlTables.SET_CLSSid_ComponentInstance, componentInstance_1); + final /*@NonInvalid*/ OrderedSetValue asOrderedSet_1 = CollectionAsOrderedSetOperation.INSTANCE.evaluate(BOXED_componentInstance_1); + local_1 = asOrderedSet_1; } + final /*@Thrown*/ List ECORE_local_1 = ((IdResolverExtension)idResolver).ecoreValueOfAll(ComponentInstance.class, local_1); + return (EList)ECORE_local_1; } /** @@ -151,8 +310,7 @@ public class QuiescenceImpl extends TimeOperationImpl implements Quiescence @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.QUIESCENCE__GATE_REFERENCE: if (resolve) return getGateReference(); return basicGetGateReference(); @@ -168,8 +326,7 @@ public class QuiescenceImpl extends TimeOperationImpl implements Quiescence @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.QUIESCENCE__GATE_REFERENCE: setGateReference((GateReference)newValue); return; @@ -185,8 +342,7 @@ public class QuiescenceImpl extends TimeOperationImpl implements Quiescence @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.QUIESCENCE__GATE_REFERENCE: setGateReference((GateReference)null); return; @@ -202,8 +358,7 @@ public class QuiescenceImpl extends TimeOperationImpl implements Quiescence @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.QUIESCENCE__GATE_REFERENCE: return gateReference != null; } @@ -218,26 +373,20 @@ public class QuiescenceImpl extends TimeOperationImpl implements Quiescence @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == Behaviour.class) - { - switch (baseOperationID) - { + if (baseClass == Behaviour.class) { + switch (baseOperationID) { case tdlPackage.BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return tdlPackage.QUIESCENCE___GET_PARTICIPATING_COMPONENTS; default: return super.eDerivedOperationID(baseOperationID, baseClass); } } - if (baseClass == AtomicBehaviour.class) - { - switch (baseOperationID) - { + if (baseClass == AtomicBehaviour.class) { + switch (baseOperationID) { case tdlPackage.ATOMIC_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return tdlPackage.QUIESCENCE___GET_PARTICIPATING_COMPONENTS; default: return super.eDerivedOperationID(baseOperationID, baseClass); } } - if (baseClass == TimeOperation.class) - { - switch (baseOperationID) - { + if (baseClass == TimeOperation.class) { + switch (baseOperationID) { case tdlPackage.TIME_OPERATION___GET_PARTICIPATING_COMPONENTS: return tdlPackage.QUIESCENCE___GET_PARTICIPATING_COMPONENTS; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -253,8 +402,7 @@ public class QuiescenceImpl extends TimeOperationImpl implements Quiescence @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.QUIESCENCE___GET_PARTICIPATING_COMPONENTS: return getParticipatingComponents(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/SimpleDataTypeImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/SimpleDataTypeImpl.java index 3303f808..f57ea7f8 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/SimpleDataTypeImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/SimpleDataTypeImpl.java @@ -4,23 +4,34 @@ package org.etsi.mts.tdl.impl; import java.lang.reflect.InvocationTargetException; +import java.util.List; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.ids.IdResolver.IdResolverExtension; +import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; +import org.eclipse.ocl.pivot.library.collection.CollectionUnionOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsTypeOperation; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SetValue; import org.etsi.mts.tdl.Constraint; import org.etsi.mts.tdl.DataType; import org.etsi.mts.tdl.Extension; +import org.etsi.mts.tdl.PackageableElement; import org.etsi.mts.tdl.SimpleDataType; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -88,8 +99,7 @@ public class SimpleDataTypeImpl extends DataTypeImpl implements SimpleDataType { Extension oldExtension = extension; extension = newExtension; - if (eNotificationRequired()) - { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, tdlPackage.SIMPLE_DATA_TYPE__EXTENSION, oldExtension, newExtension); if (msgs == null) msgs = notification; else msgs.add(notification); } @@ -104,8 +114,7 @@ public class SimpleDataTypeImpl extends DataTypeImpl implements SimpleDataType @Override public void setExtension(Extension newExtension) { - if (newExtension != extension) - { + if (newExtension != extension) { NotificationChain msgs = null; if (extension != null) msgs = ((InternalEObject)extension).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - tdlPackage.SIMPLE_DATA_TYPE__EXTENSION, null, msgs); @@ -118,16 +127,6 @@ public class SimpleDataTypeImpl extends DataTypeImpl implements SimpleDataType eNotify(new ENotificationImpl(this, Notification.SET, tdlPackage.SIMPLE_DATA_TYPE__EXTENSION, newExtension, newExtension)); } - /** - * The cached invocation delegate for the '{@link #allConstraints() All Constraints}' operation. - * - * - * @see #allConstraints() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate ALL_CONSTRAINTS__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.SIMPLE_DATA_TYPE___ALL_CONSTRAINTS).getInvocationDelegate(); - /** * * @@ -137,14 +136,57 @@ public class SimpleDataTypeImpl extends DataTypeImpl implements SimpleDataType @Override public EList allConstraints() { - try - { - return (EList)ALL_CONSTRAINTS__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if not self.extension.oclIsUndefined() + * then + * self.extension.extending.oclAsType(SimpleDataType) + * .allConstraints() + * ->union(self.constraint) + * ->asOrderedSet() + * else self.constraint + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ List constraint_0 = this.getConstraint(); + final /*@NonInvalid*/ Extension extension = this.getExtension(); + final /*@NonInvalid*/ OrderedSetValue BOXED_constraint_0 = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_Constraint, constraint_0); + final /*@NonInvalid*/ boolean oclIsUndefined = extension == null; + final /*@NonInvalid*/ Boolean not; + if (!oclIsUndefined) { + not = ValueUtil.TRUE_VALUE; + } + else { + if (oclIsUndefined) { + not = ValueUtil.FALSE_VALUE; + } + else { + not = null; + } + } + if (not == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ OrderedSetValue local_0; + if (not) { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_SimpleDataType_0 = idResolver.getClass(tdlTables.CLSSid_SimpleDataType, null); + if (extension == null) { + throw new InvalidValueException("Null source for \'\'http://www.etsi.org/spec/TDL/1.4.1\'::Extension::extending\'"); + } + final /*@Thrown*/ PackageableElement extending = extension.getExtending(); + final /*@Thrown*/ SimpleDataType oclAsType = (SimpleDataType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, extending, TYP_tdl_c_c_SimpleDataType_0); + final /*@Thrown*/ List allConstraints = oclAsType.allConstraints(); + final /*@Thrown*/ OrderedSetValue BOXED_allConstraints = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_Constraint, allConstraints); + final /*@Thrown*/ SetValue union = (SetValue)CollectionUnionOperation.INSTANCE.evaluate(BOXED_allConstraints, BOXED_constraint_0); + final /*@Thrown*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(union); + local_0 = asOrderedSet; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + local_0 = BOXED_constraint_0; } + final /*@Thrown*/ List ECORE_local_0 = ((IdResolverExtension)idResolver).ecoreValueOfAll(Constraint.class, local_0); + return (EList)ECORE_local_0; } /** @@ -155,8 +197,7 @@ public class SimpleDataTypeImpl extends DataTypeImpl implements SimpleDataType @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.SIMPLE_DATA_TYPE__EXTENSION: return basicSetExtension(null, msgs); } @@ -171,8 +212,7 @@ public class SimpleDataTypeImpl extends DataTypeImpl implements SimpleDataType @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.SIMPLE_DATA_TYPE__EXTENSION: return getExtension(); } @@ -187,8 +227,7 @@ public class SimpleDataTypeImpl extends DataTypeImpl implements SimpleDataType @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.SIMPLE_DATA_TYPE__EXTENSION: setExtension((Extension)newValue); return; @@ -204,8 +243,7 @@ public class SimpleDataTypeImpl extends DataTypeImpl implements SimpleDataType @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.SIMPLE_DATA_TYPE__EXTENSION: setExtension((Extension)null); return; @@ -221,8 +259,7 @@ public class SimpleDataTypeImpl extends DataTypeImpl implements SimpleDataType @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.SIMPLE_DATA_TYPE__EXTENSION: return extension != null; } @@ -237,10 +274,8 @@ public class SimpleDataTypeImpl extends DataTypeImpl implements SimpleDataType @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == DataType.class) - { - switch (baseOperationID) - { + if (baseClass == DataType.class) { + switch (baseOperationID) { case tdlPackage.DATA_TYPE___ALL_CONSTRAINTS: return tdlPackage.SIMPLE_DATA_TYPE___ALL_CONSTRAINTS; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -256,8 +291,7 @@ public class SimpleDataTypeImpl extends DataTypeImpl implements SimpleDataType @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.SIMPLE_DATA_TYPE___ALL_CONSTRAINTS: return allConstraints(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/SingleCombinedBehaviourImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/SingleCombinedBehaviourImpl.java index 6700330a..2cbccbb9 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/SingleCombinedBehaviourImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/SingleCombinedBehaviourImpl.java @@ -4,23 +4,42 @@ package org.etsi.mts.tdl.impl; import java.lang.reflect.InvocationTargetException; +import java.util.Iterator; +import java.util.List; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.ids.IdResolver.IdResolverExtension; +import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; +import org.eclipse.ocl.pivot.library.collection.CollectionUnionOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsSetOperation; +import org.eclipse.ocl.pivot.messages.PivotMessages; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.BagValue; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SequenceValue; +import org.eclipse.ocl.pivot.values.SequenceValue.Accumulator; +import org.eclipse.ocl.pivot.values.SetValue; import org.etsi.mts.tdl.Behaviour; import org.etsi.mts.tdl.Block; import org.etsi.mts.tdl.ComponentInstance; +import org.etsi.mts.tdl.ExceptionalBehaviour; +import org.etsi.mts.tdl.PeriodicBehaviour; import org.etsi.mts.tdl.SingleCombinedBehaviour; +import org.etsi.mts.tdl.TestConfiguration; +import org.etsi.mts.tdl.TestDescription; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -88,8 +107,7 @@ public abstract class SingleCombinedBehaviourImpl extends CombinedBehaviourImpl { Block oldBlock = block; block = newBlock; - if (eNotificationRequired()) - { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, tdlPackage.SINGLE_COMBINED_BEHAVIOUR__BLOCK, oldBlock, newBlock); if (msgs == null) msgs = notification; else msgs.add(notification); } @@ -104,8 +122,7 @@ public abstract class SingleCombinedBehaviourImpl extends CombinedBehaviourImpl @Override public void setBlock(Block newBlock) { - if (newBlock != block) - { + if (newBlock != block) { NotificationChain msgs = null; if (block != null) msgs = ((InternalEObject)block).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - tdlPackage.SINGLE_COMBINED_BEHAVIOUR__BLOCK, null, msgs); @@ -118,16 +135,6 @@ public abstract class SingleCombinedBehaviourImpl extends CombinedBehaviourImpl eNotify(new ENotificationImpl(this, Notification.SET, tdlPackage.SINGLE_COMBINED_BEHAVIOUR__BLOCK, newBlock, newBlock)); } - /** - * The cached invocation delegate for the '{@link #getParticipatingComponents() Get Participating Components}' operation. - * - * - * @see #getParticipatingComponents() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.SINGLE_COMBINED_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS).getInvocationDelegate(); - /** * * @@ -137,14 +144,119 @@ public abstract class SingleCombinedBehaviourImpl extends CombinedBehaviourImpl @Override public EList getParticipatingComponents() { - try - { - return (EList)GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if + * self.getParentTestDescription() + * ->exists(td | td.isLocallyOrdered) + * then + * self.periodic.getParticipatingComponents() + * ->union(self.exceptional.getParticipatingComponents()) + * ->union(self.block.getParticipatingComponents()) + * ->asOrderedSet() + * else + * self.getParentTestDescription() + * .testConfiguration.componentInstance->asOrderedSet() + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ TestDescription getParentTestDescription = this.getParentTestDescription(); + final /*@NonInvalid*/ SetValue oclAsSet = OclAnyOclAsSetOperation.INSTANCE.evaluate(executor, tdlTables.SET_CLSSid_TestDescription, getParentTestDescription); + /*@Thrown*/ Object accumulator = ValueUtil.FALSE_VALUE; + Iterator ITERATOR_td = oclAsSet.iterator(); + /*@NonInvalid*/ Boolean exists; + while (true) { + if (!ITERATOR_td.hasNext()) { + if (accumulator == ValueUtil.FALSE_VALUE) { + exists = ValueUtil.FALSE_VALUE; + } + else { + throw (InvalidValueException)accumulator; + } + break; + } + /*@NonInvalid*/ TestDescription td = (TestDescription)ITERATOR_td.next(); + /** + * td.isLocallyOrdered + */ + final /*@NonInvalid*/ boolean isLocallyOrdered = td.isIsLocallyOrdered(); + // + if (isLocallyOrdered) { // Normal successful body evaluation result + exists = ValueUtil.TRUE_VALUE; + break; // Stop immediately + } + else if (!isLocallyOrdered) { // Normal unsuccessful body evaluation result + ; // Carry on + } + else { // Impossible badly typed result + accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "exists"); + } + } + if (exists == null) { + throw new InvalidValueException("Null if condition"); + } + /*@NonInvalid*/ OrderedSetValue local_0; + if (exists) { + final /*@NonInvalid*/ List periodic = this.getPeriodic(); + final /*@NonInvalid*/ OrderedSetValue BOXED_periodic = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_PeriodicBehaviour, periodic); + /*@Thrown*/ Accumulator accumulator_0 = ValueUtil.createSequenceAccumulatorValue(tdlTables.SEQ_CLSSid_ComponentInstance); + Iterator ITERATOR__1 = BOXED_periodic.iterator(); + /*@NonInvalid*/ SequenceValue collect; + while (true) { + if (!ITERATOR__1.hasNext()) { + collect = accumulator_0; + break; + } + /*@NonInvalid*/ PeriodicBehaviour _1 = (PeriodicBehaviour)ITERATOR__1.next(); + /** + * getParticipatingComponents() + */ + final /*@NonInvalid*/ List getParticipatingComponents = _1.getParticipatingComponents(); + final /*@NonInvalid*/ OrderedSetValue BOXED_getParticipatingComponents = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_ComponentInstance, getParticipatingComponents); + // + for (Object value : BOXED_getParticipatingComponents.flatten().getElements()) { + accumulator_0.add(value); + } + } + final /*@NonInvalid*/ List exceptional = this.getExceptional(); + final /*@NonInvalid*/ OrderedSetValue BOXED_exceptional = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_ExceptionalBehaviour, exceptional); + /*@Thrown*/ Accumulator accumulator_1 = ValueUtil.createSequenceAccumulatorValue(tdlTables.SEQ_CLSSid_ComponentInstance); + Iterator ITERATOR__1_0 = BOXED_exceptional.iterator(); + /*@NonInvalid*/ SequenceValue collect_0; + while (true) { + if (!ITERATOR__1_0.hasNext()) { + collect_0 = accumulator_1; + break; + } + /*@NonInvalid*/ ExceptionalBehaviour _1_0 = (ExceptionalBehaviour)ITERATOR__1_0.next(); + /** + * getParticipatingComponents() + */ + final /*@NonInvalid*/ List getParticipatingComponents_0 = _1_0.getParticipatingComponents(); + final /*@NonInvalid*/ OrderedSetValue BOXED_getParticipatingComponents_0 = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_ComponentInstance, getParticipatingComponents_0); + // + for (Object value : BOXED_getParticipatingComponents_0.flatten().getElements()) { + accumulator_1.add(value); + } + } + final /*@NonInvalid*/ BagValue union = (BagValue)CollectionUnionOperation.INSTANCE.evaluate(collect, collect_0); + final /*@NonInvalid*/ Block block = this.getBlock(); + final /*@NonInvalid*/ List getParticipatingComponents_1 = block.getParticipatingComponents(); + final /*@NonInvalid*/ OrderedSetValue BOXED_getParticipatingComponents_1 = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_ComponentInstance, getParticipatingComponents_1); + final /*@NonInvalid*/ BagValue union_0 = (BagValue)CollectionUnionOperation.INSTANCE.evaluate(union, BOXED_getParticipatingComponents_1); + final /*@NonInvalid*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(union_0); + local_0 = asOrderedSet; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + final /*@NonInvalid*/ TestConfiguration testConfiguration = getParentTestDescription.getTestConfiguration(); + final /*@NonInvalid*/ List componentInstance = testConfiguration.getComponentInstance(); + final /*@NonInvalid*/ SetValue BOXED_componentInstance = idResolver.createSetOfAll(tdlTables.SET_CLSSid_ComponentInstance, componentInstance); + final /*@NonInvalid*/ OrderedSetValue asOrderedSet_0 = CollectionAsOrderedSetOperation.INSTANCE.evaluate(BOXED_componentInstance); + local_0 = asOrderedSet_0; } + final /*@NonInvalid*/ List ECORE_local_0 = ((IdResolverExtension)idResolver).ecoreValueOfAll(ComponentInstance.class, local_0); + return (EList)ECORE_local_0; } /** @@ -155,8 +267,7 @@ public abstract class SingleCombinedBehaviourImpl extends CombinedBehaviourImpl @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.SINGLE_COMBINED_BEHAVIOUR__BLOCK: return basicSetBlock(null, msgs); } @@ -171,8 +282,7 @@ public abstract class SingleCombinedBehaviourImpl extends CombinedBehaviourImpl @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.SINGLE_COMBINED_BEHAVIOUR__BLOCK: return getBlock(); } @@ -187,8 +297,7 @@ public abstract class SingleCombinedBehaviourImpl extends CombinedBehaviourImpl @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.SINGLE_COMBINED_BEHAVIOUR__BLOCK: setBlock((Block)newValue); return; @@ -204,8 +313,7 @@ public abstract class SingleCombinedBehaviourImpl extends CombinedBehaviourImpl @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.SINGLE_COMBINED_BEHAVIOUR__BLOCK: setBlock((Block)null); return; @@ -221,8 +329,7 @@ public abstract class SingleCombinedBehaviourImpl extends CombinedBehaviourImpl @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.SINGLE_COMBINED_BEHAVIOUR__BLOCK: return block != null; } @@ -237,10 +344,8 @@ public abstract class SingleCombinedBehaviourImpl extends CombinedBehaviourImpl @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == Behaviour.class) - { - switch (baseOperationID) - { + if (baseClass == Behaviour.class) { + switch (baseOperationID) { case tdlPackage.BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return tdlPackage.SINGLE_COMBINED_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -256,8 +361,7 @@ public abstract class SingleCombinedBehaviourImpl extends CombinedBehaviourImpl @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.SINGLE_COMBINED_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return getParticipatingComponents(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/SpecialValueUseImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/SpecialValueUseImpl.java index 7d706546..327064a0 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/SpecialValueUseImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/SpecialValueUseImpl.java @@ -5,15 +5,25 @@ package org.etsi.mts.tdl.impl; import java.lang.reflect.InvocationTargetException; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; - +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsTypeOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsTypeOfOperation; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.etsi.mts.tdl.AnyValue; import org.etsi.mts.tdl.DataType; import org.etsi.mts.tdl.DataUse; +import org.etsi.mts.tdl.Element; +import org.etsi.mts.tdl.Member; +import org.etsi.mts.tdl.MemberAssignment; +import org.etsi.mts.tdl.Parameter; +import org.etsi.mts.tdl.ParameterBinding; import org.etsi.mts.tdl.SpecialValueUse; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -45,16 +55,6 @@ public abstract class SpecialValueUseImpl extends StaticDataUseImpl implements S return tdlPackage.Literals.SPECIAL_VALUE_USE; } - /** - * The cached invocation delegate for the '{@link #resolveDataType() Resolve Data Type}' operation. - * - * - * @see #resolveDataType() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate RESOLVE_DATA_TYPE__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.SPECIAL_VALUE_USE___RESOLVE_DATA_TYPE).getInvocationDelegate(); - /** * * @@ -63,14 +63,84 @@ public abstract class SpecialValueUseImpl extends StaticDataUseImpl implements S @Override public DataType resolveDataType() { - try - { - return (DataType)RESOLVE_DATA_TYPE__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if self.container().oclIsTypeOf(MemberAssignment) + * then + * self.container() + * .oclAsType(MemberAssignment).member.dataType + * else + * if self.container().oclIsTypeOf(ParameterBinding) + * then + * self.container() + * .oclAsType(ParameterBinding).parameter.dataType + * else + * if + * self.container() + * .oclIsTypeOf(Interaction) and + * self.oclIsTypeOf(AnyValue) + * then self.oclAsType(AnyValue).dataType + * else null + * endif + * endif + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_MemberAssignment_0 = idResolver.getClass(tdlTables.CLSSid_MemberAssignment, null); + final /*@NonInvalid*/ Element container = this.container(); + final /*@NonInvalid*/ boolean oclIsTypeOf = OclAnyOclIsTypeOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_MemberAssignment_0).booleanValue(); + /*@Thrown*/ DataType local_2; + if (oclIsTypeOf) { + final /*@Thrown*/ MemberAssignment oclAsType = (MemberAssignment)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_MemberAssignment_0); + final /*@Thrown*/ Member member = oclAsType.getMember(); + final /*@Thrown*/ DataType dataType = member.getDataType(); + local_2 = dataType; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_ParameterBinding_0 = idResolver.getClass(tdlTables.CLSSid_ParameterBinding, null); + final /*@NonInvalid*/ boolean oclIsTypeOf_0 = OclAnyOclIsTypeOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_ParameterBinding_0).booleanValue(); + /*@Thrown*/ DataType local_1; + if (oclIsTypeOf_0) { + final /*@Thrown*/ ParameterBinding oclAsType_0 = (ParameterBinding)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_ParameterBinding_0); + final /*@Thrown*/ Parameter parameter = oclAsType_0.getParameter(); + final /*@Thrown*/ DataType dataType_0 = parameter.getDataType(); + local_1 = dataType_0; + } + else { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_AnyValue_1 = idResolver.getClass(tdlTables.CLSSid_AnyValue, null); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_Interaction_0 = idResolver.getClass(tdlTables.CLSSid_Interaction, null); + final /*@NonInvalid*/ boolean oclIsTypeOf_1 = OclAnyOclIsTypeOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_Interaction_0).booleanValue(); + final /*@NonInvalid*/ Boolean and; + if (!oclIsTypeOf_1) { + and = ValueUtil.FALSE_VALUE; + } + else { + final /*@NonInvalid*/ boolean oclIsTypeOf_2 = OclAnyOclIsTypeOfOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_AnyValue_1).booleanValue(); + if (!oclIsTypeOf_2) { + and = ValueUtil.FALSE_VALUE; + } + else { + and = ValueUtil.TRUE_VALUE; + } + } + if (and == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ DataType local_0; + if (and) { + final /*@Thrown*/ AnyValue oclAsType_1 = (AnyValue)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, this, TYP_tdl_c_c_AnyValue_1); + final /*@Thrown*/ DataType dataType_1 = oclAsType_1.getDataType(); + local_0 = dataType_1; + } + else { + local_0 = null; + } + local_1 = local_0; + } + local_2 = local_1; } + return local_2; } /** @@ -81,10 +151,8 @@ public abstract class SpecialValueUseImpl extends StaticDataUseImpl implements S @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == DataUse.class) - { - switch (baseOperationID) - { + if (baseClass == DataUse.class) { + switch (baseOperationID) { case tdlPackage.DATA_USE___RESOLVE_DATA_TYPE: return tdlPackage.SPECIAL_VALUE_USE___RESOLVE_DATA_TYPE; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -100,8 +168,7 @@ public abstract class SpecialValueUseImpl extends StaticDataUseImpl implements S @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.SPECIAL_VALUE_USE___RESOLVE_DATA_TYPE: return resolveDataType(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/StructuredDataInstanceImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/StructuredDataInstanceImpl.java index 891c97f0..fdfc4175 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/StructuredDataInstanceImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/StructuredDataInstanceImpl.java @@ -97,8 +97,7 @@ public class StructuredDataInstanceImpl extends DataInstanceImpl implements Stru @Override public EList getMemberAssignment() { - if (memberAssignment == null) - { + if (memberAssignment == null) { memberAssignment = new EObjectContainmentEList(MemberAssignment.class, this, tdlPackage.STRUCTURED_DATA_INSTANCE__MEMBER_ASSIGNMENT); } return memberAssignment; @@ -137,8 +136,7 @@ public class StructuredDataInstanceImpl extends DataInstanceImpl implements Stru @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.STRUCTURED_DATA_INSTANCE__MEMBER_ASSIGNMENT: return ((InternalEList)getMemberAssignment()).basicRemove(otherEnd, msgs); } @@ -153,8 +151,7 @@ public class StructuredDataInstanceImpl extends DataInstanceImpl implements Stru @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.STRUCTURED_DATA_INSTANCE__MEMBER_ASSIGNMENT: return getMemberAssignment(); case tdlPackage.STRUCTURED_DATA_INSTANCE__UNASSIGNED_MEMBER: @@ -172,8 +169,7 @@ public class StructuredDataInstanceImpl extends DataInstanceImpl implements Stru @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.STRUCTURED_DATA_INSTANCE__MEMBER_ASSIGNMENT: getMemberAssignment().clear(); getMemberAssignment().addAll((Collection)newValue); @@ -193,8 +189,7 @@ public class StructuredDataInstanceImpl extends DataInstanceImpl implements Stru @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.STRUCTURED_DATA_INSTANCE__MEMBER_ASSIGNMENT: getMemberAssignment().clear(); return; @@ -213,8 +208,7 @@ public class StructuredDataInstanceImpl extends DataInstanceImpl implements Stru @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.STRUCTURED_DATA_INSTANCE__MEMBER_ASSIGNMENT: return memberAssignment != null && !memberAssignment.isEmpty(); case tdlPackage.STRUCTURED_DATA_INSTANCE__UNASSIGNED_MEMBER: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/StructuredDataTypeImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/StructuredDataTypeImpl.java index 97bf22cb..3b350973 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/StructuredDataTypeImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/StructuredDataTypeImpl.java @@ -6,24 +6,39 @@ import java.lang.reflect.InvocationTargetException; import java.util.Collection; +import java.util.Iterator; +import java.util.List; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.ids.IdResolver.IdResolverExtension; +import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; +import org.eclipse.ocl.pivot.library.collection.CollectionIsEmptyOperation; +import org.eclipse.ocl.pivot.library.collection.CollectionUnionOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsTypeOperation; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.BagValue; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SequenceValue; +import org.eclipse.ocl.pivot.values.SequenceValue.Accumulator; import org.etsi.mts.tdl.Constraint; import org.etsi.mts.tdl.DataType; import org.etsi.mts.tdl.Extension; import org.etsi.mts.tdl.Member; +import org.etsi.mts.tdl.PackageableElement; import org.etsi.mts.tdl.StructuredDataType; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -90,8 +105,7 @@ public class StructuredDataTypeImpl extends DataTypeImpl implements StructuredDa @Override public EList getExtension() { - if (extension == null) - { + if (extension == null) { extension = new EObjectContainmentEList(Extension.class, this, tdlPackage.STRUCTURED_DATA_TYPE__EXTENSION); } return extension; @@ -105,23 +119,12 @@ public class StructuredDataTypeImpl extends DataTypeImpl implements StructuredDa @Override public EList getMember() { - if (member == null) - { + if (member == null) { member = new EObjectContainmentEList(Member.class, this, tdlPackage.STRUCTURED_DATA_TYPE__MEMBER); } return member; } - /** - * The cached invocation delegate for the '{@link #allMembers() All Members}' operation. - * - * - * @see #allMembers() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate ALL_MEMBERS__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.STRUCTURED_DATA_TYPE___ALL_MEMBERS).getInvocationDelegate(); - /** * * @@ -131,26 +134,78 @@ public class StructuredDataTypeImpl extends DataTypeImpl implements StructuredDa @Override public EList allMembers() { - try - { - return (EList)ALL_MEMBERS__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if not self.extension->isEmpty() + * then + * self.extension->collect(e | + * e.extending.oclAsType(StructuredDataType) + * .allMembers()) + * ->union(self.member) + * ->asOrderedSet() + * else self.member + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ List extension_0 = this.getExtension(); + final /*@NonInvalid*/ List member_0 = this.getMember(); + final /*@NonInvalid*/ OrderedSetValue BOXED_extension_0 = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_Extension, extension_0); + final /*@NonInvalid*/ OrderedSetValue BOXED_member_0 = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_Member, member_0); + final /*@NonInvalid*/ boolean isEmpty = CollectionIsEmptyOperation.INSTANCE.evaluate(BOXED_extension_0).booleanValue(); + final /*@NonInvalid*/ Boolean not; + if (!isEmpty) { + not = ValueUtil.TRUE_VALUE; + } + else { + if (isEmpty) { + not = ValueUtil.FALSE_VALUE; + } + else { + not = null; + } + } + if (not == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ OrderedSetValue local_0; + if (not) { + /*@Thrown*/ Accumulator accumulator = ValueUtil.createSequenceAccumulatorValue(tdlTables.SEQ_CLSSid_Member); + Iterator ITERATOR_e_1 = BOXED_extension_0.iterator(); + /*@Thrown*/ SequenceValue collect; + while (true) { + if (!ITERATOR_e_1.hasNext()) { + collect = accumulator; + break; + } + /*@NonInvalid*/ Extension e_1 = (Extension)ITERATOR_e_1.next(); + /** + * e.extending.oclAsType(StructuredDataType).allMembers() + */ + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_StructuredDataType_0 = idResolver.getClass(tdlTables.CLSSid_StructuredDataType, null); + if (e_1 == null) { + throw new InvalidValueException("Null source for \'\'http://www.etsi.org/spec/TDL/1.4.1\'::Extension::extending\'"); + } + final /*@Thrown*/ PackageableElement extending = e_1.getExtending(); + final /*@Thrown*/ StructuredDataType oclAsType = (StructuredDataType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, extending, TYP_tdl_c_c_StructuredDataType_0); + final /*@Thrown*/ List allMembers = oclAsType.allMembers(); + final /*@Thrown*/ OrderedSetValue BOXED_allMembers = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_Member, allMembers); + // + for (Object value : BOXED_allMembers.flatten().getElements()) { + accumulator.add(value); + } + } + final /*@Thrown*/ BagValue union = (BagValue)CollectionUnionOperation.INSTANCE.evaluate(collect, BOXED_member_0); + final /*@Thrown*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(union); + local_0 = asOrderedSet; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + local_0 = BOXED_member_0; } + final /*@Thrown*/ List ECORE_local_0 = ((IdResolverExtension)idResolver).ecoreValueOfAll(Member.class, local_0); + return (EList)ECORE_local_0; } - /** - * The cached invocation delegate for the '{@link #allConstraints() All Constraints}' operation. - * - * - * @see #allConstraints() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate ALL_CONSTRAINTS__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.STRUCTURED_DATA_TYPE___ALL_CONSTRAINTS).getInvocationDelegate(); - /** * * @@ -160,14 +215,76 @@ public class StructuredDataTypeImpl extends DataTypeImpl implements StructuredDa @Override public EList allConstraints() { - try - { - return (EList)ALL_CONSTRAINTS__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if not self.extension->isEmpty() + * then + * self.extension->collect(e | + * e.extending.oclAsType(StructuredDataType) + * .allConstraints()) + * ->union(self.constraint) + * ->asOrderedSet() + * else self.constraint + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ List constraint_0 = this.getConstraint(); + final /*@NonInvalid*/ List extension_0 = this.getExtension(); + final /*@NonInvalid*/ OrderedSetValue BOXED_constraint_0 = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_Constraint, constraint_0); + final /*@NonInvalid*/ OrderedSetValue BOXED_extension_0 = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_Extension, extension_0); + final /*@NonInvalid*/ boolean isEmpty = CollectionIsEmptyOperation.INSTANCE.evaluate(BOXED_extension_0).booleanValue(); + final /*@NonInvalid*/ Boolean not; + if (!isEmpty) { + not = ValueUtil.TRUE_VALUE; + } + else { + if (isEmpty) { + not = ValueUtil.FALSE_VALUE; + } + else { + not = null; + } + } + if (not == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ OrderedSetValue local_0; + if (not) { + /*@Thrown*/ Accumulator accumulator = ValueUtil.createSequenceAccumulatorValue(tdlTables.SEQ_CLSSid_Constraint); + Iterator ITERATOR_e_1 = BOXED_extension_0.iterator(); + /*@Thrown*/ SequenceValue collect; + while (true) { + if (!ITERATOR_e_1.hasNext()) { + collect = accumulator; + break; + } + /*@NonInvalid*/ Extension e_1 = (Extension)ITERATOR_e_1.next(); + /** + * e.extending.oclAsType(StructuredDataType).allConstraints() + */ + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_StructuredDataType_0 = idResolver.getClass(tdlTables.CLSSid_StructuredDataType, null); + if (e_1 == null) { + throw new InvalidValueException("Null source for \'\'http://www.etsi.org/spec/TDL/1.4.1\'::Extension::extending\'"); + } + final /*@Thrown*/ PackageableElement extending = e_1.getExtending(); + final /*@Thrown*/ StructuredDataType oclAsType = (StructuredDataType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, extending, TYP_tdl_c_c_StructuredDataType_0); + final /*@Thrown*/ List allConstraints = oclAsType.allConstraints(); + final /*@Thrown*/ OrderedSetValue BOXED_allConstraints = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_Constraint, allConstraints); + // + for (Object value : BOXED_allConstraints.flatten().getElements()) { + accumulator.add(value); + } + } + final /*@Thrown*/ BagValue union = (BagValue)CollectionUnionOperation.INSTANCE.evaluate(collect, BOXED_constraint_0); + final /*@Thrown*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(union); + local_0 = asOrderedSet; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + local_0 = BOXED_constraint_0; } + final /*@Thrown*/ List ECORE_local_0 = ((IdResolverExtension)idResolver).ecoreValueOfAll(Constraint.class, local_0); + return (EList)ECORE_local_0; } /** @@ -178,8 +295,7 @@ public class StructuredDataTypeImpl extends DataTypeImpl implements StructuredDa @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.STRUCTURED_DATA_TYPE__EXTENSION: return ((InternalEList)getExtension()).basicRemove(otherEnd, msgs); case tdlPackage.STRUCTURED_DATA_TYPE__MEMBER: @@ -196,8 +312,7 @@ public class StructuredDataTypeImpl extends DataTypeImpl implements StructuredDa @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.STRUCTURED_DATA_TYPE__EXTENSION: return getExtension(); case tdlPackage.STRUCTURED_DATA_TYPE__MEMBER: @@ -215,8 +330,7 @@ public class StructuredDataTypeImpl extends DataTypeImpl implements StructuredDa @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.STRUCTURED_DATA_TYPE__EXTENSION: getExtension().clear(); getExtension().addAll((Collection)newValue); @@ -237,8 +351,7 @@ public class StructuredDataTypeImpl extends DataTypeImpl implements StructuredDa @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.STRUCTURED_DATA_TYPE__EXTENSION: getExtension().clear(); return; @@ -257,8 +370,7 @@ public class StructuredDataTypeImpl extends DataTypeImpl implements StructuredDa @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.STRUCTURED_DATA_TYPE__EXTENSION: return extension != null && !extension.isEmpty(); case tdlPackage.STRUCTURED_DATA_TYPE__MEMBER: @@ -275,10 +387,8 @@ public class StructuredDataTypeImpl extends DataTypeImpl implements StructuredDa @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == DataType.class) - { - switch (baseOperationID) - { + if (baseClass == DataType.class) { + switch (baseOperationID) { case tdlPackage.DATA_TYPE___ALL_CONSTRAINTS: return tdlPackage.STRUCTURED_DATA_TYPE___ALL_CONSTRAINTS; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -294,8 +404,7 @@ public class StructuredDataTypeImpl extends DataTypeImpl implements StructuredDa @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.STRUCTURED_DATA_TYPE___ALL_MEMBERS: return allMembers(); case tdlPackage.STRUCTURED_DATA_TYPE___ALL_CONSTRAINTS: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TargetImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TargetImpl.java index cc8e475b..e3203ee8 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TargetImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TargetImpl.java @@ -87,12 +87,10 @@ public class TargetImpl extends ElementImpl implements Target @Override public GateReference getTargetGate() { - if (targetGate != null && targetGate.eIsProxy()) - { + if (targetGate != null && targetGate.eIsProxy()) { InternalEObject oldTargetGate = (InternalEObject)targetGate; targetGate = (GateReference)eResolveProxy(oldTargetGate); - if (targetGate != oldTargetGate) - { + if (targetGate != oldTargetGate) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.TARGET__TARGET_GATE, oldTargetGate, targetGate)); } @@ -132,8 +130,7 @@ public class TargetImpl extends ElementImpl implements Target @Override public EList getValueAssignment() { - if (valueAssignment == null) - { + if (valueAssignment == null) { valueAssignment = new EObjectContainmentEList(ValueAssignment.class, this, tdlPackage.TARGET__VALUE_ASSIGNMENT); } return valueAssignment; @@ -147,8 +144,7 @@ public class TargetImpl extends ElementImpl implements Target @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TARGET__VALUE_ASSIGNMENT: return ((InternalEList)getValueAssignment()).basicRemove(otherEnd, msgs); } @@ -163,8 +159,7 @@ public class TargetImpl extends ElementImpl implements Target @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TARGET__TARGET_GATE: if (resolve) return getTargetGate(); return basicGetTargetGate(); @@ -183,8 +178,7 @@ public class TargetImpl extends ElementImpl implements Target @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TARGET__TARGET_GATE: setTargetGate((GateReference)newValue); return; @@ -204,8 +198,7 @@ public class TargetImpl extends ElementImpl implements Target @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TARGET__TARGET_GATE: setTargetGate((GateReference)null); return; @@ -224,8 +217,7 @@ public class TargetImpl extends ElementImpl implements Target @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TARGET__TARGET_GATE: return targetGate != null; case tdlPackage.TARGET__VALUE_ASSIGNMENT: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TestConfigurationImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TestConfigurationImpl.java index 63c04bc7..490a301f 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TestConfigurationImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TestConfigurationImpl.java @@ -6,24 +6,33 @@ import java.lang.reflect.InvocationTargetException; import java.util.Collection; +import java.util.Iterator; +import java.util.List; import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.BasicEList; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.library.collection.CollectionIsEmptyOperation; +import org.eclipse.ocl.pivot.messages.PivotMessages; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.SetValue; +import org.eclipse.ocl.pivot.values.SetValue.Accumulator; import org.etsi.mts.tdl.ComponentInstance; import org.etsi.mts.tdl.ComponentInstanceBinding; import org.etsi.mts.tdl.Connection; +import org.etsi.mts.tdl.GateInstance; +import org.etsi.mts.tdl.GateReference; import org.etsi.mts.tdl.TestConfiguration; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -90,8 +99,7 @@ public class TestConfigurationImpl extends PackageableElementImpl implements Tes @Override public EList getComponentInstance() { - if (componentInstance == null) - { + if (componentInstance == null) { componentInstance = new EObjectContainmentEList(ComponentInstance.class, this, tdlPackage.TEST_CONFIGURATION__COMPONENT_INSTANCE); } return componentInstance; @@ -105,39 +113,348 @@ public class TestConfigurationImpl extends PackageableElementImpl implements Tes @Override public EList getConnection() { - if (connection == null) - { + if (connection == null) { connection = new EObjectContainmentEList(Connection.class, this, tdlPackage.TEST_CONFIGURATION__CONNECTION); } return connection; } - /** - * The cached invocation delegate for the '{@link #compatibleWith(org.etsi.mts.tdl.TestConfiguration, org.eclipse.emf.common.util.EList) Compatible With}' operation. - * - * - * @see #compatibleWith(org.etsi.mts.tdl.TestConfiguration, org.eclipse.emf.common.util.EList) - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate COMPATIBLE_WITH_TEST_CONFIGURATION_ELIST__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.TEST_CONFIGURATION___COMPATIBLE_WITH__TESTCONFIGURATION_ELIST).getInvocationDelegate(); - /** * * * @generated */ @Override - public boolean compatibleWith(TestConfiguration tc, EList cb) + public boolean compatibleWith(final TestConfiguration tc, final EList cb) { - try - { - return (Boolean)COMPATIBLE_WITH_TEST_CONFIGURATION_ELIST__EINVOCATION_DELEGATE.dynamicInvoke(this, new BasicEList.UnmodifiableEList(2, new Object[]{tc, cb})); + /** + * + * self.componentInstance->forAll(c | + * cb->exists(formalComponent = c)) and + * self.connection->forAll(c1 | + * tc.connection->exists(c2 | + * c1.endPoint->reject(ep1 | + * c2.endPoint->exists(ep2 | + * cb->any(formalComponent = ep1.component).actualComponent = ep2.component and ep1.gate = ep2.gate)) + * ->isEmpty())) + */ + assert cb != null; + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + /*@Caught*/ Object CAUGHT_forAll; + try { + final /*@NonInvalid*/ List componentInstance = this.getComponentInstance(); + final /*@NonInvalid*/ SetValue BOXED_componentInstance = idResolver.createSetOfAll(tdlTables.SET_CLSSid_ComponentInstance, componentInstance); + /*@Thrown*/ Object accumulator = ValueUtil.TRUE_VALUE; + Iterator ITERATOR_c = BOXED_componentInstance.iterator(); + /*@Thrown*/ Boolean forAll; + while (true) { + if (!ITERATOR_c.hasNext()) { + if (accumulator == null) { + forAll = null; + } + else if (accumulator == ValueUtil.TRUE_VALUE) { + forAll = ValueUtil.TRUE_VALUE; + } + else { + throw (InvalidValueException)accumulator; + } + break; + } + /*@NonInvalid*/ ComponentInstance c = (ComponentInstance)ITERATOR_c.next(); + /** + * cb->exists(formalComponent = c) + */ + final /*@NonInvalid*/ SetValue BOXED_cb = idResolver.createSetOfAll(tdlTables.SET_CLSSid_ComponentInstanceBinding, cb); + /*@Thrown*/ Object accumulator_0 = ValueUtil.FALSE_VALUE; + Iterator ITERATOR__1 = BOXED_cb.iterator(); + /*@NonInvalid*/ Boolean exists; + while (true) { + if (!ITERATOR__1.hasNext()) { + if (accumulator_0 == ValueUtil.FALSE_VALUE) { + exists = ValueUtil.FALSE_VALUE; + } + else { + throw (InvalidValueException)accumulator_0; + } + break; + } + /*@NonInvalid*/ ComponentInstanceBinding _1 = (ComponentInstanceBinding)ITERATOR__1.next(); + /** + * formalComponent = c + */ + final /*@NonInvalid*/ ComponentInstance formalComponent = _1.getFormalComponent(); + final /*@NonInvalid*/ boolean eq = formalComponent.equals(c); + // + if (eq) { // Normal successful body evaluation result + exists = ValueUtil.TRUE_VALUE; + break; // Stop immediately + } + else if (!eq) { // Normal unsuccessful body evaluation result + ; // Carry on + } + else { // Impossible badly typed result + accumulator_0 = new InvalidValueException(PivotMessages.NonBooleanBody, "exists"); + } + } + // + if (exists == ValueUtil.FALSE_VALUE) { // Normal unsuccessful body evaluation result + forAll = ValueUtil.FALSE_VALUE; + break; // Stop immediately + } + else if (exists == ValueUtil.TRUE_VALUE) { // Normal successful body evaluation result + ; // Carry on + } + else if (exists == null) { // Abnormal null body evaluation result + if (accumulator == ValueUtil.TRUE_VALUE) { + accumulator = null; // Cache a null failure + } + } + else { // Impossible badly typed result + accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "forAll"); + } + } + CAUGHT_forAll = forAll; + } + catch (Exception e) { + CAUGHT_forAll = ValueUtil.createInvalidValue(e); + } + final /*@Thrown*/ Boolean and_0; + if (CAUGHT_forAll == ValueUtil.FALSE_VALUE) { + and_0 = ValueUtil.FALSE_VALUE; + } + else { + /*@Caught*/ Object CAUGHT_forAll_0; + try { + final /*@NonInvalid*/ List connection = this.getConnection(); + final /*@NonInvalid*/ SetValue BOXED_connection = idResolver.createSetOfAll(tdlTables.SET_CLSSid_Connection, connection); + /*@Thrown*/ Object accumulator_1 = ValueUtil.TRUE_VALUE; + Iterator ITERATOR_c1 = BOXED_connection.iterator(); + /*@Thrown*/ Boolean forAll_0; + while (true) { + if (!ITERATOR_c1.hasNext()) { + if (accumulator_1 == null) { + forAll_0 = null; + } + else if (accumulator_1 == ValueUtil.TRUE_VALUE) { + forAll_0 = ValueUtil.TRUE_VALUE; + } + else { + throw (InvalidValueException)accumulator_1; + } + break; + } + /*@NonInvalid*/ Connection c1 = (Connection)ITERATOR_c1.next(); + /** + * + * tc.connection->exists(c2 | + * c1.endPoint->reject(ep1 | + * c2.endPoint->exists(ep2 | + * cb->any(formalComponent = ep1.component).actualComponent = ep2.component and ep1.gate = ep2.gate)) + * ->isEmpty()) + */ + /*@Caught*/ Object CAUGHT_exists_0; + try { + final /*@NonInvalid*/ List connection_0 = tc.getConnection(); + final /*@NonInvalid*/ SetValue BOXED_connection_0 = idResolver.createSetOfAll(tdlTables.SET_CLSSid_Connection, connection_0); + /*@Thrown*/ Object accumulator_2 = ValueUtil.FALSE_VALUE; + Iterator ITERATOR_c2 = BOXED_connection_0.iterator(); + /*@Thrown*/ Boolean exists_0; + while (true) { + if (!ITERATOR_c2.hasNext()) { + if (accumulator_2 == ValueUtil.FALSE_VALUE) { + exists_0 = ValueUtil.FALSE_VALUE; + } + else { + throw (InvalidValueException)accumulator_2; + } + break; + } + /*@NonInvalid*/ Connection c2 = (Connection)ITERATOR_c2.next(); + /** + * + * c1.endPoint->reject(ep1 | + * c2.endPoint->exists(ep2 | + * cb->any(formalComponent = ep1.component).actualComponent = ep2.component and ep1.gate = ep2.gate)) + * ->isEmpty() + */ + /*@Caught*/ Object CAUGHT_isEmpty; + try { + final /*@NonInvalid*/ List endPoint = c1.getEndPoint(); + final /*@NonInvalid*/ SetValue BOXED_endPoint = idResolver.createSetOfAll(tdlTables.SET_CLSSid_GateReference, endPoint); + /*@Thrown*/ Accumulator accumulator_3 = ValueUtil.createSetAccumulatorValue(tdlTables.SET_CLSSid_GateReference); + Iterator ITERATOR_ep1 = BOXED_endPoint.iterator(); + /*@Thrown*/ SetValue reject; + while (true) { + if (!ITERATOR_ep1.hasNext()) { + reject = accumulator_3; + break; + } + /*@NonInvalid*/ GateReference ep1 = (GateReference)ITERATOR_ep1.next(); + /** + * + * c2.endPoint->exists(ep2 | + * cb->any(formalComponent = ep1.component).actualComponent = ep2.component and ep1.gate = ep2.gate) + */ + final /*@NonInvalid*/ List endPoint_0 = c2.getEndPoint(); + final /*@NonInvalid*/ SetValue BOXED_endPoint_0 = idResolver.createSetOfAll(tdlTables.SET_CLSSid_GateReference, endPoint_0); + /*@Thrown*/ Object accumulator_4 = ValueUtil.FALSE_VALUE; + Iterator ITERATOR_ep2 = BOXED_endPoint_0.iterator(); + /*@Thrown*/ Boolean exists_1; + while (true) { + if (!ITERATOR_ep2.hasNext()) { + if (accumulator_4 == null) { + exists_1 = null; + } + else if (accumulator_4 == ValueUtil.FALSE_VALUE) { + exists_1 = ValueUtil.FALSE_VALUE; + } + else { + throw (InvalidValueException)accumulator_4; + } + break; + } + /*@NonInvalid*/ GateReference ep2 = (GateReference)ITERATOR_ep2.next(); + /** + * + * cb->any(formalComponent = ep1.component).actualComponent = ep2.component and ep1.gate = ep2.gate + */ + final /*@NonInvalid*/ SetValue BOXED_cb_0 = idResolver.createSetOfAll(tdlTables.SET_CLSSid_ComponentInstanceBinding, cb); + Iterator ITERATOR__1_0 = BOXED_cb_0.iterator(); + /*@NonInvalid*/ ComponentInstanceBinding any; + while (true) { + if (!ITERATOR__1_0.hasNext()) { + throw new InvalidValueException("Nothing to return for ''any''"); + } + /*@NonInvalid*/ ComponentInstanceBinding _1_0 = (ComponentInstanceBinding)ITERATOR__1_0.next(); + /** + * formalComponent = ep1.component + */ + final /*@NonInvalid*/ ComponentInstance formalComponent_0 = _1_0.getFormalComponent(); + final /*@NonInvalid*/ ComponentInstance component = ep1.getComponent(); + final /*@NonInvalid*/ boolean eq_0 = formalComponent_0.equals(component); + // + if (eq_0) { // Carry on till something found + any = _1_0; + break; + } + } + final /*@NonInvalid*/ ComponentInstance actualComponent = any.getActualComponent(); + final /*@NonInvalid*/ ComponentInstance component_0 = ep2.getComponent(); + final /*@NonInvalid*/ boolean eq_1 = actualComponent.equals(component_0); + final /*@NonInvalid*/ Boolean and; + if (!eq_1) { + and = ValueUtil.FALSE_VALUE; + } + else { + final /*@NonInvalid*/ GateInstance gate = ep1.getGate(); + final /*@NonInvalid*/ GateInstance gate_0 = ep2.getGate(); + final /*@NonInvalid*/ boolean eq_2 = gate.equals(gate_0); + if (!eq_2) { + and = ValueUtil.FALSE_VALUE; + } + else { + and = ValueUtil.TRUE_VALUE; + } + } + // + if (and == ValueUtil.TRUE_VALUE) { // Normal successful body evaluation result + exists_1 = ValueUtil.TRUE_VALUE; + break; // Stop immediately + } + else if (and == ValueUtil.FALSE_VALUE) { // Normal unsuccessful body evaluation result + ; // Carry on + } + else if (and == null) { // Abnormal null body evaluation result + if (accumulator_4 == ValueUtil.FALSE_VALUE) { + accumulator_4 = null; // Cache a null failure + } + } + else { // Impossible badly typed result + accumulator_4 = new InvalidValueException(PivotMessages.NonBooleanBody, "exists"); + } + } + if (exists_1 == null) { + throw new InvalidValueException("Null body for \'Set(T).reject(Set.T[?] | Lambda T() : Boolean[1]) : Set(T)\'"); + } + // + if (exists_1 == ValueUtil.FALSE_VALUE) { + accumulator_3.add(ep1); + } + } + final /*@Thrown*/ boolean isEmpty = CollectionIsEmptyOperation.INSTANCE.evaluate(reject).booleanValue(); + CAUGHT_isEmpty = isEmpty; + } + catch (Exception e) { + CAUGHT_isEmpty = ValueUtil.createInvalidValue(e); + } + // + if (CAUGHT_isEmpty == ValueUtil.TRUE_VALUE) { // Normal successful body evaluation result + exists_0 = ValueUtil.TRUE_VALUE; + break; // Stop immediately + } + else if (CAUGHT_isEmpty == ValueUtil.FALSE_VALUE) { // Normal unsuccessful body evaluation result + ; // Carry on + } + else if (CAUGHT_isEmpty instanceof InvalidValueException) { // Abnormal exception evaluation result + accumulator_2 = CAUGHT_isEmpty; // Cache an exception failure + } + else { // Impossible badly typed result + accumulator_2 = new InvalidValueException(PivotMessages.NonBooleanBody, "exists"); + } + } + CAUGHT_exists_0 = exists_0; + } + catch (Exception e) { + CAUGHT_exists_0 = ValueUtil.createInvalidValue(e); + } + // + if (CAUGHT_exists_0 == ValueUtil.FALSE_VALUE) { // Normal unsuccessful body evaluation result + forAll_0 = ValueUtil.FALSE_VALUE; + break; // Stop immediately + } + else if (CAUGHT_exists_0 == ValueUtil.TRUE_VALUE) { // Normal successful body evaluation result + ; // Carry on + } + else if (CAUGHT_exists_0 == null) { // Abnormal null body evaluation result + if (accumulator_1 == ValueUtil.TRUE_VALUE) { + accumulator_1 = null; // Cache a null failure + } + } + else if (CAUGHT_exists_0 instanceof InvalidValueException) { // Abnormal exception evaluation result + accumulator_1 = CAUGHT_exists_0; // Cache an exception failure + } + else { // Impossible badly typed result + accumulator_1 = new InvalidValueException(PivotMessages.NonBooleanBody, "forAll"); + } + } + CAUGHT_forAll_0 = forAll_0; + } + catch (Exception e) { + CAUGHT_forAll_0 = ValueUtil.createInvalidValue(e); + } + if (CAUGHT_forAll_0 == ValueUtil.FALSE_VALUE) { + and_0 = ValueUtil.FALSE_VALUE; + } + else { + if (CAUGHT_forAll instanceof InvalidValueException) { + throw (InvalidValueException)CAUGHT_forAll; + } + if (CAUGHT_forAll_0 instanceof InvalidValueException) { + throw (InvalidValueException)CAUGHT_forAll_0; + } + if ((CAUGHT_forAll == null) || (CAUGHT_forAll_0 == null)) { + and_0 = null; + } + else { + and_0 = ValueUtil.TRUE_VALUE; + } + } } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + if (and_0 == null) { + throw new InvalidValueException("Null body for \'tdl::TestConfiguration::compatibleWith(tdl::TestConfiguration[1],Set(tdl::ComponentInstanceBinding)) : Boolean[1]\'"); } + return and_0; } /** @@ -148,8 +465,7 @@ public class TestConfigurationImpl extends PackageableElementImpl implements Tes @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TEST_CONFIGURATION__COMPONENT_INSTANCE: return ((InternalEList)getComponentInstance()).basicRemove(otherEnd, msgs); case tdlPackage.TEST_CONFIGURATION__CONNECTION: @@ -166,8 +482,7 @@ public class TestConfigurationImpl extends PackageableElementImpl implements Tes @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TEST_CONFIGURATION__COMPONENT_INSTANCE: return getComponentInstance(); case tdlPackage.TEST_CONFIGURATION__CONNECTION: @@ -185,8 +500,7 @@ public class TestConfigurationImpl extends PackageableElementImpl implements Tes @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TEST_CONFIGURATION__COMPONENT_INSTANCE: getComponentInstance().clear(); getComponentInstance().addAll((Collection)newValue); @@ -207,8 +521,7 @@ public class TestConfigurationImpl extends PackageableElementImpl implements Tes @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TEST_CONFIGURATION__COMPONENT_INSTANCE: getComponentInstance().clear(); return; @@ -227,8 +540,7 @@ public class TestConfigurationImpl extends PackageableElementImpl implements Tes @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TEST_CONFIGURATION__COMPONENT_INSTANCE: return componentInstance != null && !componentInstance.isEmpty(); case tdlPackage.TEST_CONFIGURATION__CONNECTION: @@ -246,8 +558,7 @@ public class TestConfigurationImpl extends PackageableElementImpl implements Tes @SuppressWarnings("unchecked") public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.TEST_CONFIGURATION___COMPATIBLE_WITH__TESTCONFIGURATION_ELIST: return compatibleWith((TestConfiguration)arguments.get(0), (EList)arguments.get(1)); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TestDescriptionImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TestDescriptionImpl.java index 1290fc89..9a7c2a41 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TestDescriptionImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TestDescriptionImpl.java @@ -133,12 +133,10 @@ public class TestDescriptionImpl extends PackageableElementImpl implements TestD @Override public TestConfiguration getTestConfiguration() { - if (testConfiguration != null && testConfiguration.eIsProxy()) - { + if (testConfiguration != null && testConfiguration.eIsProxy()) { InternalEObject oldTestConfiguration = (InternalEObject)testConfiguration; testConfiguration = (TestConfiguration)eResolveProxy(oldTestConfiguration); - if (testConfiguration != oldTestConfiguration) - { + if (testConfiguration != oldTestConfiguration) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.TEST_DESCRIPTION__TEST_CONFIGURATION, oldTestConfiguration, testConfiguration)); } @@ -178,8 +176,7 @@ public class TestDescriptionImpl extends PackageableElementImpl implements TestD @Override public EList getFormalParameter() { - if (formalParameter == null) - { + if (formalParameter == null) { formalParameter = new EObjectContainmentEList(FormalParameter.class, this, tdlPackage.TEST_DESCRIPTION__FORMAL_PARAMETER); } return formalParameter; @@ -205,8 +202,7 @@ public class TestDescriptionImpl extends PackageableElementImpl implements TestD { BehaviourDescription oldBehaviourDescription = behaviourDescription; behaviourDescription = newBehaviourDescription; - if (eNotificationRequired()) - { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, tdlPackage.TEST_DESCRIPTION__BEHAVIOUR_DESCRIPTION, oldBehaviourDescription, newBehaviourDescription); if (msgs == null) msgs = notification; else msgs.add(notification); } @@ -221,8 +217,7 @@ public class TestDescriptionImpl extends PackageableElementImpl implements TestD @Override public void setBehaviourDescription(BehaviourDescription newBehaviourDescription) { - if (newBehaviourDescription != behaviourDescription) - { + if (newBehaviourDescription != behaviourDescription) { NotificationChain msgs = null; if (behaviourDescription != null) msgs = ((InternalEObject)behaviourDescription).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - tdlPackage.TEST_DESCRIPTION__BEHAVIOUR_DESCRIPTION, null, msgs); @@ -243,8 +238,7 @@ public class TestDescriptionImpl extends PackageableElementImpl implements TestD @Override public EList getTestObjective() { - if (testObjective == null) - { + if (testObjective == null) { testObjective = new EObjectResolvingEList(TestObjective.class, this, tdlPackage.TEST_DESCRIPTION__TEST_OBJECTIVE); } return testObjective; @@ -283,8 +277,7 @@ public class TestDescriptionImpl extends PackageableElementImpl implements TestD @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TEST_DESCRIPTION__FORMAL_PARAMETER: return ((InternalEList)getFormalParameter()).basicRemove(otherEnd, msgs); case tdlPackage.TEST_DESCRIPTION__BEHAVIOUR_DESCRIPTION: @@ -301,8 +294,7 @@ public class TestDescriptionImpl extends PackageableElementImpl implements TestD @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TEST_DESCRIPTION__TEST_CONFIGURATION: if (resolve) return getTestConfiguration(); return basicGetTestConfiguration(); @@ -327,8 +319,7 @@ public class TestDescriptionImpl extends PackageableElementImpl implements TestD @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TEST_DESCRIPTION__TEST_CONFIGURATION: setTestConfiguration((TestConfiguration)newValue); return; @@ -358,8 +349,7 @@ public class TestDescriptionImpl extends PackageableElementImpl implements TestD @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TEST_DESCRIPTION__TEST_CONFIGURATION: setTestConfiguration((TestConfiguration)null); return; @@ -387,8 +377,7 @@ public class TestDescriptionImpl extends PackageableElementImpl implements TestD @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TEST_DESCRIPTION__TEST_CONFIGURATION: return testConfiguration != null; case tdlPackage.TEST_DESCRIPTION__FORMAL_PARAMETER: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TestDescriptionReferenceImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TestDescriptionReferenceImpl.java index df35bdde..786f093e 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TestDescriptionReferenceImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TestDescriptionReferenceImpl.java @@ -6,14 +6,13 @@ import java.lang.reflect.InvocationTargetException; import java.util.Collection; +import java.util.Iterator; +import java.util.List; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; @@ -21,14 +20,30 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.ids.IdResolver.IdResolverExtension; +import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; +import org.eclipse.ocl.pivot.library.collection.CollectionIsEmptyOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsSetOperation; +import org.eclipse.ocl.pivot.messages.PivotMessages; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.BagValue; +import org.eclipse.ocl.pivot.values.BagValue.Accumulator; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SetValue; import org.etsi.mts.tdl.AtomicBehaviour; import org.etsi.mts.tdl.Behaviour; import org.etsi.mts.tdl.ComponentInstance; import org.etsi.mts.tdl.ComponentInstanceBinding; import org.etsi.mts.tdl.ParameterBinding; +import org.etsi.mts.tdl.TestConfiguration; import org.etsi.mts.tdl.TestDescription; import org.etsi.mts.tdl.TestDescriptionReference; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -106,12 +121,10 @@ public class TestDescriptionReferenceImpl extends AtomicBehaviourImpl implements @Override public TestDescription getTestDescription() { - if (testDescription != null && testDescription.eIsProxy()) - { + if (testDescription != null && testDescription.eIsProxy()) { InternalEObject oldTestDescription = (InternalEObject)testDescription; testDescription = (TestDescription)eResolveProxy(oldTestDescription); - if (testDescription != oldTestDescription) - { + if (testDescription != oldTestDescription) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.TEST_DESCRIPTION_REFERENCE__TEST_DESCRIPTION, oldTestDescription, testDescription)); } @@ -151,8 +164,7 @@ public class TestDescriptionReferenceImpl extends AtomicBehaviourImpl implements @Override public EList getComponentInstanceBinding() { - if (componentInstanceBinding == null) - { + if (componentInstanceBinding == null) { componentInstanceBinding = new EObjectContainmentEList(ComponentInstanceBinding.class, this, tdlPackage.TEST_DESCRIPTION_REFERENCE__COMPONENT_INSTANCE_BINDING); } return componentInstanceBinding; @@ -166,23 +178,12 @@ public class TestDescriptionReferenceImpl extends AtomicBehaviourImpl implements @Override public EList getArgument() { - if (argument == null) - { + if (argument == null) { argument = new EObjectContainmentEList(ParameterBinding.class, this, tdlPackage.TEST_DESCRIPTION_REFERENCE__ARGUMENT); } return argument; } - /** - * The cached invocation delegate for the '{@link #getParticipatingComponents() Get Participating Components}' operation. - * - * - * @see #getParticipatingComponents() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.TEST_DESCRIPTION_REFERENCE___GET_PARTICIPATING_COMPONENTS).getInvocationDelegate(); - /** * * @@ -192,14 +193,117 @@ public class TestDescriptionReferenceImpl extends AtomicBehaviourImpl implements @Override public EList getParticipatingComponents() { - try - { - return (EList)GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if + * self.getParentTestDescription() + * ->exists(td | td.isLocallyOrdered) and + * not self.componentInstanceBinding->isEmpty() + * then self.componentInstanceBinding.actualComponent->asOrderedSet() + * else + * self.getParentTestDescription() + * .testConfiguration.componentInstance->asOrderedSet() + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ List componentInstanceBinding_0 = this.getComponentInstanceBinding(); + final /*@NonInvalid*/ TestDescription getParentTestDescription_0 = this.getParentTestDescription(); + final /*@NonInvalid*/ SetValue BOXED_componentInstanceBinding_0 = idResolver.createSetOfAll(tdlTables.SET_CLSSid_ComponentInstanceBinding, componentInstanceBinding_0); + final /*@NonInvalid*/ SetValue oclAsSet = OclAnyOclAsSetOperation.INSTANCE.evaluate(executor, tdlTables.SET_CLSSid_TestDescription, getParentTestDescription_0); + /*@Thrown*/ Object accumulator = ValueUtil.FALSE_VALUE; + Iterator ITERATOR_td = oclAsSet.iterator(); + /*@NonInvalid*/ Boolean exists; + while (true) { + if (!ITERATOR_td.hasNext()) { + if (accumulator == ValueUtil.FALSE_VALUE) { + exists = ValueUtil.FALSE_VALUE; + } + else { + throw (InvalidValueException)accumulator; + } + break; + } + /*@NonInvalid*/ TestDescription td = (TestDescription)ITERATOR_td.next(); + /** + * td.isLocallyOrdered + */ + final /*@NonInvalid*/ boolean isLocallyOrdered = td.isIsLocallyOrdered(); + // + if (isLocallyOrdered) { // Normal successful body evaluation result + exists = ValueUtil.TRUE_VALUE; + break; // Stop immediately + } + else if (!isLocallyOrdered) { // Normal unsuccessful body evaluation result + ; // Carry on + } + else { // Impossible badly typed result + accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "exists"); + } + } + final /*@Thrown*/ Boolean and; + if (exists == ValueUtil.FALSE_VALUE) { + and = ValueUtil.FALSE_VALUE; + } + else { + final /*@NonInvalid*/ boolean isEmpty = CollectionIsEmptyOperation.INSTANCE.evaluate(BOXED_componentInstanceBinding_0).booleanValue(); + final /*@NonInvalid*/ Boolean not; + if (!isEmpty) { + not = ValueUtil.TRUE_VALUE; + } + else { + if (isEmpty) { + not = ValueUtil.FALSE_VALUE; + } + else { + not = null; + } + } + if (not == ValueUtil.FALSE_VALUE) { + and = ValueUtil.FALSE_VALUE; + } + else { + if ((exists == null) || (not == null)) { + and = null; + } + else { + and = ValueUtil.TRUE_VALUE; + } + } + } + if (and == null) { + throw new InvalidValueException("Null if condition"); + } + /*@NonInvalid*/ OrderedSetValue local_0; + if (and) { + /*@Thrown*/ Accumulator accumulator_0 = ValueUtil.createBagAccumulatorValue(tdlTables.BAG_CLSSid_ComponentInstance); + Iterator ITERATOR__1 = BOXED_componentInstanceBinding_0.iterator(); + /*@NonInvalid*/ BagValue collect; + while (true) { + if (!ITERATOR__1.hasNext()) { + collect = accumulator_0; + break; + } + /*@NonInvalid*/ ComponentInstanceBinding _1 = (ComponentInstanceBinding)ITERATOR__1.next(); + /** + * actualComponent + */ + final /*@NonInvalid*/ ComponentInstance actualComponent = _1.getActualComponent(); + // + accumulator_0.add(actualComponent); + } + final /*@NonInvalid*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(collect); + local_0 = asOrderedSet; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + final /*@NonInvalid*/ TestConfiguration testConfiguration = getParentTestDescription_0.getTestConfiguration(); + final /*@NonInvalid*/ List componentInstance = testConfiguration.getComponentInstance(); + final /*@NonInvalid*/ SetValue BOXED_componentInstance = idResolver.createSetOfAll(tdlTables.SET_CLSSid_ComponentInstance, componentInstance); + final /*@NonInvalid*/ OrderedSetValue asOrderedSet_0 = CollectionAsOrderedSetOperation.INSTANCE.evaluate(BOXED_componentInstance); + local_0 = asOrderedSet_0; } + final /*@NonInvalid*/ List ECORE_local_0 = ((IdResolverExtension)idResolver).ecoreValueOfAll(ComponentInstance.class, local_0); + return (EList)ECORE_local_0; } /** @@ -210,8 +314,7 @@ public class TestDescriptionReferenceImpl extends AtomicBehaviourImpl implements @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TEST_DESCRIPTION_REFERENCE__COMPONENT_INSTANCE_BINDING: return ((InternalEList)getComponentInstanceBinding()).basicRemove(otherEnd, msgs); case tdlPackage.TEST_DESCRIPTION_REFERENCE__ARGUMENT: @@ -228,8 +331,7 @@ public class TestDescriptionReferenceImpl extends AtomicBehaviourImpl implements @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TEST_DESCRIPTION_REFERENCE__TEST_DESCRIPTION: if (resolve) return getTestDescription(); return basicGetTestDescription(); @@ -250,8 +352,7 @@ public class TestDescriptionReferenceImpl extends AtomicBehaviourImpl implements @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TEST_DESCRIPTION_REFERENCE__TEST_DESCRIPTION: setTestDescription((TestDescription)newValue); return; @@ -275,8 +376,7 @@ public class TestDescriptionReferenceImpl extends AtomicBehaviourImpl implements @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TEST_DESCRIPTION_REFERENCE__TEST_DESCRIPTION: setTestDescription((TestDescription)null); return; @@ -298,8 +398,7 @@ public class TestDescriptionReferenceImpl extends AtomicBehaviourImpl implements @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TEST_DESCRIPTION_REFERENCE__TEST_DESCRIPTION: return testDescription != null; case tdlPackage.TEST_DESCRIPTION_REFERENCE__COMPONENT_INSTANCE_BINDING: @@ -318,18 +417,14 @@ public class TestDescriptionReferenceImpl extends AtomicBehaviourImpl implements @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == Behaviour.class) - { - switch (baseOperationID) - { + if (baseClass == Behaviour.class) { + switch (baseOperationID) { case tdlPackage.BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return tdlPackage.TEST_DESCRIPTION_REFERENCE___GET_PARTICIPATING_COMPONENTS; default: return super.eDerivedOperationID(baseOperationID, baseClass); } } - if (baseClass == AtomicBehaviour.class) - { - switch (baseOperationID) - { + if (baseClass == AtomicBehaviour.class) { + switch (baseOperationID) { case tdlPackage.ATOMIC_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return tdlPackage.TEST_DESCRIPTION_REFERENCE___GET_PARTICIPATING_COMPONENTS; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -345,8 +440,7 @@ public class TestDescriptionReferenceImpl extends AtomicBehaviourImpl implements @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.TEST_DESCRIPTION_REFERENCE___GET_PARTICIPATING_COMPONENTS: return getParticipatingComponents(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TestObjectiveImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TestObjectiveImpl.java index 39065b53..bbf2a029 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TestObjectiveImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TestObjectiveImpl.java @@ -92,8 +92,7 @@ public class TestObjectiveImpl extends PackageableElementImpl implements TestObj @Override public EList getObjectiveURI() { - if (objectiveURI == null) - { + if (objectiveURI == null) { objectiveURI = new EDataTypeEList(String.class, this, tdlPackage.TEST_OBJECTIVE__OBJECTIVE_URI); } return objectiveURI; @@ -132,8 +131,7 @@ public class TestObjectiveImpl extends PackageableElementImpl implements TestObj @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TEST_OBJECTIVE__OBJECTIVE_URI: return getObjectiveURI(); case tdlPackage.TEST_OBJECTIVE__DESCRIPTION: @@ -151,8 +149,7 @@ public class TestObjectiveImpl extends PackageableElementImpl implements TestObj @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TEST_OBJECTIVE__OBJECTIVE_URI: getObjectiveURI().clear(); getObjectiveURI().addAll((Collection)newValue); @@ -172,8 +169,7 @@ public class TestObjectiveImpl extends PackageableElementImpl implements TestObj @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TEST_OBJECTIVE__OBJECTIVE_URI: getObjectiveURI().clear(); return; @@ -192,8 +188,7 @@ public class TestObjectiveImpl extends PackageableElementImpl implements TestObj @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TEST_OBJECTIVE__OBJECTIVE_URI: return objectiveURI != null && !objectiveURI.isEmpty(); case tdlPackage.TEST_OBJECTIVE__DESCRIPTION: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TimeConstraintImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TimeConstraintImpl.java index fd080e5e..1bced9fa 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TimeConstraintImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TimeConstraintImpl.java @@ -80,8 +80,7 @@ public class TimeConstraintImpl extends ElementImpl implements TimeConstraint { DataUse oldTimeConstraintExpression = timeConstraintExpression; timeConstraintExpression = newTimeConstraintExpression; - if (eNotificationRequired()) - { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, tdlPackage.TIME_CONSTRAINT__TIME_CONSTRAINT_EXPRESSION, oldTimeConstraintExpression, newTimeConstraintExpression); if (msgs == null) msgs = notification; else msgs.add(notification); } @@ -96,8 +95,7 @@ public class TimeConstraintImpl extends ElementImpl implements TimeConstraint @Override public void setTimeConstraintExpression(DataUse newTimeConstraintExpression) { - if (newTimeConstraintExpression != timeConstraintExpression) - { + if (newTimeConstraintExpression != timeConstraintExpression) { NotificationChain msgs = null; if (timeConstraintExpression != null) msgs = ((InternalEObject)timeConstraintExpression).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - tdlPackage.TIME_CONSTRAINT__TIME_CONSTRAINT_EXPRESSION, null, msgs); @@ -118,8 +116,7 @@ public class TimeConstraintImpl extends ElementImpl implements TimeConstraint @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TIME_CONSTRAINT__TIME_CONSTRAINT_EXPRESSION: return basicSetTimeConstraintExpression(null, msgs); } @@ -134,8 +131,7 @@ public class TimeConstraintImpl extends ElementImpl implements TimeConstraint @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TIME_CONSTRAINT__TIME_CONSTRAINT_EXPRESSION: return getTimeConstraintExpression(); } @@ -150,8 +146,7 @@ public class TimeConstraintImpl extends ElementImpl implements TimeConstraint @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TIME_CONSTRAINT__TIME_CONSTRAINT_EXPRESSION: setTimeConstraintExpression((DataUse)newValue); return; @@ -167,8 +162,7 @@ public class TimeConstraintImpl extends ElementImpl implements TimeConstraint @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TIME_CONSTRAINT__TIME_CONSTRAINT_EXPRESSION: setTimeConstraintExpression((DataUse)null); return; @@ -184,8 +178,7 @@ public class TimeConstraintImpl extends ElementImpl implements TimeConstraint @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TIME_CONSTRAINT__TIME_CONSTRAINT_EXPRESSION: return timeConstraintExpression != null; } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TimeLabelUseImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TimeLabelUseImpl.java index 06456262..9b439bd0 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TimeLabelUseImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TimeLabelUseImpl.java @@ -7,20 +7,27 @@ import java.lang.reflect.InvocationTargetException; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.library.classifier.ClassifierAllInstancesOperation; +import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; +import org.eclipse.ocl.pivot.library.collection.OrderedCollectionFirstOperation; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SetValue; import org.etsi.mts.tdl.DataType; import org.etsi.mts.tdl.DataUse; +import org.etsi.mts.tdl.Time; import org.etsi.mts.tdl.TimeLabel; import org.etsi.mts.tdl.TimeLabelUse; import org.etsi.mts.tdl.TimeLabelUseKind; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -97,12 +104,10 @@ public class TimeLabelUseImpl extends DynamicDataUseImpl implements TimeLabelUse @Override public TimeLabel getTimeLabel() { - if (timeLabel != null && timeLabel.eIsProxy()) - { + if (timeLabel != null && timeLabel.eIsProxy()) { InternalEObject oldTimeLabel = (InternalEObject)timeLabel; timeLabel = (TimeLabel)eResolveProxy(oldTimeLabel); - if (timeLabel != oldTimeLabel) - { + if (timeLabel != oldTimeLabel) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.TIME_LABEL_USE__TIME_LABEL, oldTimeLabel, timeLabel)); } @@ -159,16 +164,6 @@ public class TimeLabelUseImpl extends DynamicDataUseImpl implements TimeLabelUse eNotify(new ENotificationImpl(this, Notification.SET, tdlPackage.TIME_LABEL_USE__KIND, oldKind, kind)); } - /** - * The cached invocation delegate for the '{@link #resolveDataType() Resolve Data Type}' operation. - * - * - * @see #resolveDataType() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate RESOLVE_DATA_TYPE__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.TIME_LABEL_USE___RESOLVE_DATA_TYPE).getInvocationDelegate(); - /** * * @@ -177,14 +172,16 @@ public class TimeLabelUseImpl extends DynamicDataUseImpl implements TimeLabelUse @Override public DataType resolveDataType() { - try - { - return (DataType)RESOLVE_DATA_TYPE__EINVOCATION_DELEGATE.dynamicInvoke(this, null); - } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); - } + /** + * Time.allInstances()->asOrderedSet()->first() + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_Time_0 = idResolver.getClass(tdlTables.CLSSid_Time, null); + final /*@NonInvalid*/ SetValue allInstances = ClassifierAllInstancesOperation.INSTANCE.evaluate(executor, tdlTables.SET_CLSSid_Time, TYP_tdl_c_c_Time_0); + final /*@NonInvalid*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(allInstances); + final /*@Thrown*/ Time first = (Time)OrderedCollectionFirstOperation.INSTANCE.evaluate(asOrderedSet); + return first; } /** @@ -195,8 +192,7 @@ public class TimeLabelUseImpl extends DynamicDataUseImpl implements TimeLabelUse @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TIME_LABEL_USE__TIME_LABEL: if (resolve) return getTimeLabel(); return basicGetTimeLabel(); @@ -214,8 +210,7 @@ public class TimeLabelUseImpl extends DynamicDataUseImpl implements TimeLabelUse @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TIME_LABEL_USE__TIME_LABEL: setTimeLabel((TimeLabel)newValue); return; @@ -234,8 +229,7 @@ public class TimeLabelUseImpl extends DynamicDataUseImpl implements TimeLabelUse @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TIME_LABEL_USE__TIME_LABEL: setTimeLabel((TimeLabel)null); return; @@ -254,8 +248,7 @@ public class TimeLabelUseImpl extends DynamicDataUseImpl implements TimeLabelUse @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TIME_LABEL_USE__TIME_LABEL: return timeLabel != null; case tdlPackage.TIME_LABEL_USE__KIND: @@ -272,10 +265,8 @@ public class TimeLabelUseImpl extends DynamicDataUseImpl implements TimeLabelUse @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == DataUse.class) - { - switch (baseOperationID) - { + if (baseClass == DataUse.class) { + switch (baseOperationID) { case tdlPackage.DATA_USE___RESOLVE_DATA_TYPE: return tdlPackage.TIME_LABEL_USE___RESOLVE_DATA_TYPE; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -291,8 +282,7 @@ public class TimeLabelUseImpl extends DynamicDataUseImpl implements TimeLabelUse @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.TIME_LABEL_USE___RESOLVE_DATA_TYPE: return resolveDataType(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TimeOperationImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TimeOperationImpl.java index 463b2261..4270058b 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TimeOperationImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TimeOperationImpl.java @@ -4,24 +4,41 @@ package org.etsi.mts.tdl.impl; import java.lang.reflect.InvocationTargetException; +import java.util.Iterator; +import java.util.List; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.ids.IdResolver.IdResolverExtension; +import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsSetOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsTypeOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsKindOfOperation; +import org.eclipse.ocl.pivot.messages.PivotMessages; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SetValue; import org.etsi.mts.tdl.AtomicBehaviour; import org.etsi.mts.tdl.Behaviour; +import org.etsi.mts.tdl.Block; import org.etsi.mts.tdl.ComponentInstance; import org.etsi.mts.tdl.DataUse; +import org.etsi.mts.tdl.Element; +import org.etsi.mts.tdl.TestConfiguration; +import org.etsi.mts.tdl.TestDescription; import org.etsi.mts.tdl.TimeOperation; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -88,12 +105,10 @@ public abstract class TimeOperationImpl extends AtomicBehaviourImpl implements T @Override public ComponentInstance getComponentInstance() { - if (componentInstance != null && componentInstance.eIsProxy()) - { + if (componentInstance != null && componentInstance.eIsProxy()) { InternalEObject oldComponentInstance = (InternalEObject)componentInstance; componentInstance = (ComponentInstance)eResolveProxy(oldComponentInstance); - if (componentInstance != oldComponentInstance) - { + if (componentInstance != oldComponentInstance) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.TIME_OPERATION__COMPONENT_INSTANCE, oldComponentInstance, componentInstance)); } @@ -145,8 +160,7 @@ public abstract class TimeOperationImpl extends AtomicBehaviourImpl implements T { DataUse oldPeriod = period; period = newPeriod; - if (eNotificationRequired()) - { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, tdlPackage.TIME_OPERATION__PERIOD, oldPeriod, newPeriod); if (msgs == null) msgs = notification; else msgs.add(notification); } @@ -161,8 +175,7 @@ public abstract class TimeOperationImpl extends AtomicBehaviourImpl implements T @Override public void setPeriod(DataUse newPeriod) { - if (newPeriod != period) - { + if (newPeriod != period) { NotificationChain msgs = null; if (period != null) msgs = ((InternalEObject)period).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - tdlPackage.TIME_OPERATION__PERIOD, null, msgs); @@ -175,16 +188,6 @@ public abstract class TimeOperationImpl extends AtomicBehaviourImpl implements T eNotify(new ENotificationImpl(this, Notification.SET, tdlPackage.TIME_OPERATION__PERIOD, newPeriod, newPeriod)); } - /** - * The cached invocation delegate for the '{@link #getParticipatingComponents() Get Participating Components}' operation. - * - * - * @see #getParticipatingComponents() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.TIME_OPERATION___GET_PARTICIPATING_COMPONENTS).getInvocationDelegate(); - /** * * @@ -194,14 +197,126 @@ public abstract class TimeOperationImpl extends AtomicBehaviourImpl implements T @Override public EList getParticipatingComponents() { - try - { - return (EList)GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if + * self.getParentTestDescription() + * ->exists(td | td.isLocallyOrdered) and + * self.container() + * .oclIsKindOf(Block) + * then + * if not self.componentInstance.oclIsUndefined() + * then OrderedSet{self.componentInstance} + * else + * self.container() + * .oclAsType(Block) + * .getParticipatingComponentsExcluding(self) + * ->asOrderedSet() + * endif + * else + * self.getParentTestDescription() + * .testConfiguration.componentInstance->asOrderedSet() + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_tdl_c_c_Block_0 = idResolver.getClass(tdlTables.CLSSid_Block, null); + final /*@NonInvalid*/ Element container = this.container(); + final /*@NonInvalid*/ TestDescription getParentTestDescription_0 = this.getParentTestDescription(); + final /*@NonInvalid*/ SetValue oclAsSet = OclAnyOclAsSetOperation.INSTANCE.evaluate(executor, tdlTables.SET_CLSSid_TestDescription, getParentTestDescription_0); + /*@Thrown*/ Object accumulator = ValueUtil.FALSE_VALUE; + Iterator ITERATOR_td = oclAsSet.iterator(); + /*@NonInvalid*/ Boolean exists; + while (true) { + if (!ITERATOR_td.hasNext()) { + if (accumulator == ValueUtil.FALSE_VALUE) { + exists = ValueUtil.FALSE_VALUE; + } + else { + throw (InvalidValueException)accumulator; + } + break; + } + /*@NonInvalid*/ TestDescription td = (TestDescription)ITERATOR_td.next(); + /** + * td.isLocallyOrdered + */ + final /*@NonInvalid*/ boolean isLocallyOrdered = td.isIsLocallyOrdered(); + // + if (isLocallyOrdered) { // Normal successful body evaluation result + exists = ValueUtil.TRUE_VALUE; + break; // Stop immediately + } + else if (!isLocallyOrdered) { // Normal unsuccessful body evaluation result + ; // Carry on + } + else { // Impossible badly typed result + accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "exists"); + } + } + final /*@Thrown*/ Boolean and; + if (exists == ValueUtil.FALSE_VALUE) { + and = ValueUtil.FALSE_VALUE; + } + else { + final /*@NonInvalid*/ boolean oclIsKindOf = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_Block_0).booleanValue(); + if (!oclIsKindOf) { + and = ValueUtil.FALSE_VALUE; + } + else { + if (exists == null) { + and = null; + } + else { + and = ValueUtil.TRUE_VALUE; + } + } + } + if (and == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ OrderedSetValue local_1; + if (and) { + final /*@NonInvalid*/ ComponentInstance componentInstance_0 = this.getComponentInstance(); + final /*@NonInvalid*/ boolean oclIsUndefined = componentInstance_0 == null; + final /*@NonInvalid*/ Boolean not; + if (!oclIsUndefined) { + not = ValueUtil.TRUE_VALUE; + } + else { + if (oclIsUndefined) { + not = ValueUtil.FALSE_VALUE; + } + else { + not = null; + } + } + if (not == null) { + throw new InvalidValueException("Null if condition"); + } + /*@Thrown*/ OrderedSetValue local_0; + if (not) { + final /*@NonInvalid*/ OrderedSetValue OrderedSet = ValueUtil.createOrderedSetOfEach(tdlTables.ORD_CLSSid_ComponentInstance, componentInstance_0); + local_0 = OrderedSet; + } + else { + final /*@Thrown*/ Block oclAsType = (Block)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, container, TYP_tdl_c_c_Block_0); + final /*@Thrown*/ List getParticipatingComponentsExcluding = oclAsType.getParticipatingComponentsExcluding(this); + final /*@Thrown*/ OrderedSetValue BOXED_getParticipatingComponentsExcluding = idResolver.createOrderedSetOfAll(tdlTables.ORD_CLSSid_ComponentInstance, getParticipatingComponentsExcluding); + final /*@Thrown*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(BOXED_getParticipatingComponentsExcluding); + local_0 = asOrderedSet; + } + local_1 = local_0; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + final /*@NonInvalid*/ TestConfiguration testConfiguration = getParentTestDescription_0.getTestConfiguration(); + final /*@NonInvalid*/ List componentInstance_1 = testConfiguration.getComponentInstance(); + final /*@NonInvalid*/ SetValue BOXED_componentInstance_1 = idResolver.createSetOfAll(tdlTables.SET_CLSSid_ComponentInstance, componentInstance_1); + final /*@NonInvalid*/ OrderedSetValue asOrderedSet_0 = CollectionAsOrderedSetOperation.INSTANCE.evaluate(BOXED_componentInstance_1); + local_1 = asOrderedSet_0; } + final /*@Thrown*/ List ECORE_local_1 = ((IdResolverExtension)idResolver).ecoreValueOfAll(ComponentInstance.class, local_1); + return (EList)ECORE_local_1; } /** @@ -212,8 +327,7 @@ public abstract class TimeOperationImpl extends AtomicBehaviourImpl implements T @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TIME_OPERATION__PERIOD: return basicSetPeriod(null, msgs); } @@ -228,8 +342,7 @@ public abstract class TimeOperationImpl extends AtomicBehaviourImpl implements T @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TIME_OPERATION__COMPONENT_INSTANCE: if (resolve) return getComponentInstance(); return basicGetComponentInstance(); @@ -247,8 +360,7 @@ public abstract class TimeOperationImpl extends AtomicBehaviourImpl implements T @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TIME_OPERATION__COMPONENT_INSTANCE: setComponentInstance((ComponentInstance)newValue); return; @@ -267,8 +379,7 @@ public abstract class TimeOperationImpl extends AtomicBehaviourImpl implements T @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TIME_OPERATION__COMPONENT_INSTANCE: setComponentInstance((ComponentInstance)null); return; @@ -287,8 +398,7 @@ public abstract class TimeOperationImpl extends AtomicBehaviourImpl implements T @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TIME_OPERATION__COMPONENT_INSTANCE: return componentInstance != null; case tdlPackage.TIME_OPERATION__PERIOD: @@ -305,18 +415,14 @@ public abstract class TimeOperationImpl extends AtomicBehaviourImpl implements T @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == Behaviour.class) - { - switch (baseOperationID) - { + if (baseClass == Behaviour.class) { + switch (baseOperationID) { case tdlPackage.BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return tdlPackage.TIME_OPERATION___GET_PARTICIPATING_COMPONENTS; default: return super.eDerivedOperationID(baseOperationID, baseClass); } } - if (baseClass == AtomicBehaviour.class) - { - switch (baseOperationID) - { + if (baseClass == AtomicBehaviour.class) { + switch (baseOperationID) { case tdlPackage.ATOMIC_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return tdlPackage.TIME_OPERATION___GET_PARTICIPATING_COMPONENTS; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -332,8 +438,7 @@ public abstract class TimeOperationImpl extends AtomicBehaviourImpl implements T @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.TIME_OPERATION___GET_PARTICIPATING_COMPONENTS: return getParticipatingComponents(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TimerOperationImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TimerOperationImpl.java index 5a7fc402..1d2cc4a6 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TimerOperationImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TimerOperationImpl.java @@ -4,23 +4,36 @@ package org.etsi.mts.tdl.impl; import java.lang.reflect.InvocationTargetException; +import java.util.Iterator; +import java.util.List; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.ocl.pivot.evaluation.Executor; +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.ids.IdResolver.IdResolverExtension; +import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsSetOperation; +import org.eclipse.ocl.pivot.messages.PivotMessages; +import org.eclipse.ocl.pivot.utilities.PivotUtil; +import org.eclipse.ocl.pivot.utilities.ValueUtil; +import org.eclipse.ocl.pivot.values.InvalidValueException; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SetValue; import org.etsi.mts.tdl.AtomicBehaviour; import org.etsi.mts.tdl.Behaviour; import org.etsi.mts.tdl.ComponentInstance; +import org.etsi.mts.tdl.TestConfiguration; +import org.etsi.mts.tdl.TestDescription; import org.etsi.mts.tdl.Timer; import org.etsi.mts.tdl.TimerOperation; import org.etsi.mts.tdl.tdlPackage; +import org.etsi.mts.tdl.tdlTables; /** * @@ -87,12 +100,10 @@ public abstract class TimerOperationImpl extends AtomicBehaviourImpl implements @Override public Timer getTimer() { - if (timer != null && timer.eIsProxy()) - { + if (timer != null && timer.eIsProxy()) { InternalEObject oldTimer = (InternalEObject)timer; timer = (Timer)eResolveProxy(oldTimer); - if (timer != oldTimer) - { + if (timer != oldTimer) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.TIMER_OPERATION__TIMER, oldTimer, timer)); } @@ -132,12 +143,10 @@ public abstract class TimerOperationImpl extends AtomicBehaviourImpl implements @Override public ComponentInstance getComponentInstance() { - if (componentInstance != null && componentInstance.eIsProxy()) - { + if (componentInstance != null && componentInstance.eIsProxy()) { InternalEObject oldComponentInstance = (InternalEObject)componentInstance; componentInstance = (ComponentInstance)eResolveProxy(oldComponentInstance); - if (componentInstance != oldComponentInstance) - { + if (componentInstance != oldComponentInstance) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.TIMER_OPERATION__COMPONENT_INSTANCE, oldComponentInstance, componentInstance)); } @@ -169,16 +178,6 @@ public abstract class TimerOperationImpl extends AtomicBehaviourImpl implements eNotify(new ENotificationImpl(this, Notification.SET, tdlPackage.TIMER_OPERATION__COMPONENT_INSTANCE, oldComponentInstance, componentInstance)); } - /** - * The cached invocation delegate for the '{@link #getParticipatingComponents() Get Participating Components}' operation. - * - * - * @see #getParticipatingComponents() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.TIMER_OPERATION___GET_PARTICIPATING_COMPONENTS).getInvocationDelegate(); - /** * * @@ -188,14 +187,69 @@ public abstract class TimerOperationImpl extends AtomicBehaviourImpl implements @Override public EList getParticipatingComponents() { - try - { - return (EList)GET_PARTICIPATING_COMPONENTS__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + /** + * + * if + * self.getParentTestDescription() + * ->exists(td | td.isLocallyOrdered) + * then OrderedSet{self.componentInstance} + * else + * self.getParentTestDescription() + * .testConfiguration.componentInstance->asOrderedSet() + * endif + */ + final /*@NonInvalid*/ Executor executor = PivotUtil.getExecutor(this); + final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ TestDescription getParentTestDescription = this.getParentTestDescription(); + final /*@NonInvalid*/ SetValue oclAsSet = OclAnyOclAsSetOperation.INSTANCE.evaluate(executor, tdlTables.SET_CLSSid_TestDescription, getParentTestDescription); + /*@Thrown*/ Object accumulator = ValueUtil.FALSE_VALUE; + Iterator ITERATOR_td = oclAsSet.iterator(); + /*@NonInvalid*/ Boolean exists; + while (true) { + if (!ITERATOR_td.hasNext()) { + if (accumulator == ValueUtil.FALSE_VALUE) { + exists = ValueUtil.FALSE_VALUE; + } + else { + throw (InvalidValueException)accumulator; + } + break; + } + /*@NonInvalid*/ TestDescription td = (TestDescription)ITERATOR_td.next(); + /** + * td.isLocallyOrdered + */ + final /*@NonInvalid*/ boolean isLocallyOrdered = td.isIsLocallyOrdered(); + // + if (isLocallyOrdered) { // Normal successful body evaluation result + exists = ValueUtil.TRUE_VALUE; + break; // Stop immediately + } + else if (!isLocallyOrdered) { // Normal unsuccessful body evaluation result + ; // Carry on + } + else { // Impossible badly typed result + accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "exists"); + } + } + if (exists == null) { + throw new InvalidValueException("Null if condition"); + } + /*@NonInvalid*/ OrderedSetValue local_0; + if (exists) { + final /*@NonInvalid*/ ComponentInstance componentInstance = this.getComponentInstance(); + final /*@NonInvalid*/ OrderedSetValue OrderedSet = ValueUtil.createOrderedSetOfEach(tdlTables.ORD_CLSSid_ComponentInstance, componentInstance); + local_0 = OrderedSet; } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); + else { + final /*@NonInvalid*/ TestConfiguration testConfiguration = getParentTestDescription.getTestConfiguration(); + final /*@NonInvalid*/ List componentInstance_0 = testConfiguration.getComponentInstance(); + final /*@NonInvalid*/ SetValue BOXED_componentInstance_0 = idResolver.createSetOfAll(tdlTables.SET_CLSSid_ComponentInstance, componentInstance_0); + final /*@NonInvalid*/ OrderedSetValue asOrderedSet = CollectionAsOrderedSetOperation.INSTANCE.evaluate(BOXED_componentInstance_0); + local_0 = asOrderedSet; } + final /*@NonInvalid*/ List ECORE_local_0 = ((IdResolverExtension)idResolver).ecoreValueOfAll(ComponentInstance.class, local_0); + return (EList)ECORE_local_0; } /** @@ -206,8 +260,7 @@ public abstract class TimerOperationImpl extends AtomicBehaviourImpl implements @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TIMER_OPERATION__TIMER: if (resolve) return getTimer(); return basicGetTimer(); @@ -226,8 +279,7 @@ public abstract class TimerOperationImpl extends AtomicBehaviourImpl implements @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TIMER_OPERATION__TIMER: setTimer((Timer)newValue); return; @@ -246,8 +298,7 @@ public abstract class TimerOperationImpl extends AtomicBehaviourImpl implements @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TIMER_OPERATION__TIMER: setTimer((Timer)null); return; @@ -266,8 +317,7 @@ public abstract class TimerOperationImpl extends AtomicBehaviourImpl implements @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TIMER_OPERATION__TIMER: return timer != null; case tdlPackage.TIMER_OPERATION__COMPONENT_INSTANCE: @@ -284,18 +334,14 @@ public abstract class TimerOperationImpl extends AtomicBehaviourImpl implements @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == Behaviour.class) - { - switch (baseOperationID) - { + if (baseClass == Behaviour.class) { + switch (baseOperationID) { case tdlPackage.BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return tdlPackage.TIMER_OPERATION___GET_PARTICIPATING_COMPONENTS; default: return super.eDerivedOperationID(baseOperationID, baseClass); } } - if (baseClass == AtomicBehaviour.class) - { - switch (baseOperationID) - { + if (baseClass == AtomicBehaviour.class) { + switch (baseOperationID) { case tdlPackage.ATOMIC_BEHAVIOUR___GET_PARTICIPATING_COMPONENTS: return tdlPackage.TIMER_OPERATION___GET_PARTICIPATING_COMPONENTS; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -311,8 +357,7 @@ public abstract class TimerOperationImpl extends AtomicBehaviourImpl implements @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.TIMER_OPERATION___GET_PARTICIPATING_COMPONENTS: return getParticipatingComponents(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TimerStartImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TimerStartImpl.java index e0cb4485..4ae5642c 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TimerStartImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/TimerStartImpl.java @@ -80,8 +80,7 @@ public class TimerStartImpl extends TimerOperationImpl implements TimerStart { DataUse oldPeriod = period; period = newPeriod; - if (eNotificationRequired()) - { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, tdlPackage.TIMER_START__PERIOD, oldPeriod, newPeriod); if (msgs == null) msgs = notification; else msgs.add(notification); } @@ -96,8 +95,7 @@ public class TimerStartImpl extends TimerOperationImpl implements TimerStart @Override public void setPeriod(DataUse newPeriod) { - if (newPeriod != period) - { + if (newPeriod != period) { NotificationChain msgs = null; if (period != null) msgs = ((InternalEObject)period).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - tdlPackage.TIMER_START__PERIOD, null, msgs); @@ -118,8 +116,7 @@ public class TimerStartImpl extends TimerOperationImpl implements TimerStart @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TIMER_START__PERIOD: return basicSetPeriod(null, msgs); } @@ -134,8 +131,7 @@ public class TimerStartImpl extends TimerOperationImpl implements TimerStart @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TIMER_START__PERIOD: return getPeriod(); } @@ -150,8 +146,7 @@ public class TimerStartImpl extends TimerOperationImpl implements TimerStart @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TIMER_START__PERIOD: setPeriod((DataUse)newValue); return; @@ -167,8 +162,7 @@ public class TimerStartImpl extends TimerOperationImpl implements TimerStart @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TIMER_START__PERIOD: setPeriod((DataUse)null); return; @@ -184,8 +178,7 @@ public class TimerStartImpl extends TimerOperationImpl implements TimerStart @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.TIMER_START__PERIOD: return period != null; } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ValueAssignmentImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ValueAssignmentImpl.java index d2b2ee55..13f9303b 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ValueAssignmentImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/ValueAssignmentImpl.java @@ -79,12 +79,10 @@ public class ValueAssignmentImpl extends ElementImpl implements ValueAssignment @Override public Variable getVariable() { - if (variable != null && variable.eIsProxy()) - { + if (variable != null && variable.eIsProxy()) { InternalEObject oldVariable = (InternalEObject)variable; variable = (Variable)eResolveProxy(oldVariable); - if (variable != oldVariable) - { + if (variable != oldVariable) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.VALUE_ASSIGNMENT__VARIABLE, oldVariable, variable)); } @@ -124,12 +122,10 @@ public class ValueAssignmentImpl extends ElementImpl implements ValueAssignment @Override public Parameter getParameter() { - if (parameter != null && parameter.eIsProxy()) - { + if (parameter != null && parameter.eIsProxy()) { InternalEObject oldParameter = (InternalEObject)parameter; parameter = (Parameter)eResolveProxy(oldParameter); - if (parameter != oldParameter) - { + if (parameter != oldParameter) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.VALUE_ASSIGNMENT__PARAMETER, oldParameter, parameter)); } @@ -169,8 +165,7 @@ public class ValueAssignmentImpl extends ElementImpl implements ValueAssignment @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.VALUE_ASSIGNMENT__VARIABLE: if (resolve) return getVariable(); return basicGetVariable(); @@ -189,8 +184,7 @@ public class ValueAssignmentImpl extends ElementImpl implements ValueAssignment @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.VALUE_ASSIGNMENT__VARIABLE: setVariable((Variable)newValue); return; @@ -209,8 +203,7 @@ public class ValueAssignmentImpl extends ElementImpl implements ValueAssignment @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.VALUE_ASSIGNMENT__VARIABLE: setVariable((Variable)null); return; @@ -229,8 +222,7 @@ public class ValueAssignmentImpl extends ElementImpl implements ValueAssignment @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.VALUE_ASSIGNMENT__VARIABLE: return variable != null; case tdlPackage.VALUE_ASSIGNMENT__PARAMETER: diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/VariableImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/VariableImpl.java index 3958059b..2582bc42 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/VariableImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/VariableImpl.java @@ -67,12 +67,10 @@ public class VariableImpl extends NamedElementImpl implements Variable @Override public DataType getDataType() { - if (dataType != null && dataType.eIsProxy()) - { + if (dataType != null && dataType.eIsProxy()) { InternalEObject oldDataType = (InternalEObject)dataType; dataType = (DataType)eResolveProxy(oldDataType); - if (dataType != oldDataType) - { + if (dataType != oldDataType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.VARIABLE__DATA_TYPE, oldDataType, dataType)); } @@ -112,8 +110,7 @@ public class VariableImpl extends NamedElementImpl implements Variable @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.VARIABLE__DATA_TYPE: if (resolve) return getDataType(); return basicGetDataType(); @@ -129,8 +126,7 @@ public class VariableImpl extends NamedElementImpl implements Variable @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.VARIABLE__DATA_TYPE: setDataType((DataType)newValue); return; @@ -146,8 +142,7 @@ public class VariableImpl extends NamedElementImpl implements Variable @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.VARIABLE__DATA_TYPE: setDataType((DataType)null); return; @@ -163,8 +158,7 @@ public class VariableImpl extends NamedElementImpl implements Variable @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.VARIABLE__DATA_TYPE: return dataType != null; } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/VariableUseImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/VariableUseImpl.java index 83997831..b289c4a4 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/VariableUseImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/VariableUseImpl.java @@ -7,10 +7,7 @@ import java.lang.reflect.InvocationTargetException; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.WrappedException; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; @@ -87,12 +84,10 @@ public class VariableUseImpl extends DynamicDataUseImpl implements VariableUse @Override public ComponentInstance getComponentInstance() { - if (componentInstance != null && componentInstance.eIsProxy()) - { + if (componentInstance != null && componentInstance.eIsProxy()) { InternalEObject oldComponentInstance = (InternalEObject)componentInstance; componentInstance = (ComponentInstance)eResolveProxy(oldComponentInstance); - if (componentInstance != oldComponentInstance) - { + if (componentInstance != oldComponentInstance) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.VARIABLE_USE__COMPONENT_INSTANCE, oldComponentInstance, componentInstance)); } @@ -132,12 +127,10 @@ public class VariableUseImpl extends DynamicDataUseImpl implements VariableUse @Override public Variable getVariable() { - if (variable != null && variable.eIsProxy()) - { + if (variable != null && variable.eIsProxy()) { InternalEObject oldVariable = (InternalEObject)variable; variable = (Variable)eResolveProxy(oldVariable); - if (variable != oldVariable) - { + if (variable != oldVariable) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, tdlPackage.VARIABLE_USE__VARIABLE, oldVariable, variable)); } @@ -169,16 +162,6 @@ public class VariableUseImpl extends DynamicDataUseImpl implements VariableUse eNotify(new ENotificationImpl(this, Notification.SET, tdlPackage.VARIABLE_USE__VARIABLE, oldVariable, variable)); } - /** - * The cached invocation delegate for the '{@link #resolveDataType() Resolve Data Type}' operation. - * - * - * @see #resolveDataType() - * @generated - * @ordered - */ - protected static final EOperation.Internal.InvocationDelegate RESOLVE_DATA_TYPE__EINVOCATION_DELEGATE = ((EOperation.Internal)tdlPackage.Literals.VARIABLE_USE___RESOLVE_DATA_TYPE).getInvocationDelegate(); - /** * * @@ -187,14 +170,12 @@ public class VariableUseImpl extends DynamicDataUseImpl implements VariableUse @Override public DataType resolveDataType() { - try - { - return (DataType)RESOLVE_DATA_TYPE__EINVOCATION_DELEGATE.dynamicInvoke(this, null); - } - catch (InvocationTargetException ite) - { - throw new WrappedException(ite); - } + /** + * self.variable.dataType + */ + final /*@NonInvalid*/ Variable variable = this.getVariable(); + final /*@NonInvalid*/ DataType dataType = variable.getDataType(); + return dataType; } /** @@ -205,8 +186,7 @@ public class VariableUseImpl extends DynamicDataUseImpl implements VariableUse @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.VARIABLE_USE__COMPONENT_INSTANCE: if (resolve) return getComponentInstance(); return basicGetComponentInstance(); @@ -225,8 +205,7 @@ public class VariableUseImpl extends DynamicDataUseImpl implements VariableUse @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.VARIABLE_USE__COMPONENT_INSTANCE: setComponentInstance((ComponentInstance)newValue); return; @@ -245,8 +224,7 @@ public class VariableUseImpl extends DynamicDataUseImpl implements VariableUse @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.VARIABLE_USE__COMPONENT_INSTANCE: setComponentInstance((ComponentInstance)null); return; @@ -265,8 +243,7 @@ public class VariableUseImpl extends DynamicDataUseImpl implements VariableUse @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.VARIABLE_USE__COMPONENT_INSTANCE: return componentInstance != null; case tdlPackage.VARIABLE_USE__VARIABLE: @@ -283,10 +260,8 @@ public class VariableUseImpl extends DynamicDataUseImpl implements VariableUse @Override public int eDerivedOperationID(int baseOperationID, Class baseClass) { - if (baseClass == DataUse.class) - { - switch (baseOperationID) - { + if (baseClass == DataUse.class) { + switch (baseOperationID) { case tdlPackage.DATA_USE___RESOLVE_DATA_TYPE: return tdlPackage.VARIABLE_USE___RESOLVE_DATA_TYPE; default: return super.eDerivedOperationID(baseOperationID, baseClass); } @@ -302,8 +277,7 @@ public class VariableUseImpl extends DynamicDataUseImpl implements VariableUse @Override public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) - { + switch (operationID) { case tdlPackage.VARIABLE_USE___RESOLVE_DATA_TYPE: return resolveDataType(); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/VerdictAssignmentImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/VerdictAssignmentImpl.java index 2721eed3..51c434a6 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/VerdictAssignmentImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/VerdictAssignmentImpl.java @@ -80,8 +80,7 @@ public class VerdictAssignmentImpl extends AtomicBehaviourImpl implements Verdic { DataUse oldVerdict = verdict; verdict = newVerdict; - if (eNotificationRequired()) - { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, tdlPackage.VERDICT_ASSIGNMENT__VERDICT, oldVerdict, newVerdict); if (msgs == null) msgs = notification; else msgs.add(notification); } @@ -96,8 +95,7 @@ public class VerdictAssignmentImpl extends AtomicBehaviourImpl implements Verdic @Override public void setVerdict(DataUse newVerdict) { - if (newVerdict != verdict) - { + if (newVerdict != verdict) { NotificationChain msgs = null; if (verdict != null) msgs = ((InternalEObject)verdict).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - tdlPackage.VERDICT_ASSIGNMENT__VERDICT, null, msgs); @@ -118,8 +116,7 @@ public class VerdictAssignmentImpl extends AtomicBehaviourImpl implements Verdic @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) - { + switch (featureID) { case tdlPackage.VERDICT_ASSIGNMENT__VERDICT: return basicSetVerdict(null, msgs); } @@ -134,8 +131,7 @@ public class VerdictAssignmentImpl extends AtomicBehaviourImpl implements Verdic @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) - { + switch (featureID) { case tdlPackage.VERDICT_ASSIGNMENT__VERDICT: return getVerdict(); } @@ -150,8 +146,7 @@ public class VerdictAssignmentImpl extends AtomicBehaviourImpl implements Verdic @Override public void eSet(int featureID, Object newValue) { - switch (featureID) - { + switch (featureID) { case tdlPackage.VERDICT_ASSIGNMENT__VERDICT: setVerdict((DataUse)newValue); return; @@ -167,8 +162,7 @@ public class VerdictAssignmentImpl extends AtomicBehaviourImpl implements Verdic @Override public void eUnset(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.VERDICT_ASSIGNMENT__VERDICT: setVerdict((DataUse)null); return; @@ -184,8 +178,7 @@ public class VerdictAssignmentImpl extends AtomicBehaviourImpl implements Verdic @Override public boolean eIsSet(int featureID) { - switch (featureID) - { + switch (featureID) { case tdlPackage.VERDICT_ASSIGNMENT__VERDICT: return verdict != null; } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/tdlFactoryImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/tdlFactoryImpl.java index b3256e2f..00dbfe8a 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/tdlFactoryImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/tdlFactoryImpl.java @@ -24,6 +24,7 @@ import org.etsi.mts.tdl.BehaviourDescription; import org.etsi.mts.tdl.Block; import org.etsi.mts.tdl.BoundedLoopBehaviour; import org.etsi.mts.tdl.Break; +import org.etsi.mts.tdl.CastDataUse; import org.etsi.mts.tdl.CollectionDataInstance; import org.etsi.mts.tdl.CollectionDataType; import org.etsi.mts.tdl.Comment; @@ -119,16 +120,13 @@ public class tdlFactoryImpl extends EFactoryImpl implements tdlFactory */ public static tdlFactory init() { - try - { + try { tdlFactory thetdlFactory = (tdlFactory)EPackage.Registry.INSTANCE.getEFactory(tdlPackage.eNS_URI); - if (thetdlFactory != null) - { + if (thetdlFactory != null) { return thetdlFactory; } } - catch (Exception exception) - { + catch (Exception exception) { EcorePlugin.INSTANCE.log(exception); } return new tdlFactoryImpl(); @@ -153,8 +151,7 @@ public class tdlFactoryImpl extends EFactoryImpl implements tdlFactory @Override public EObject create(EClass eClass) { - switch (eClass.getClassifierID()) - { + switch (eClass.getClassifierID()) { case tdlPackage.COMMENT: return createComment(); case tdlPackage.ANNOTATION: return createAnnotation(); case tdlPackage.ANNOTATION_TYPE: return createAnnotationType(); @@ -240,6 +237,7 @@ public class tdlFactoryImpl extends EFactoryImpl implements tdlFactory case tdlPackage.CONSTRAINT: return createConstraint(); case tdlPackage.ENUM_DATA_TYPE: return createEnumDataType(); case tdlPackage.DATA_ELEMENT_USE: return createDataElementUse(); + case tdlPackage.CAST_DATA_USE: return createCastDataUse(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } @@ -253,8 +251,7 @@ public class tdlFactoryImpl extends EFactoryImpl implements tdlFactory @Override public Object createFromString(EDataType eDataType, String initialValue) { - switch (eDataType.getClassifierID()) - { + switch (eDataType.getClassifierID()) { case tdlPackage.UNASSIGNED_MEMBER_TREATMENT: return createUnassignedMemberTreatmentFromString(eDataType, initialValue); case tdlPackage.COMPONENT_INSTANCE_ROLE: @@ -278,8 +275,7 @@ public class tdlFactoryImpl extends EFactoryImpl implements tdlFactory @Override public String convertToString(EDataType eDataType, Object instanceValue) { - switch (eDataType.getClassifierID()) - { + switch (eDataType.getClassifierID()) { case tdlPackage.UNASSIGNED_MEMBER_TREATMENT: return convertUnassignedMemberTreatmentToString(eDataType, instanceValue); case tdlPackage.COMPONENT_INSTANCE_ROLE: @@ -1315,6 +1311,17 @@ public class tdlFactoryImpl extends EFactoryImpl implements tdlFactory return dataElementUse; } + /** + * + * + * @generated + */ + @Override + public CastDataUse createCastDataUse() { + CastDataUseImpl castDataUse = new CastDataUseImpl(); + return castDataUse; + } + /** * * diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/tdlPackageImpl.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/tdlPackageImpl.java index 2cbb97d3..365654af 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/tdlPackageImpl.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/impl/tdlPackageImpl.java @@ -27,6 +27,7 @@ import org.etsi.mts.tdl.BehaviourDescription; import org.etsi.mts.tdl.Block; import org.etsi.mts.tdl.BoundedLoopBehaviour; import org.etsi.mts.tdl.Break; +import org.etsi.mts.tdl.CastDataUse; import org.etsi.mts.tdl.CollectionDataInstance; import org.etsi.mts.tdl.CollectionDataType; import org.etsi.mts.tdl.CombinedBehaviour; @@ -875,6 +876,13 @@ public class tdlPackageImpl extends EPackageImpl implements tdlPackage */ private EClass dataElementUseEClass = null; + /** + * + * + * @generated + */ + private EClass castDataUseEClass = null; + /** * * @@ -4238,6 +4246,46 @@ public class tdlPackageImpl extends EPackageImpl implements tdlPackage return dataElementUseEClass.getEOperations().get(0); } + /** + * + * + * @generated + */ + @Override + public EClass getCastDataUse() { + return castDataUseEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getCastDataUse_DataUse() { + return (EReference)castDataUseEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCastDataUse_DataType() { + return (EReference)castDataUseEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EOperation getCastDataUse__ResolveDataType() { + return castDataUseEClass.getEOperations().get(0); + } + /** * * @@ -4725,6 +4773,11 @@ public class tdlPackageImpl extends EPackageImpl implements tdlPackage createEReference(dataElementUseEClass, DATA_ELEMENT_USE__ITEM); createEOperation(dataElementUseEClass, DATA_ELEMENT_USE___RESOLVE_DATA_TYPE); + castDataUseEClass = createEClass(CAST_DATA_USE); + createEReference(castDataUseEClass, CAST_DATA_USE__DATA_USE); + createEReference(castDataUseEClass, CAST_DATA_USE__DATA_TYPE); + createEOperation(castDataUseEClass, CAST_DATA_USE___RESOLVE_DATA_TYPE); + // Create enums unassignedMemberTreatmentEEnum = createEEnum(UNASSIGNED_MEMBER_TREATMENT); componentInstanceRoleEEnum = createEEnum(COMPONENT_INSTANCE_ROLE); @@ -4866,6 +4919,7 @@ public class tdlPackageImpl extends EPackageImpl implements tdlPackage constraintEClass.getESuperTypes().add(this.getElement()); enumDataTypeEClass.getESuperTypes().add(this.getSimpleDataType()); dataElementUseEClass.getESuperTypes().add(this.getDataUse()); + castDataUseEClass.getESuperTypes().add(this.getStaticDataUse()); // Initialize classes, features, and operations; add parameters initEClass(elementEClass, Element.class, "Element", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -5321,6 +5375,12 @@ public class tdlPackageImpl extends EPackageImpl implements tdlPackage initEOperation(getDataElementUse__ResolveDataType(), this.getDataType(), "resolveDataType", 0, 1, IS_UNIQUE, IS_ORDERED); + initEClass(castDataUseEClass, CastDataUse.class, "CastDataUse", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getCastDataUse_DataUse(), this.getDataUse(), null, "dataUse", null, 1, 1, CastDataUse.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getCastDataUse_DataType(), this.getDataType(), null, "dataType", null, 1, 1, CastDataUse.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEOperation(getCastDataUse__ResolveDataType(), this.getDataType(), "resolveDataType", 0, 1, IS_UNIQUE, IS_ORDERED); + // Initialize enums and add enum literals initEEnum(unassignedMemberTreatmentEEnum, UnassignedMemberTreatment.class, "UnassignedMemberTreatment"); addEEnumLiteral(unassignedMemberTreatmentEEnum, UnassignedMemberTreatment.UNDEFINED); @@ -5369,11 +5429,7 @@ public class tdlPackageImpl extends EPackageImpl implements tdlPackage addAnnotation (this, source, - new String[] - { - "invocationDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", - "settingDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", - "validationDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot" + new String[] { }); } @@ -5389,325 +5445,279 @@ public class tdlPackageImpl extends EPackageImpl implements tdlPackage addAnnotation (getElement__Container(), source, - new String[] - { + new String[] { "body", "\n if (not self.oclContainer().oclIsUndefined()) then\n self.oclContainer().oclAsType(Element)\n else \n null\n endif" }); addAnnotation (getElement__GetParentTestDescription(), source, - new String[] - { + new String[] { "body", " \n if (self.oclContainer().oclIsUndefined()) then\n null\n else \n if (self.container().oclIsKindOf(TestDescription)) then\n self.container().oclAsType(TestDescription)\n else\n self.container().getParentTestDescription()\n endif\n endif" }); addAnnotation (getPackageableElement__ConformsTo__String(), source, - new String[] - { + new String[] { "body", " \n if (self.getElementNamed(n).oclIsUndefined()) then\n false\n else\n self.conformsTo(self.getElementNamed(n)) \n endif\n " }); addAnnotation (getPackageableElement__GetElementNamed__String(), source, - new String[] - { + new String[] { "body", "\n self.oclType().allInstances()->select(e | e.name = n)->asOrderedSet()->first()\n " }); addAnnotation (getPackageableElement__ConformsTo__PackageableElement(), source, - new String[] - { + new String[] { "body", "\n if (self = n) then\n true\n else\n if (self.oclIsKindOf(AnnotationType) and not self.oclAsType(AnnotationType).extension.oclIsUndefined()) then\n self.oclAsType(AnnotationType).extension.isExtending(n)\n else\n if (self.oclIsKindOf(ComponentType) and not self.oclAsType(ComponentType).extension.oclIsUndefined()) then\n self.oclAsType(ComponentType).extension.isExtending(n)\n else\n if (self.oclIsKindOf(GateType) and not self.oclAsType(GateType).extension.oclIsUndefined()) then\n self.oclAsType(GateType).extension.isExtending(n)\n else\n if (self.oclIsKindOf(StructuredDataType)) then\n self.oclAsType(StructuredDataType).extension->exists(ex | ex.isExtending(n))\n else\n if (self.oclIsKindOf(SimpleDataType) and not self.oclAsType(SimpleDataType).extension.oclIsUndefined()) then\n self.oclAsType(SimpleDataType).extension.isExtending(n)\n else\n false\n endif\n endif\n endif\n endif\n endif\n endif\n " }); - addAnnotation - (getNamedElement_QualifiedName(), - source, - new String[] - { - "derivation", "\n if (self.name.oclIsUndefined()) then\n \'\'\n else\n if (not self.oclContainer().oclIsUndefined()) then\n if (self.oclContainer().oclIsKindOf(NamedElement)) then\n self.oclContainer().oclAsType(NamedElement).qualifiedName + \'::\' + self.name\n else\n self.oclContainer().oclAsType(ocl::OclElement)->closure(oclContainer())\n ->select(c | c.oclIsKindOf(NamedElement))\n ->asOrderedSet()\n ->first().oclAsType(NamedElement).qualifiedName + \'::\' + self.name\n endif\n else\n self.name\n endif\n endif" - }); addAnnotation (getDataType__AllConstraints(), source, - new String[] - { + new String[] { "body", "\n self.constraint\n " }); addAnnotation (getSimpleDataType__AllConstraints(), source, - new String[] - { + new String[] { "body", "\n if (not self.extension.oclIsUndefined()) then\n self.extension.extending.oclAsType(SimpleDataType).allConstraints()->union(self.constraint)->asOrderedSet()\n else \n self.constraint\n endif\n " }); addAnnotation (getStructuredDataType__AllMembers(), source, - new String[] - { + new String[] { "body", "\n if (not self.extension->isEmpty()) then\n self.extension->collect(e | e.extending.oclAsType(StructuredDataType).allMembers())->union(self.member)->asOrderedSet()\n else \n self.member\n endif\n " }); addAnnotation (getStructuredDataType__AllConstraints(), source, - new String[] - { + new String[] { "body", "\n if (not self.extension->isEmpty()) then\n self.extension->collect(e | e.extending.oclAsType(StructuredDataType).allConstraints())->union(self.constraint)->asOrderedSet()\n else \n self.constraint\n endif\n " }); addAnnotation (getDataUse__ResolveDataType(), source, - new String[] - { + new String[] { "body", "null" }); addAnnotation (getDataUse__IsEffectivelyStatic(), source, - new String[] - { + new String[] { "body", "\n (self.oclIsKindOf(StaticDataUse)\n or (self.oclIsKindOf(DataElementUse) and \n (self.oclAsType(DataElementUse).dataElement.oclIsUndefined()\n or self.oclAsType(DataElementUse).dataElement.oclIsKindOf(DataInstance)\n or self.oclAsType(DataElementUse).dataElement.oclIsKindOf(DataType)\n )\n )\n )\n and self.argument->forAll(a | a.dataUse.isEffectivelyStatic())\n " }); addAnnotation (getParameterBinding__ResolveParameterType(), source, - new String[] - { + new String[] { "body", "\t\t\t\n\t \tif (self.reduction->isEmpty()) then\n\t \tself.parameter.dataType\n\t \telse \n\t \t\tif (self.reduction->last().member.oclIsUndefined()) then\n\t \t\t\tif (self.reduction->last().collectionIndex.oclIsUndefined()) then\n\t \t\t\tself.parameter.dataType\n\t \t\t\telse\n\t \t\t\t\tself.parameter.dataType.oclAsType(CollectionDataType).itemType\n\t \t\t\tendif \n\t \t\telse \n\t \t\tself.reduction->last().member.dataType\n\t \t\tendif\n\t endif\n\t " }); addAnnotation (getFormalParameterUse__ResolveDataType(), source, - new String[] - { + new String[] { "body", "self.parameter.dataType" }); addAnnotation (getFunctionCall__ResolveDataType(), source, - new String[] - { + new String[] { "body", "self.function.returnType" }); addAnnotation (getVariableUse__ResolveDataType(), source, - new String[] - { + new String[] { "body", "self.variable.dataType" }); addAnnotation (getComponentType__AllGates(), source, - new String[] - { + new String[] { "body", "\n if (not self.extension.oclIsUndefined()) then\n self.extension.extending.oclAsType(ComponentType).allGates()->union(self.gateInstance)->asOrderedSet()\n else \n self.gateInstance\n endif\n " }); addAnnotation (getComponentType__AllTimers(), source, - new String[] - { + new String[] { "body", "\n if (not self.extension.oclIsUndefined()) then\n self.extension.extending.oclAsType(ComponentType).allTimers()->union(self.timer)->asOrderedSet()\n else \n self.timer\n endif\n " }); addAnnotation (getComponentType__AllVariables(), source, - new String[] - { + new String[] { "body", "\n if (not self.extension.oclIsUndefined()) then\n self.extension.extending.oclAsType(ComponentType).allVariables()->union(self.variable)->asOrderedSet()\n else \n self.variable\n endif\n " }); addAnnotation (getGateType__AllDataTypes(), source, - new String[] - { + new String[] { "body", "\n if (not self.extension.oclIsUndefined()) then\n self.extension.extending.oclAsType(GateType).allDataTypes()->union(self.dataType)->asOrderedSet()\n else \n self.dataType\n endif\n " }); addAnnotation (getSpecialValueUse__ResolveDataType(), source, - new String[] - { + new String[] { "body", "\n if (self.container().oclIsTypeOf(MemberAssignment)) then\n self.container().oclAsType(MemberAssignment).member.dataType\n else \n if (self.container().oclIsTypeOf(ParameterBinding)) then\n self.container().oclAsType(ParameterBinding).parameter.dataType\n else \n if (self.container().oclIsTypeOf(Interaction) and \n self.oclIsTypeOf(AnyValue)) then\n self.oclAsType(AnyValue).dataType\n else\n null\n endif\n endif\n endif\n " }); addAnnotation (getAnyValue__ResolveDataType(), source, - new String[] - { + new String[] { "body", "\n if (not self.dataType.oclIsUndefined()) then\n self.dataType\n else \n if (self.container().oclIsTypeOf(MemberAssignment)) then\n self.container().oclAsType(MemberAssignment).member.dataType\n else \n if (self.container().oclIsTypeOf(ParameterBinding)) then\n self.container().oclAsType(ParameterBinding).parameter.dataType\n else\n if (self.container().oclIsTypeOf(CollectionDataInstance)) then\n self.container().oclAsType(CollectionDataInstance).dataType.oclAsType(CollectionDataType).itemType\n else\n if (self.container().oclIsTypeOf(DataElementUse)) then\n self.container().oclAsType(DataElementUse).resolveDataType().oclAsType(CollectionDataType).itemType\n else\n if (self.container().oclIsTypeOf(DataInstanceUse)) then\n self.container().oclAsType(DataInstanceUse).resolveDataType().oclAsType(CollectionDataType).itemType\n else\n null\n endif\n endif\n endif\n endif\n endif\n endif\n " }); addAnnotation (getDataInstanceUse__ResolveDataType(), source, - new String[] - { + new String[] { "body", "\n if (not self.dataInstance.oclIsUndefined()) then\n self.dataInstance.dataType\n else \n if (not self.dataType.oclIsUndefined()) then\n self.dataType\n else \n if (self.container().oclIsTypeOf(MemberAssignment)) then\n self.container().oclAsType(MemberAssignment).member.dataType\n else \n if (self.container().oclIsTypeOf(ParameterBinding)) then\n self.container().oclAsType(ParameterBinding).parameter.dataType\n else\n if (self.container().oclIsTypeOf(CollectionDataInstance)) then\n self.container().oclAsType(CollectionDataInstance).dataType.oclAsType(CollectionDataType).itemType\n else\n if (self.container().oclIsTypeOf(DataElementUse)) then\n self.container().oclAsType(DataElementUse).resolveDataType().oclAsType(CollectionDataType).itemType\n else\n if (self.container().oclIsTypeOf(DataInstanceUse)) then\n self.container().oclAsType(DataInstanceUse).resolveDataType().oclAsType(CollectionDataType).itemType\n else\n null\n endif\n endif\n endif\n endif\n endif\n endif\n endif\n " }); addAnnotation (getTimerOperation__GetParticipatingComponents(), source, - new String[] - { + new String[] { "body", "\n if self.getParentTestDescription()->exists(td | td.isLocallyOrdered) then\n OrderedSet { self.componentInstance }\n else\n self.getParentTestDescription().testConfiguration.componentInstance->asOrderedSet()\n endif\n " }); addAnnotation (getAtomicBehaviour__GetParticipatingComponents(), source, - new String[] - { + new String[] { "body", "\n if self.getParentTestDescription()->exists(td | td.isLocallyOrdered) and self.container().oclIsKindOf(Block) then\n self.container().oclAsType(Block).getParticipatingComponentsExcluding(self)->asOrderedSet()\n else\n self.getParentTestDescription().testConfiguration.componentInstance->asOrderedSet()\n endif\n " }); addAnnotation (getBehaviour__IsTesterInputEvent(), source, - new String[] - { + new String[] { "body", "\n if (self.oclIsKindOf(TimeOut) or \n self.oclIsKindOf(Quiescence) or\n (self.oclIsKindOf(Interaction) and\n self.oclAsType(Interaction).sourceGate.component.role = ComponentInstanceRole::SUT and\n self.oclAsType(Interaction).target->exists(t | t.targetGate.component.role = ComponentInstanceRole::Tester)\n )\n ) then\n true\n else\n false\n endif" }); addAnnotation (getBehaviour__GetParticipatingComponents(), source, - new String[] - { + new String[] { "body", "\n if self.getParentTestDescription()->exists(td | td.isLocallyOrdered) then\n OrderedSet{}\n else\n self.getParentTestDescription().testConfiguration.componentInstance->asOrderedSet()\n endif\n " }); addAnnotation (getTimeOperation__GetParticipatingComponents(), source, - new String[] - { + new String[] { "body", "\n if self.getParentTestDescription()->exists(td | td.isLocallyOrdered) and self.container().oclIsKindOf(Block) then (\n if not self.componentInstance.oclIsUndefined() then\n OrderedSet { self.componentInstance }\n else\n self.container().oclAsType(Block).getParticipatingComponentsExcluding(self)->asOrderedSet()\n endif\n ) else\n self.getParentTestDescription().testConfiguration.componentInstance->asOrderedSet()\n endif\n " }); addAnnotation (getQuiescence__GetParticipatingComponents(), source, - new String[] - { + new String[] { "body", "\n if self.getParentTestDescription()->exists(td | td.isLocallyOrdered) and self.container().oclIsKindOf(Block) then (\n if not self.componentInstance.oclIsUndefined() or not self.gateReference.oclIsUndefined() then\n self.componentInstance->including(self.gateReference.component)->asOrderedSet()\n else\n self.container().oclAsType(Block).getParticipatingComponentsExcluding(self)->asOrderedSet()\n endif\n ) else\n self.getParentTestDescription().testConfiguration.componentInstance->asOrderedSet()\n endif\n " }); addAnnotation (getTimeLabelUse__ResolveDataType(), source, - new String[] - { + new String[] { "body", "Time.allInstances()->asOrderedSet()->first()" }); addAnnotation (getTestConfiguration__CompatibleWith__TestConfiguration_EList(), source, - new String[] - { + new String[] { "body", "self.componentInstance->forAll(c | cb->exists(formalComponent = c)) and\nself.connection->forAll(c1 | tc.connection->exists(c2 |\n\tc1.endPoint->reject(ep1 | c2.endPoint->exists(ep2 |\n\t\tcb->any(formalComponent = ep1.component).actualComponent = ep2.component and ep1.gate = ep2.gate\n\t))->isEmpty()\n))" }); addAnnotation (getBlock__GetParticipatingComponents(), source, - new String[] - { + new String[] { "body", "\n if self.getParentTestDescription()->exists(td | td.isLocallyOrdered) then\n self.behaviour.getParticipatingComponents()->asOrderedSet()\n else\n self.getParentTestDescription().testConfiguration.componentInstance->asOrderedSet()\n endif\n " }); addAnnotation (getBlock__GetParticipatingComponentsExcluding__Behaviour(), source, - new String[] - { + new String[] { "body", "\n if self.getParentTestDescription()->exists(td | td.isLocallyOrdered) then\n self.behaviour->excluding(excluded).getParticipatingComponents()->asOrderedSet()\n else\n self.getParentTestDescription().testConfiguration.componentInstance->asOrderedSet()\n endif\n " }); addAnnotation (getPeriodicBehaviour__GetParticipatingComponents(), source, - new String[] - { + new String[] { "body", "\n if self.getParentTestDescription()->exists(td | td.isLocallyOrdered) then\n self.block.getParticipatingComponents()->asOrderedSet()\n else\n self.getParentTestDescription().testConfiguration.componentInstance->asOrderedSet()\n endif\n " }); addAnnotation (getExceptionalBehaviour__GetParticipatingComponents(), source, - new String[] - { + new String[] { "body", "\n if self.getParentTestDescription()->exists(td | td.isLocallyOrdered) then\n self.block.getParticipatingComponents()->asOrderedSet()\n else\n self.getParentTestDescription().testConfiguration.componentInstance->asOrderedSet()\n endif\n " }); addAnnotation (getMultipleCombinedBehaviour__GetParticipatingComponents(), source, - new String[] - { + new String[] { "body", "\n if self.getParentTestDescription()->exists(td | td.isLocallyOrdered) then\n self.periodic.getParticipatingComponents()\n ->union(self.exceptional.getParticipatingComponents())\n ->union(self.block.getParticipatingComponents())->asOrderedSet()\n else\n self.getParentTestDescription().testConfiguration.componentInstance->asOrderedSet()\n endif\n " }); addAnnotation (getSingleCombinedBehaviour__GetParticipatingComponents(), source, - new String[] - { + new String[] { "body", "\n if self.getParentTestDescription()->exists(td | td.isLocallyOrdered) then\n self.periodic.getParticipatingComponents()\n ->union(self.exceptional.getParticipatingComponents())\n ->union(self.block.getParticipatingComponents())->asOrderedSet()\n else\n self.getParentTestDescription().testConfiguration.componentInstance->asOrderedSet()\n endif\n " }); addAnnotation (getAssignment__GetParticipatingComponents(), source, - new String[] - { + new String[] { "body", "\n if self.getParentTestDescription()->exists(td | td.isLocallyOrdered) and self.container().oclIsKindOf(Block) then (\n if not self.variable.componentInstance.oclIsUndefined() then\n OrderedSet { self.variable.componentInstance }\n else\n self.container().oclAsType(Block).getParticipatingComponentsExcluding(self)->asOrderedSet()\n endif\n ) else\n self.getParentTestDescription().testConfiguration.componentInstance->asOrderedSet()\n endif\n " }); addAnnotation (getActionBehaviour__GetParticipatingComponents(), source, - new String[] - { + new String[] { "body", "\n if self.getParentTestDescription()->exists(td | td.isLocallyOrdered) and self.container().oclIsKindOf(Block) then (\n if not self.componentInstance.oclIsUndefined() then\n OrderedSet { self.componentInstance }\n else\n self.container().oclAsType(Block).getParticipatingComponentsExcluding(self)->asOrderedSet()\n endif\n ) else\n self.getParentTestDescription().testConfiguration.componentInstance->asOrderedSet()\n endif\n " }); addAnnotation (getTestDescriptionReference__GetParticipatingComponents(), source, - new String[] - { + new String[] { "body", "\n if self.getParentTestDescription()->exists(td | td.isLocallyOrdered) and not self.componentInstanceBinding->isEmpty() then\n self.componentInstanceBinding.actualComponent->asOrderedSet()\n else\n self.getParentTestDescription().testConfiguration.componentInstance->asOrderedSet()\n endif\n " }); addAnnotation (getInteraction__GetParticipatingComponents(), source, - new String[] - { + new String[] { "body", "\n if self.getParentTestDescription()->exists(td | td.isLocallyOrdered) then\n self.target\n ->collect(targetGate.component)\n ->including(sourceGate.component)\n ->asOrderedSet()\n else\n self.getParentTestDescription().testConfiguration.componentInstance->asOrderedSet()\n endif\n " }); addAnnotation (getPredefinedFunctionCall__ResolveDataType(), source, - new String[] - { + new String[] { "body", "\n\t if not self.function.returnType.oclIsUndefined() then\n\t\t\t\t\t\tself.function.returnType\n\t\t\t\t\telse \n\t\t\t\t\t\tself.actualParameters.resolveDataType()->asOrderedSet()->first()\n\t\t\t\t\tendif\n\t\t\t\t\t" }); addAnnotation (getExtension__TransitiveExtending(), source, - new String[] - { + new String[] { "body", "\n if (self.extending.oclIsKindOf(AnnotationType)) then\n OrderedSet { self.extending.oclAsType(AnnotationType).extension }\n else\n if (self.extending.oclIsKindOf(ComponentType)) then\n OrderedSet { self.extending.oclAsType(ComponentType).extension }\n else\n if (self.extending.oclIsKindOf(GateType)) then\n OrderedSet { self.extending.oclAsType(GateType).extension }\n else\n if (self.extending.oclIsKindOf(StructuredDataType)) then\n self.extending.oclAsType(StructuredDataType).extension\n else\n if (self.extending.oclIsKindOf(SimpleDataType)) then\n OrderedSet { self.extending.oclAsType(SimpleDataType).extension }\n else\n OrderedSet { }\n endif\n endif\n endif\n endif\n endif\n " }); addAnnotation (getExtension__IsExtending__PackageableElement(), source, - new String[] - { + new String[] { "body", "\n if (self.extending = e) then\n true\n else\n if (self->closure(transitiveExtending())->includes(e)) then\n true\n else\n false\n endif \n endif\n " }); addAnnotation (getLiteralValueUse__ResolveDataType(), source, - new String[] - { + new String[] { "body", "\n if (not self.dataType.oclIsUndefined()) then\n self.dataType\n else \n if (self.container().oclIsTypeOf(MemberAssignment)) then\n self.container().oclAsType(MemberAssignment).member.dataType\n else \n if (self.container().oclIsTypeOf(ParameterBinding)) then\n self.container().oclAsType(ParameterBinding).parameter.dataType\n else\n if (not self.intValue.oclIsUndefined()) then\n SimpleDataType.allInstances()->select(t | t.name = \'Integer\')->asOrderedSet()->first()\n else\n if (not self.boolValue.oclIsUndefined()) then\n SimpleDataType.allInstances()->select(t | t.name = \'Boolean\')->asOrderedSet()->first()\n else \n SimpleDataType.allInstances()->select(t | t.name = \'String\')->asOrderedSet()->first()\n endif\n endif\n endif\n endif\n endif\n " }); addAnnotation (getDataElementUse__ResolveDataType(), source, - new String[] - { + new String[] { "body", "\n if (not self.dataElement.oclIsUndefined()) then\n if (self.dataElement.oclIsKindOf(DataType)) then\n self.dataElement.oclAsType(DataType)\n else\n if (self.dataElement.oclIsKindOf(DataInstance)) then\n self.dataElement.oclAsType(DataInstance).dataType\n else \n if (self.dataElement.oclIsTypeOf(FormalParameter)) then\n self.dataElement.oclAsType(FormalParameter).dataType\n else \n if (self.dataElement.oclIsTypeOf(Function)) then\n self.dataElement.oclAsType(Function).returnType\n else\n null\n endif\n endif \n endif\n endif\n else \n if (self.container().oclIsTypeOf(MemberAssignment)) then\n self.container().oclAsType(MemberAssignment).member.dataType\n else \n if (self.container().oclIsTypeOf(ParameterBinding)) then\n \tself.container().oclAsType(ParameterBinding).resolveParameterType()\n else\n if (self.container().oclIsTypeOf(CollectionDataInstance)) then\n self.container().oclAsType(CollectionDataInstance).dataType.oclAsType(CollectionDataType).itemType\n else\n if (self.container().oclIsTypeOf(DataElementUse)) then\n self.container().oclAsType(DataElementUse).resolveDataType().oclAsType(CollectionDataType).itemType\n else\n if (self.container().oclIsTypeOf(DataInstanceUse)) then\n self.container().oclAsType(DataInstanceUse).resolveDataType().oclAsType(CollectionDataType).itemType\n else\n null\n endif\n endif\n endif\n endif\n endif\n endif\n " }); + addAnnotation + (getCastDataUse__ResolveDataType(), + source, + new String[] { + "body", "self.dataType" + }); } /** @@ -5722,239 +5732,205 @@ public class tdlPackageImpl extends EPackageImpl implements tdlPackage addAnnotation (getDataType__AllConstraints(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getDataType_Constraint(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getSimpleDataType__AllConstraints(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getStructuredDataType__AllMembers(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getStructuredDataType__AllConstraints(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getStructuredDataType_Extension(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getMember_Constraint(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getComponentType__AllGates(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getComponentType__AllTimers(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getComponentType__AllVariables(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getGateType__AllDataTypes(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getDataInstanceUse_Item(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getTimerOperation__GetParticipatingComponents(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getAtomicBehaviour__GetParticipatingComponents(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getBehaviour__GetParticipatingComponents(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getTimeOperation__GetParticipatingComponents(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getQuiescence__GetParticipatingComponents(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getBlock__GetParticipatingComponents(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getBlock__GetParticipatingComponentsExcluding__Behaviour(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getPeriodicBehaviour__GetParticipatingComponents(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getExceptionalBehaviour__GetParticipatingComponents(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getMultipleCombinedBehaviour__GetParticipatingComponents(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getSingleCombinedBehaviour__GetParticipatingComponents(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getTarget_ValueAssignment(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getAssignment__GetParticipatingComponents(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getActionBehaviour__GetParticipatingComponents(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getTestDescriptionReference__GetParticipatingComponents(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getInteraction__GetParticipatingComponents(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getProcedureCall_Argument(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getProcedureSignature_Parameter(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getCollectionDataInstance_Item(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getExtension__TransitiveExtending(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getConstraint_Quantifier(), source, - new String[] - { + new String[] { "nullFree", "false" }); addAnnotation (getDataElementUse_Item(), source, - new String[] - { + new String[] { "nullFree", "false" }); } diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/tdlFactory.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/tdlFactory.java index e402b80a..9f458c24 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/tdlFactory.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/tdlFactory.java @@ -787,6 +787,15 @@ public interface tdlFactory extends EFactory */ DataElementUse createDataElementUse(); + /** + * Returns a new object of class 'Cast Data Use'. + * + * + * @return a new object of class 'Cast Data Use'. + * @generated + */ + CastDataUse createCastDataUse(); + /** * Returns the package supported by this factory. * diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/tdlPackage.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/tdlPackage.java index 6f21d7fa..8afc583d 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/tdlPackage.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/tdlPackage.java @@ -23,7 +23,7 @@ import org.eclipse.emf.ecore.EReference; * * @see org.etsi.mts.tdl.tdlFactory * @model kind="package" - * annotation="http://www.eclipse.org/emf/2002/Ecore invocationDelegates='http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot' settingDelegates='http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot' validationDelegates='http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot'" + * annotation="http://www.eclipse.org/emf/2002/Ecore" * @generated */ public interface tdlPackage extends EPackage @@ -12522,6 +12522,133 @@ public interface tdlPackage extends EPackage */ int DATA_ELEMENT_USE_OPERATION_COUNT = DATA_USE_OPERATION_COUNT + 1; + /** + * The meta object id for the '{@link org.etsi.mts.tdl.impl.CastDataUseImpl Cast Data Use}' class. + * + * + * @see org.etsi.mts.tdl.impl.CastDataUseImpl + * @see org.etsi.mts.tdl.impl.tdlPackageImpl#getCastDataUse() + * @generated + */ + int CAST_DATA_USE = 105; + + /** + * The feature id for the 'Comment' containment reference list. + * + * + * @generated + * @ordered + */ + int CAST_DATA_USE__COMMENT = STATIC_DATA_USE__COMMENT; + + /** + * The feature id for the 'Annotation' containment reference list. + * + * + * @generated + * @ordered + */ + int CAST_DATA_USE__ANNOTATION = STATIC_DATA_USE__ANNOTATION; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int CAST_DATA_USE__NAME = STATIC_DATA_USE__NAME; + + /** + * The feature id for the 'Argument' containment reference list. + * + * + * @generated + * @ordered + */ + int CAST_DATA_USE__ARGUMENT = STATIC_DATA_USE__ARGUMENT; + + /** + * The feature id for the 'Reduction' containment reference list. + * + * + * @generated + * @ordered + */ + int CAST_DATA_USE__REDUCTION = STATIC_DATA_USE__REDUCTION; + + /** + * The feature id for the 'Data Use' containment reference. + * + * + * @generated + * @ordered + */ + int CAST_DATA_USE__DATA_USE = STATIC_DATA_USE_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Data Type' reference. + * + * + * @generated + * @ordered + */ + int CAST_DATA_USE__DATA_TYPE = STATIC_DATA_USE_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Cast Data Use' class. + * + * + * @generated + * @ordered + */ + int CAST_DATA_USE_FEATURE_COUNT = STATIC_DATA_USE_FEATURE_COUNT + 2; + + /** + * The operation id for the 'Container' operation. + * + * + * @generated + * @ordered + */ + int CAST_DATA_USE___CONTAINER = STATIC_DATA_USE___CONTAINER; + + /** + * The operation id for the 'Get Parent Test Description' operation. + * + * + * @generated + * @ordered + */ + int CAST_DATA_USE___GET_PARENT_TEST_DESCRIPTION = STATIC_DATA_USE___GET_PARENT_TEST_DESCRIPTION; + + /** + * The operation id for the 'Is Effectively Static' operation. + * + * + * @generated + * @ordered + */ + int CAST_DATA_USE___IS_EFFECTIVELY_STATIC = STATIC_DATA_USE___IS_EFFECTIVELY_STATIC; + + /** + * The operation id for the 'Resolve Data Type' operation. + * + * + * @generated + * @ordered + */ + int CAST_DATA_USE___RESOLVE_DATA_TYPE = STATIC_DATA_USE_OPERATION_COUNT + 0; + + /** + * The number of operations of the 'Cast Data Use' class. + * + * + * @generated + * @ordered + */ + int CAST_DATA_USE_OPERATION_COUNT = STATIC_DATA_USE_OPERATION_COUNT + 1; + /** * The meta object id for the '{@link org.etsi.mts.tdl.UnassignedMemberTreatment Unassigned Member Treatment}' enum. * @@ -12530,7 +12657,7 @@ public interface tdlPackage extends EPackage * @see org.etsi.mts.tdl.impl.tdlPackageImpl#getUnassignedMemberTreatment() * @generated */ - int UNASSIGNED_MEMBER_TREATMENT = 105; + int UNASSIGNED_MEMBER_TREATMENT = 106; /** * The meta object id for the '{@link org.etsi.mts.tdl.ComponentInstanceRole Component Instance Role}' enum. @@ -12540,7 +12667,7 @@ public interface tdlPackage extends EPackage * @see org.etsi.mts.tdl.impl.tdlPackageImpl#getComponentInstanceRole() * @generated */ - int COMPONENT_INSTANCE_ROLE = 106; + int COMPONENT_INSTANCE_ROLE = 107; /** * The meta object id for the '{@link org.etsi.mts.tdl.GateTypeKind Gate Type Kind}' enum. @@ -12550,7 +12677,7 @@ public interface tdlPackage extends EPackage * @see org.etsi.mts.tdl.impl.tdlPackageImpl#getGateTypeKind() * @generated */ - int GATE_TYPE_KIND = 107; + int GATE_TYPE_KIND = 108; /** * The meta object id for the '{@link org.etsi.mts.tdl.TimeLabelUseKind Time Label Use Kind}' enum. @@ -12560,7 +12687,7 @@ public interface tdlPackage extends EPackage * @see org.etsi.mts.tdl.impl.tdlPackageImpl#getTimeLabelUseKind() * @generated */ - int TIME_LABEL_USE_KIND = 108; + int TIME_LABEL_USE_KIND = 109; /** * The meta object id for the '{@link org.etsi.mts.tdl.ParameterKind Parameter Kind}' enum. @@ -12570,7 +12697,7 @@ public interface tdlPackage extends EPackage * @see org.etsi.mts.tdl.impl.tdlPackageImpl#getParameterKind() * @generated */ - int PARAMETER_KIND = 109; + int PARAMETER_KIND = 110; /** @@ -15679,6 +15806,48 @@ public interface tdlPackage extends EPackage */ EOperation getDataElementUse__ResolveDataType(); + /** + * Returns the meta object for class '{@link org.etsi.mts.tdl.CastDataUse Cast Data Use}'. + * + * + * @return the meta object for class 'Cast Data Use'. + * @see org.etsi.mts.tdl.CastDataUse + * @generated + */ + EClass getCastDataUse(); + + /** + * Returns the meta object for the containment reference '{@link org.etsi.mts.tdl.CastDataUse#getDataUse Data Use}'. + * + * + * @return the meta object for the containment reference 'Data Use'. + * @see org.etsi.mts.tdl.CastDataUse#getDataUse() + * @see #getCastDataUse() + * @generated + */ + EReference getCastDataUse_DataUse(); + + /** + * Returns the meta object for the reference '{@link org.etsi.mts.tdl.CastDataUse#getDataType Data Type}'. + * + * + * @return the meta object for the reference 'Data Type'. + * @see org.etsi.mts.tdl.CastDataUse#getDataType() + * @see #getCastDataUse() + * @generated + */ + EReference getCastDataUse_DataType(); + + /** + * Returns the meta object for the '{@link org.etsi.mts.tdl.CastDataUse#resolveDataType() Resolve Data Type}' operation. + * + * + * @return the meta object for the 'Resolve Data Type' operation. + * @see org.etsi.mts.tdl.CastDataUse#resolveDataType() + * @generated + */ + EOperation getCastDataUse__ResolveDataType(); + /** * Returns the meta object for enum '{@link org.etsi.mts.tdl.UnassignedMemberTreatment Unassigned Member Treatment}'. * @@ -18331,6 +18500,40 @@ public interface tdlPackage extends EPackage */ EOperation DATA_ELEMENT_USE___RESOLVE_DATA_TYPE = eINSTANCE.getDataElementUse__ResolveDataType(); + /** + * The meta object literal for the '{@link org.etsi.mts.tdl.impl.CastDataUseImpl Cast Data Use}' class. + * + * + * @see org.etsi.mts.tdl.impl.CastDataUseImpl + * @see org.etsi.mts.tdl.impl.tdlPackageImpl#getCastDataUse() + * @generated + */ + EClass CAST_DATA_USE = eINSTANCE.getCastDataUse(); + + /** + * The meta object literal for the 'Data Use' containment reference feature. + * + * + * @generated + */ + EReference CAST_DATA_USE__DATA_USE = eINSTANCE.getCastDataUse_DataUse(); + + /** + * The meta object literal for the 'Data Type' reference feature. + * + * + * @generated + */ + EReference CAST_DATA_USE__DATA_TYPE = eINSTANCE.getCastDataUse_DataType(); + + /** + * The meta object literal for the 'Resolve Data Type' operation. + * + * + * @generated + */ + EOperation CAST_DATA_USE___RESOLVE_DATA_TYPE = eINSTANCE.getCastDataUse__ResolveDataType(); + /** * The meta object literal for the '{@link org.etsi.mts.tdl.UnassignedMemberTreatment Unassigned Member Treatment}' enum. * diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/util/tdlAdapterFactory.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/util/tdlAdapterFactory.java index e980db87..d8d69b52 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/util/tdlAdapterFactory.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/util/tdlAdapterFactory.java @@ -25,6 +25,7 @@ import org.etsi.mts.tdl.BehaviourDescription; import org.etsi.mts.tdl.Block; import org.etsi.mts.tdl.BoundedLoopBehaviour; import org.etsi.mts.tdl.Break; +import org.etsi.mts.tdl.CastDataUse; import org.etsi.mts.tdl.CollectionDataInstance; import org.etsi.mts.tdl.CollectionDataType; import org.etsi.mts.tdl.CombinedBehaviour; @@ -141,8 +142,7 @@ public class tdlAdapterFactory extends AdapterFactoryImpl */ public tdlAdapterFactory() { - if (modelPackage == null) - { + if (modelPackage == null) { modelPackage = tdlPackage.eINSTANCE; } } @@ -158,12 +158,10 @@ public class tdlAdapterFactory extends AdapterFactoryImpl @Override public boolean isFactoryForType(Object object) { - if (object == modelPackage) - { + if (object == modelPackage) { return true; } - if (object instanceof EObject) - { + if (object instanceof EObject) { return ((EObject)object).eClass().getEPackage() == modelPackage; } return false; @@ -176,536 +174,433 @@ public class tdlAdapterFactory extends AdapterFactoryImpl * @generated */ protected tdlSwitch modelSwitch = - new tdlSwitch() - { + new tdlSwitch() { @Override - public Adapter caseElement(Element object) - { + public Adapter caseElement(Element object) { return createElementAdapter(); } @Override - public Adapter caseComment(Comment object) - { + public Adapter caseComment(Comment object) { return createCommentAdapter(); } @Override - public Adapter caseAnnotation(Annotation object) - { + public Adapter caseAnnotation(Annotation object) { return createAnnotationAdapter(); } @Override - public Adapter caseAnnotationType(AnnotationType object) - { + public Adapter caseAnnotationType(AnnotationType object) { return createAnnotationTypeAdapter(); } @Override - public Adapter casePackageableElement(PackageableElement object) - { + public Adapter casePackageableElement(PackageableElement object) { return createPackageableElementAdapter(); } @Override - public Adapter caseNamedElement(NamedElement object) - { + public Adapter caseNamedElement(NamedElement object) { return createNamedElementAdapter(); } @Override - public Adapter casePackage(org.etsi.mts.tdl.Package object) - { + public Adapter casePackage(org.etsi.mts.tdl.Package object) { return createPackageAdapter(); } @Override - public Adapter caseElementImport(ElementImport object) - { + public Adapter caseElementImport(ElementImport object) { return createElementImportAdapter(); } @Override - public Adapter caseTestObjective(TestObjective object) - { + public Adapter caseTestObjective(TestObjective object) { return createTestObjectiveAdapter(); } @Override - public Adapter caseDataInstance(DataInstance object) - { + public Adapter caseDataInstance(DataInstance object) { return createDataInstanceAdapter(); } @Override - public Adapter caseMappableDataElement(MappableDataElement object) - { + public Adapter caseMappableDataElement(MappableDataElement object) { return createMappableDataElementAdapter(); } @Override - public Adapter caseDataType(DataType object) - { + public Adapter caseDataType(DataType object) { return createDataTypeAdapter(); } @Override - public Adapter caseDataResourceMapping(DataResourceMapping object) - { + public Adapter caseDataResourceMapping(DataResourceMapping object) { return createDataResourceMappingAdapter(); } @Override - public Adapter caseDataElementMapping(DataElementMapping object) - { + public Adapter caseDataElementMapping(DataElementMapping object) { return createDataElementMappingAdapter(); } @Override - public Adapter caseParameterMapping(ParameterMapping object) - { + public Adapter caseParameterMapping(ParameterMapping object) { return createParameterMappingAdapter(); } @Override - public Adapter caseParameter(Parameter object) - { + public Adapter caseParameter(Parameter object) { return createParameterAdapter(); } @Override - public Adapter caseSimpleDataType(SimpleDataType object) - { + public Adapter caseSimpleDataType(SimpleDataType object) { return createSimpleDataTypeAdapter(); } @Override - public Adapter caseSimpleDataInstance(SimpleDataInstance object) - { + public Adapter caseSimpleDataInstance(SimpleDataInstance object) { return createSimpleDataInstanceAdapter(); } @Override - public Adapter caseStructuredDataType(StructuredDataType object) - { + public Adapter caseStructuredDataType(StructuredDataType object) { return createStructuredDataTypeAdapter(); } @Override - public Adapter caseMember(Member object) - { + public Adapter caseMember(Member object) { return createMemberAdapter(); } @Override - public Adapter caseStructuredDataInstance(StructuredDataInstance object) - { + public Adapter caseStructuredDataInstance(StructuredDataInstance object) { return createStructuredDataInstanceAdapter(); } @Override - public Adapter caseMemberAssignment(MemberAssignment object) - { + public Adapter caseMemberAssignment(MemberAssignment object) { return createMemberAssignmentAdapter(); } @Override - public Adapter caseStaticDataUse(StaticDataUse object) - { + public Adapter caseStaticDataUse(StaticDataUse object) { return createStaticDataUseAdapter(); } @Override - public Adapter caseDataUse(DataUse object) - { + public Adapter caseDataUse(DataUse object) { return createDataUseAdapter(); } @Override - public Adapter caseParameterBinding(ParameterBinding object) - { + public Adapter caseParameterBinding(ParameterBinding object) { return createParameterBindingAdapter(); } @Override - public Adapter caseAction(Action object) - { + public Adapter caseAction(Action object) { return createActionAdapter(); } @Override - public Adapter caseFormalParameter(FormalParameter object) - { + public Adapter caseFormalParameter(FormalParameter object) { return createFormalParameterAdapter(); } @Override - public Adapter caseFunction(Function object) - { + public Adapter caseFunction(Function object) { return createFunctionAdapter(); } @Override - public Adapter caseFormalParameterUse(FormalParameterUse object) - { + public Adapter caseFormalParameterUse(FormalParameterUse object) { return createFormalParameterUseAdapter(); } @Override - public Adapter caseDynamicDataUse(DynamicDataUse object) - { + public Adapter caseDynamicDataUse(DynamicDataUse object) { return createDynamicDataUseAdapter(); } @Override - public Adapter caseVariable(Variable object) - { + public Adapter caseVariable(Variable object) { return createVariableAdapter(); } @Override - public Adapter caseFunctionCall(FunctionCall object) - { + public Adapter caseFunctionCall(FunctionCall object) { return createFunctionCallAdapter(); } @Override - public Adapter caseVariableUse(VariableUse object) - { + public Adapter caseVariableUse(VariableUse object) { return createVariableUseAdapter(); } @Override - public Adapter caseComponentInstance(ComponentInstance object) - { + public Adapter caseComponentInstance(ComponentInstance object) { return createComponentInstanceAdapter(); } @Override - public Adapter caseComponentType(ComponentType object) - { + public Adapter caseComponentType(ComponentType object) { return createComponentTypeAdapter(); } @Override - public Adapter caseGateInstance(GateInstance object) - { + public Adapter caseGateInstance(GateInstance object) { return createGateInstanceAdapter(); } @Override - public Adapter caseGateType(GateType object) - { + public Adapter caseGateType(GateType object) { return createGateTypeAdapter(); } @Override - public Adapter caseTimer(Timer object) - { + public Adapter caseTimer(Timer object) { return createTimerAdapter(); } @Override - public Adapter caseOmitValue(OmitValue object) - { + public Adapter caseOmitValue(OmitValue object) { return createOmitValueAdapter(); } @Override - public Adapter caseSpecialValueUse(SpecialValueUse object) - { + public Adapter caseSpecialValueUse(SpecialValueUse object) { return createSpecialValueUseAdapter(); } @Override - public Adapter caseAnyValue(AnyValue object) - { + public Adapter caseAnyValue(AnyValue object) { return createAnyValueAdapter(); } @Override - public Adapter caseAnyValueOrOmit(AnyValueOrOmit object) - { + public Adapter caseAnyValueOrOmit(AnyValueOrOmit object) { return createAnyValueOrOmitAdapter(); } @Override - public Adapter caseDataInstanceUse(DataInstanceUse object) - { + public Adapter caseDataInstanceUse(DataInstanceUse object) { return createDataInstanceUseAdapter(); } @Override - public Adapter caseTime(Time object) - { + public Adapter caseTime(Time object) { return createTimeAdapter(); } @Override - public Adapter caseTimeLabel(TimeLabel object) - { + public Adapter caseTimeLabel(TimeLabel object) { return createTimeLabelAdapter(); } @Override - public Adapter caseTimerOperation(TimerOperation object) - { + public Adapter caseTimerOperation(TimerOperation object) { return createTimerOperationAdapter(); } @Override - public Adapter caseAtomicBehaviour(AtomicBehaviour object) - { + public Adapter caseAtomicBehaviour(AtomicBehaviour object) { return createAtomicBehaviourAdapter(); } @Override - public Adapter caseBehaviour(Behaviour object) - { + public Adapter caseBehaviour(Behaviour object) { return createBehaviourAdapter(); } @Override - public Adapter caseTimeConstraint(TimeConstraint object) - { + public Adapter caseTimeConstraint(TimeConstraint object) { return createTimeConstraintAdapter(); } @Override - public Adapter caseTimerStart(TimerStart object) - { + public Adapter caseTimerStart(TimerStart object) { return createTimerStartAdapter(); } @Override - public Adapter caseTimerStop(TimerStop object) - { + public Adapter caseTimerStop(TimerStop object) { return createTimerStopAdapter(); } @Override - public Adapter caseTimeOut(TimeOut object) - { + public Adapter caseTimeOut(TimeOut object) { return createTimeOutAdapter(); } @Override - public Adapter caseTimeOperation(TimeOperation object) - { + public Adapter caseTimeOperation(TimeOperation object) { return createTimeOperationAdapter(); } @Override - public Adapter caseWait(Wait object) - { + public Adapter caseWait(Wait object) { return createWaitAdapter(); } @Override - public Adapter caseQuiescence(Quiescence object) - { + public Adapter caseQuiescence(Quiescence object) { return createQuiescenceAdapter(); } @Override - public Adapter caseGateReference(GateReference object) - { + public Adapter caseGateReference(GateReference object) { return createGateReferenceAdapter(); } @Override - public Adapter caseTimeLabelUse(TimeLabelUse object) - { + public Adapter caseTimeLabelUse(TimeLabelUse object) { return createTimeLabelUseAdapter(); } @Override - public Adapter caseTestConfiguration(TestConfiguration object) - { + public Adapter caseTestConfiguration(TestConfiguration object) { return createTestConfigurationAdapter(); } @Override - public Adapter caseConnection(Connection object) - { + public Adapter caseConnection(Connection object) { return createConnectionAdapter(); } @Override - public Adapter caseTestDescription(TestDescription object) - { + public Adapter caseTestDescription(TestDescription object) { return createTestDescriptionAdapter(); } @Override - public Adapter caseBehaviourDescription(BehaviourDescription object) - { + public Adapter caseBehaviourDescription(BehaviourDescription object) { return createBehaviourDescriptionAdapter(); } @Override - public Adapter caseBlock(Block object) - { + public Adapter caseBlock(Block object) { return createBlockAdapter(); } @Override - public Adapter caseCombinedBehaviour(CombinedBehaviour object) - { + public Adapter caseCombinedBehaviour(CombinedBehaviour object) { return createCombinedBehaviourAdapter(); } @Override - public Adapter casePeriodicBehaviour(PeriodicBehaviour object) - { + public Adapter casePeriodicBehaviour(PeriodicBehaviour object) { return createPeriodicBehaviourAdapter(); } @Override - public Adapter caseExceptionalBehaviour(ExceptionalBehaviour object) - { + public Adapter caseExceptionalBehaviour(ExceptionalBehaviour object) { return createExceptionalBehaviourAdapter(); } @Override - public Adapter caseAlternativeBehaviour(AlternativeBehaviour object) - { + public Adapter caseAlternativeBehaviour(AlternativeBehaviour object) { return createAlternativeBehaviourAdapter(); } @Override - public Adapter caseMultipleCombinedBehaviour(MultipleCombinedBehaviour object) - { + public Adapter caseMultipleCombinedBehaviour(MultipleCombinedBehaviour object) { return createMultipleCombinedBehaviourAdapter(); } @Override - public Adapter caseParallelBehaviour(ParallelBehaviour object) - { + public Adapter caseParallelBehaviour(ParallelBehaviour object) { return createParallelBehaviourAdapter(); } @Override - public Adapter caseBoundedLoopBehaviour(BoundedLoopBehaviour object) - { + public Adapter caseBoundedLoopBehaviour(BoundedLoopBehaviour object) { return createBoundedLoopBehaviourAdapter(); } @Override - public Adapter caseSingleCombinedBehaviour(SingleCombinedBehaviour object) - { + public Adapter caseSingleCombinedBehaviour(SingleCombinedBehaviour object) { return createSingleCombinedBehaviourAdapter(); } @Override - public Adapter caseOptionalBehaviour(OptionalBehaviour object) - { + public Adapter caseOptionalBehaviour(OptionalBehaviour object) { return createOptionalBehaviourAdapter(); } @Override - public Adapter caseUnboundedLoopBehaviour(UnboundedLoopBehaviour object) - { + public Adapter caseUnboundedLoopBehaviour(UnboundedLoopBehaviour object) { return createUnboundedLoopBehaviourAdapter(); } @Override - public Adapter caseConditionalBehaviour(ConditionalBehaviour object) - { + public Adapter caseConditionalBehaviour(ConditionalBehaviour object) { return createConditionalBehaviourAdapter(); } @Override - public Adapter caseCompoundBehaviour(CompoundBehaviour object) - { + public Adapter caseCompoundBehaviour(CompoundBehaviour object) { return createCompoundBehaviourAdapter(); } @Override - public Adapter caseDefaultBehaviour(DefaultBehaviour object) - { + public Adapter caseDefaultBehaviour(DefaultBehaviour object) { return createDefaultBehaviourAdapter(); } @Override - public Adapter caseInterruptBehaviour(InterruptBehaviour object) - { + public Adapter caseInterruptBehaviour(InterruptBehaviour object) { return createInterruptBehaviourAdapter(); } @Override - public Adapter caseTarget(Target object) - { + public Adapter caseTarget(Target object) { return createTargetAdapter(); } @Override - public Adapter caseVerdictAssignment(VerdictAssignment object) - { + public Adapter caseVerdictAssignment(VerdictAssignment object) { return createVerdictAssignmentAdapter(); } @Override - public Adapter caseAssertion(Assertion object) - { + public Adapter caseAssertion(Assertion object) { return createAssertionAdapter(); } @Override - public Adapter caseStop(Stop object) - { + public Adapter caseStop(Stop object) { return createStopAdapter(); } @Override - public Adapter caseBreak(Break object) - { + public Adapter caseBreak(Break object) { return createBreakAdapter(); } @Override - public Adapter caseAssignment(Assignment object) - { + public Adapter caseAssignment(Assignment object) { return createAssignmentAdapter(); } @Override - public Adapter caseActionBehaviour(ActionBehaviour object) - { + public Adapter caseActionBehaviour(ActionBehaviour object) { return createActionBehaviourAdapter(); } @Override - public Adapter caseInlineAction(InlineAction object) - { + public Adapter caseInlineAction(InlineAction object) { return createInlineActionAdapter(); } @Override - public Adapter caseActionReference(ActionReference object) - { + public Adapter caseActionReference(ActionReference object) { return createActionReferenceAdapter(); } @Override - public Adapter caseTestDescriptionReference(TestDescriptionReference object) - { + public Adapter caseTestDescriptionReference(TestDescriptionReference object) { return createTestDescriptionReferenceAdapter(); } @Override - public Adapter caseComponentInstanceBinding(ComponentInstanceBinding object) - { + public Adapter caseComponentInstanceBinding(ComponentInstanceBinding object) { return createComponentInstanceBindingAdapter(); } @Override - public Adapter caseInteraction(Interaction object) - { + public Adapter caseInteraction(Interaction object) { return createInteractionAdapter(); } @Override - public Adapter caseMessage(Message object) - { + public Adapter caseMessage(Message object) { return createMessageAdapter(); } @Override - public Adapter casePredefinedFunction(PredefinedFunction object) - { + public Adapter casePredefinedFunction(PredefinedFunction object) { return createPredefinedFunctionAdapter(); } @Override - public Adapter caseMemberReference(MemberReference object) - { + public Adapter caseMemberReference(MemberReference object) { return createMemberReferenceAdapter(); } @Override - public Adapter casePredefinedFunctionCall(PredefinedFunctionCall object) - { + public Adapter casePredefinedFunctionCall(PredefinedFunctionCall object) { return createPredefinedFunctionCallAdapter(); } @Override - public Adapter caseLocalExpression(LocalExpression object) - { + public Adapter caseLocalExpression(LocalExpression object) { return createLocalExpressionAdapter(); } @Override - public Adapter caseValueAssignment(ValueAssignment object) - { + public Adapter caseValueAssignment(ValueAssignment object) { return createValueAssignmentAdapter(); } @Override - public Adapter caseProcedureCall(ProcedureCall object) - { + public Adapter caseProcedureCall(ProcedureCall object) { return createProcedureCallAdapter(); } @Override - public Adapter caseProcedureSignature(ProcedureSignature object) - { + public Adapter caseProcedureSignature(ProcedureSignature object) { return createProcedureSignatureAdapter(); } @Override - public Adapter caseProcedureParameter(ProcedureParameter object) - { + public Adapter caseProcedureParameter(ProcedureParameter object) { return createProcedureParameterAdapter(); } @Override - public Adapter caseCollectionDataType(CollectionDataType object) - { + public Adapter caseCollectionDataType(CollectionDataType object) { return createCollectionDataTypeAdapter(); } @Override - public Adapter caseCollectionDataInstance(CollectionDataInstance object) - { + public Adapter caseCollectionDataInstance(CollectionDataInstance object) { return createCollectionDataInstanceAdapter(); } @Override - public Adapter caseExtension(Extension object) - { + public Adapter caseExtension(Extension object) { return createExtensionAdapter(); } @Override - public Adapter caseLiteralValueUse(LiteralValueUse object) - { + public Adapter caseLiteralValueUse(LiteralValueUse object) { return createLiteralValueUseAdapter(); } @Override - public Adapter caseConstraintType(ConstraintType object) - { + public Adapter caseConstraintType(ConstraintType object) { return createConstraintTypeAdapter(); } @Override - public Adapter caseConstraint(Constraint object) - { + public Adapter caseConstraint(Constraint object) { return createConstraintAdapter(); } @Override - public Adapter caseEnumDataType(EnumDataType object) - { + public Adapter caseEnumDataType(EnumDataType object) { return createEnumDataTypeAdapter(); } @Override - public Adapter caseDataElementUse(DataElementUse object) - { + public Adapter caseDataElementUse(DataElementUse object) { return createDataElementUseAdapter(); } @Override - public Adapter defaultCase(EObject object) - { + public Adapter caseCastDataUse(CastDataUse object) { + return createCastDataUseAdapter(); + } + @Override + public Adapter defaultCase(EObject object) { return createEObjectAdapter(); } }; @@ -2300,6 +2195,20 @@ public class tdlAdapterFactory extends AdapterFactoryImpl return null; } + /** + * Creates a new adapter for an object of class '{@link org.etsi.mts.tdl.CastDataUse Cast Data Use}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.etsi.mts.tdl.CastDataUse + * @generated + */ + public Adapter createCastDataUseAdapter() { + return null; + } + /** * Creates a new adapter for the default case. * diff --git a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/util/tdlSwitch.java b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/util/tdlSwitch.java index 3dc43e84..ba73aed0 100644 --- a/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/util/tdlSwitch.java +++ b/plugins/org.etsi.mts.tdl.model/src-gen/org/etsi/mts/tdl/util/tdlSwitch.java @@ -23,6 +23,7 @@ import org.etsi.mts.tdl.BehaviourDescription; import org.etsi.mts.tdl.Block; import org.etsi.mts.tdl.BoundedLoopBehaviour; import org.etsi.mts.tdl.Break; +import org.etsi.mts.tdl.CastDataUse; import org.etsi.mts.tdl.CollectionDataInstance; import org.etsi.mts.tdl.CollectionDataType; import org.etsi.mts.tdl.CombinedBehaviour; @@ -144,8 +145,7 @@ public class tdlSwitch extends Switch */ public tdlSwitch() { - if (modelPackage == null) - { + if (modelPackage == null) { modelPackage = tdlPackage.eINSTANCE; } } @@ -174,33 +174,28 @@ public class tdlSwitch extends Switch @Override protected T doSwitch(int classifierID, EObject theEObject) { - switch (classifierID) - { - case tdlPackage.ELEMENT: - { + switch (classifierID) { + case tdlPackage.ELEMENT: { Element element = (Element)theEObject; T result = caseElement(element); if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.COMMENT: - { + case tdlPackage.COMMENT: { Comment comment = (Comment)theEObject; T result = caseComment(comment); if (result == null) result = caseElement(comment); if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.ANNOTATION: - { + case tdlPackage.ANNOTATION: { Annotation annotation = (Annotation)theEObject; T result = caseAnnotation(annotation); if (result == null) result = caseElement(annotation); if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.ANNOTATION_TYPE: - { + case tdlPackage.ANNOTATION_TYPE: { AnnotationType annotationType = (AnnotationType)theEObject; T result = caseAnnotationType(annotationType); if (result == null) result = casePackageableElement(annotationType); @@ -209,8 +204,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.PACKAGEABLE_ELEMENT: - { + case tdlPackage.PACKAGEABLE_ELEMENT: { PackageableElement packageableElement = (PackageableElement)theEObject; T result = casePackageableElement(packageableElement); if (result == null) result = caseNamedElement(packageableElement); @@ -218,16 +212,14 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.NAMED_ELEMENT: - { + case tdlPackage.NAMED_ELEMENT: { NamedElement namedElement = (NamedElement)theEObject; T result = caseNamedElement(namedElement); if (result == null) result = caseElement(namedElement); if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.PACKAGE: - { + case tdlPackage.PACKAGE: { org.etsi.mts.tdl.Package package_ = (org.etsi.mts.tdl.Package)theEObject; T result = casePackage(package_); if (result == null) result = caseNamedElement(package_); @@ -235,16 +227,14 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.ELEMENT_IMPORT: - { + case tdlPackage.ELEMENT_IMPORT: { ElementImport elementImport = (ElementImport)theEObject; T result = caseElementImport(elementImport); if (result == null) result = caseElement(elementImport); if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.TEST_OBJECTIVE: - { + case tdlPackage.TEST_OBJECTIVE: { TestObjective testObjective = (TestObjective)theEObject; T result = caseTestObjective(testObjective); if (result == null) result = casePackageableElement(testObjective); @@ -253,8 +243,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.DATA_INSTANCE: - { + case tdlPackage.DATA_INSTANCE: { DataInstance dataInstance = (DataInstance)theEObject; T result = caseDataInstance(dataInstance); if (result == null) result = caseMappableDataElement(dataInstance); @@ -264,8 +253,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.MAPPABLE_DATA_ELEMENT: - { + case tdlPackage.MAPPABLE_DATA_ELEMENT: { MappableDataElement mappableDataElement = (MappableDataElement)theEObject; T result = caseMappableDataElement(mappableDataElement); if (result == null) result = casePackageableElement(mappableDataElement); @@ -274,8 +262,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.DATA_TYPE: - { + case tdlPackage.DATA_TYPE: { DataType dataType = (DataType)theEObject; T result = caseDataType(dataType); if (result == null) result = caseMappableDataElement(dataType); @@ -285,8 +272,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.DATA_RESOURCE_MAPPING: - { + case tdlPackage.DATA_RESOURCE_MAPPING: { DataResourceMapping dataResourceMapping = (DataResourceMapping)theEObject; T result = caseDataResourceMapping(dataResourceMapping); if (result == null) result = casePackageableElement(dataResourceMapping); @@ -295,8 +281,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.DATA_ELEMENT_MAPPING: - { + case tdlPackage.DATA_ELEMENT_MAPPING: { DataElementMapping dataElementMapping = (DataElementMapping)theEObject; T result = caseDataElementMapping(dataElementMapping); if (result == null) result = casePackageableElement(dataElementMapping); @@ -305,16 +290,14 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.PARAMETER_MAPPING: - { + case tdlPackage.PARAMETER_MAPPING: { ParameterMapping parameterMapping = (ParameterMapping)theEObject; T result = caseParameterMapping(parameterMapping); if (result == null) result = caseElement(parameterMapping); if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.PARAMETER: - { + case tdlPackage.PARAMETER: { Parameter parameter = (Parameter)theEObject; T result = caseParameter(parameter); if (result == null) result = caseNamedElement(parameter); @@ -322,8 +305,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.SIMPLE_DATA_TYPE: - { + case tdlPackage.SIMPLE_DATA_TYPE: { SimpleDataType simpleDataType = (SimpleDataType)theEObject; T result = caseSimpleDataType(simpleDataType); if (result == null) result = caseDataType(simpleDataType); @@ -334,8 +316,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.SIMPLE_DATA_INSTANCE: - { + case tdlPackage.SIMPLE_DATA_INSTANCE: { SimpleDataInstance simpleDataInstance = (SimpleDataInstance)theEObject; T result = caseSimpleDataInstance(simpleDataInstance); if (result == null) result = caseDataInstance(simpleDataInstance); @@ -346,8 +327,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.STRUCTURED_DATA_TYPE: - { + case tdlPackage.STRUCTURED_DATA_TYPE: { StructuredDataType structuredDataType = (StructuredDataType)theEObject; T result = caseStructuredDataType(structuredDataType); if (result == null) result = caseDataType(structuredDataType); @@ -358,8 +338,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.MEMBER: - { + case tdlPackage.MEMBER: { Member member = (Member)theEObject; T result = caseMember(member); if (result == null) result = caseParameter(member); @@ -368,8 +347,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.STRUCTURED_DATA_INSTANCE: - { + case tdlPackage.STRUCTURED_DATA_INSTANCE: { StructuredDataInstance structuredDataInstance = (StructuredDataInstance)theEObject; T result = caseStructuredDataInstance(structuredDataInstance); if (result == null) result = caseDataInstance(structuredDataInstance); @@ -380,16 +358,14 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.MEMBER_ASSIGNMENT: - { + case tdlPackage.MEMBER_ASSIGNMENT: { MemberAssignment memberAssignment = (MemberAssignment)theEObject; T result = caseMemberAssignment(memberAssignment); if (result == null) result = caseElement(memberAssignment); if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.STATIC_DATA_USE: - { + case tdlPackage.STATIC_DATA_USE: { StaticDataUse staticDataUse = (StaticDataUse)theEObject; T result = caseStaticDataUse(staticDataUse); if (result == null) result = caseDataUse(staticDataUse); @@ -397,24 +373,21 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.DATA_USE: - { + case tdlPackage.DATA_USE: { DataUse dataUse = (DataUse)theEObject; T result = caseDataUse(dataUse); if (result == null) result = caseElement(dataUse); if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.PARAMETER_BINDING: - { + case tdlPackage.PARAMETER_BINDING: { ParameterBinding parameterBinding = (ParameterBinding)theEObject; T result = caseParameterBinding(parameterBinding); if (result == null) result = caseElement(parameterBinding); if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.ACTION: - { + case tdlPackage.ACTION: { Action action = (Action)theEObject; T result = caseAction(action); if (result == null) result = caseMappableDataElement(action); @@ -424,8 +397,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.FORMAL_PARAMETER: - { + case tdlPackage.FORMAL_PARAMETER: { FormalParameter formalParameter = (FormalParameter)theEObject; T result = caseFormalParameter(formalParameter); if (result == null) result = caseParameter(formalParameter); @@ -434,8 +406,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.FUNCTION: - { + case tdlPackage.FUNCTION: { Function function = (Function)theEObject; T result = caseFunction(function); if (result == null) result = caseAction(function); @@ -446,8 +417,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.FORMAL_PARAMETER_USE: - { + case tdlPackage.FORMAL_PARAMETER_USE: { FormalParameterUse formalParameterUse = (FormalParameterUse)theEObject; T result = caseFormalParameterUse(formalParameterUse); if (result == null) result = caseDynamicDataUse(formalParameterUse); @@ -456,8 +426,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.DYNAMIC_DATA_USE: - { + case tdlPackage.DYNAMIC_DATA_USE: { DynamicDataUse dynamicDataUse = (DynamicDataUse)theEObject; T result = caseDynamicDataUse(dynamicDataUse); if (result == null) result = caseDataUse(dynamicDataUse); @@ -465,8 +434,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.VARIABLE: - { + case tdlPackage.VARIABLE: { Variable variable = (Variable)theEObject; T result = caseVariable(variable); if (result == null) result = caseNamedElement(variable); @@ -474,8 +442,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.FUNCTION_CALL: - { + case tdlPackage.FUNCTION_CALL: { FunctionCall functionCall = (FunctionCall)theEObject; T result = caseFunctionCall(functionCall); if (result == null) result = caseDynamicDataUse(functionCall); @@ -484,8 +451,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.VARIABLE_USE: - { + case tdlPackage.VARIABLE_USE: { VariableUse variableUse = (VariableUse)theEObject; T result = caseVariableUse(variableUse); if (result == null) result = caseDynamicDataUse(variableUse); @@ -494,8 +460,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.COMPONENT_INSTANCE: - { + case tdlPackage.COMPONENT_INSTANCE: { ComponentInstance componentInstance = (ComponentInstance)theEObject; T result = caseComponentInstance(componentInstance); if (result == null) result = caseNamedElement(componentInstance); @@ -503,8 +468,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.COMPONENT_TYPE: - { + case tdlPackage.COMPONENT_TYPE: { ComponentType componentType = (ComponentType)theEObject; T result = caseComponentType(componentType); if (result == null) result = casePackageableElement(componentType); @@ -513,8 +477,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.GATE_INSTANCE: - { + case tdlPackage.GATE_INSTANCE: { GateInstance gateInstance = (GateInstance)theEObject; T result = caseGateInstance(gateInstance); if (result == null) result = caseNamedElement(gateInstance); @@ -522,8 +485,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.GATE_TYPE: - { + case tdlPackage.GATE_TYPE: { GateType gateType = (GateType)theEObject; T result = caseGateType(gateType); if (result == null) result = casePackageableElement(gateType); @@ -532,8 +494,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.TIMER: - { + case tdlPackage.TIMER: { Timer timer = (Timer)theEObject; T result = caseTimer(timer); if (result == null) result = caseNamedElement(timer); @@ -541,8 +502,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.OMIT_VALUE: - { + case tdlPackage.OMIT_VALUE: { OmitValue omitValue = (OmitValue)theEObject; T result = caseOmitValue(omitValue); if (result == null) result = caseSpecialValueUse(omitValue); @@ -552,8 +512,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.SPECIAL_VALUE_USE: - { + case tdlPackage.SPECIAL_VALUE_USE: { SpecialValueUse specialValueUse = (SpecialValueUse)theEObject; T result = caseSpecialValueUse(specialValueUse); if (result == null) result = caseStaticDataUse(specialValueUse); @@ -562,8 +521,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.ANY_VALUE: - { + case tdlPackage.ANY_VALUE: { AnyValue anyValue = (AnyValue)theEObject; T result = caseAnyValue(anyValue); if (result == null) result = caseSpecialValueUse(anyValue); @@ -573,8 +531,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.ANY_VALUE_OR_OMIT: - { + case tdlPackage.ANY_VALUE_OR_OMIT: { AnyValueOrOmit anyValueOrOmit = (AnyValueOrOmit)theEObject; T result = caseAnyValueOrOmit(anyValueOrOmit); if (result == null) result = caseSpecialValueUse(anyValueOrOmit); @@ -584,8 +541,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.DATA_INSTANCE_USE: - { + case tdlPackage.DATA_INSTANCE_USE: { DataInstanceUse dataInstanceUse = (DataInstanceUse)theEObject; T result = caseDataInstanceUse(dataInstanceUse); if (result == null) result = caseStaticDataUse(dataInstanceUse); @@ -594,8 +550,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.TIME: - { + case tdlPackage.TIME: { Time time = (Time)theEObject; T result = caseTime(time); if (result == null) result = caseSimpleDataType(time); @@ -607,8 +562,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.TIME_LABEL: - { + case tdlPackage.TIME_LABEL: { TimeLabel timeLabel = (TimeLabel)theEObject; T result = caseTimeLabel(timeLabel); if (result == null) result = caseNamedElement(timeLabel); @@ -616,8 +570,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.TIMER_OPERATION: - { + case tdlPackage.TIMER_OPERATION: { TimerOperation timerOperation = (TimerOperation)theEObject; T result = caseTimerOperation(timerOperation); if (result == null) result = caseAtomicBehaviour(timerOperation); @@ -626,8 +579,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.ATOMIC_BEHAVIOUR: - { + case tdlPackage.ATOMIC_BEHAVIOUR: { AtomicBehaviour atomicBehaviour = (AtomicBehaviour)theEObject; T result = caseAtomicBehaviour(atomicBehaviour); if (result == null) result = caseBehaviour(atomicBehaviour); @@ -635,24 +587,21 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.BEHAVIOUR: - { + case tdlPackage.BEHAVIOUR: { Behaviour behaviour = (Behaviour)theEObject; T result = caseBehaviour(behaviour); if (result == null) result = caseElement(behaviour); if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.TIME_CONSTRAINT: - { + case tdlPackage.TIME_CONSTRAINT: { TimeConstraint timeConstraint = (TimeConstraint)theEObject; T result = caseTimeConstraint(timeConstraint); if (result == null) result = caseElement(timeConstraint); if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.TIMER_START: - { + case tdlPackage.TIMER_START: { TimerStart timerStart = (TimerStart)theEObject; T result = caseTimerStart(timerStart); if (result == null) result = caseTimerOperation(timerStart); @@ -662,8 +611,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.TIMER_STOP: - { + case tdlPackage.TIMER_STOP: { TimerStop timerStop = (TimerStop)theEObject; T result = caseTimerStop(timerStop); if (result == null) result = caseTimerOperation(timerStop); @@ -673,8 +621,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.TIME_OUT: - { + case tdlPackage.TIME_OUT: { TimeOut timeOut = (TimeOut)theEObject; T result = caseTimeOut(timeOut); if (result == null) result = caseTimerOperation(timeOut); @@ -684,8 +631,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.TIME_OPERATION: - { + case tdlPackage.TIME_OPERATION: { TimeOperation timeOperation = (TimeOperation)theEObject; T result = caseTimeOperation(timeOperation); if (result == null) result = caseAtomicBehaviour(timeOperation); @@ -694,8 +640,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.WAIT: - { + case tdlPackage.WAIT: { Wait wait = (Wait)theEObject; T result = caseWait(wait); if (result == null) result = caseTimeOperation(wait); @@ -705,8 +650,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.QUIESCENCE: - { + case tdlPackage.QUIESCENCE: { Quiescence quiescence = (Quiescence)theEObject; T result = caseQuiescence(quiescence); if (result == null) result = caseTimeOperation(quiescence); @@ -716,16 +660,14 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.GATE_REFERENCE: - { + case tdlPackage.GATE_REFERENCE: { GateReference gateReference = (GateReference)theEObject; T result = caseGateReference(gateReference); if (result == null) result = caseElement(gateReference); if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.TIME_LABEL_USE: - { + case tdlPackage.TIME_LABEL_USE: { TimeLabelUse timeLabelUse = (TimeLabelUse)theEObject; T result = caseTimeLabelUse(timeLabelUse); if (result == null) result = caseDynamicDataUse(timeLabelUse); @@ -734,8 +676,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.TEST_CONFIGURATION: - { + case tdlPackage.TEST_CONFIGURATION: { TestConfiguration testConfiguration = (TestConfiguration)theEObject; T result = caseTestConfiguration(testConfiguration); if (result == null) result = casePackageableElement(testConfiguration); @@ -744,16 +685,14 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.CONNECTION: - { + case tdlPackage.CONNECTION: { Connection connection = (Connection)theEObject; T result = caseConnection(connection); if (result == null) result = caseElement(connection); if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.TEST_DESCRIPTION: - { + case tdlPackage.TEST_DESCRIPTION: { TestDescription testDescription = (TestDescription)theEObject; T result = caseTestDescription(testDescription); if (result == null) result = casePackageableElement(testDescription); @@ -762,24 +701,21 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.BEHAVIOUR_DESCRIPTION: - { + case tdlPackage.BEHAVIOUR_DESCRIPTION: { BehaviourDescription behaviourDescription = (BehaviourDescription)theEObject; T result = caseBehaviourDescription(behaviourDescription); if (result == null) result = caseElement(behaviourDescription); if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.BLOCK: - { + case tdlPackage.BLOCK: { Block block = (Block)theEObject; T result = caseBlock(block); if (result == null) result = caseElement(block); if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.COMBINED_BEHAVIOUR: - { + case tdlPackage.COMBINED_BEHAVIOUR: { CombinedBehaviour combinedBehaviour = (CombinedBehaviour)theEObject; T result = caseCombinedBehaviour(combinedBehaviour); if (result == null) result = caseBehaviour(combinedBehaviour); @@ -787,8 +723,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.PERIODIC_BEHAVIOUR: - { + case tdlPackage.PERIODIC_BEHAVIOUR: { PeriodicBehaviour periodicBehaviour = (PeriodicBehaviour)theEObject; T result = casePeriodicBehaviour(periodicBehaviour); if (result == null) result = caseBehaviour(periodicBehaviour); @@ -796,8 +731,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.EXCEPTIONAL_BEHAVIOUR: - { + case tdlPackage.EXCEPTIONAL_BEHAVIOUR: { ExceptionalBehaviour exceptionalBehaviour = (ExceptionalBehaviour)theEObject; T result = caseExceptionalBehaviour(exceptionalBehaviour); if (result == null) result = caseBehaviour(exceptionalBehaviour); @@ -805,8 +739,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.ALTERNATIVE_BEHAVIOUR: - { + case tdlPackage.ALTERNATIVE_BEHAVIOUR: { AlternativeBehaviour alternativeBehaviour = (AlternativeBehaviour)theEObject; T result = caseAlternativeBehaviour(alternativeBehaviour); if (result == null) result = caseMultipleCombinedBehaviour(alternativeBehaviour); @@ -816,8 +749,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.MULTIPLE_COMBINED_BEHAVIOUR: - { + case tdlPackage.MULTIPLE_COMBINED_BEHAVIOUR: { MultipleCombinedBehaviour multipleCombinedBehaviour = (MultipleCombinedBehaviour)theEObject; T result = caseMultipleCombinedBehaviour(multipleCombinedBehaviour); if (result == null) result = caseCombinedBehaviour(multipleCombinedBehaviour); @@ -826,8 +758,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.PARALLEL_BEHAVIOUR: - { + case tdlPackage.PARALLEL_BEHAVIOUR: { ParallelBehaviour parallelBehaviour = (ParallelBehaviour)theEObject; T result = caseParallelBehaviour(parallelBehaviour); if (result == null) result = caseMultipleCombinedBehaviour(parallelBehaviour); @@ -837,8 +768,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.BOUNDED_LOOP_BEHAVIOUR: - { + case tdlPackage.BOUNDED_LOOP_BEHAVIOUR: { BoundedLoopBehaviour boundedLoopBehaviour = (BoundedLoopBehaviour)theEObject; T result = caseBoundedLoopBehaviour(boundedLoopBehaviour); if (result == null) result = caseSingleCombinedBehaviour(boundedLoopBehaviour); @@ -848,8 +778,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.SINGLE_COMBINED_BEHAVIOUR: - { + case tdlPackage.SINGLE_COMBINED_BEHAVIOUR: { SingleCombinedBehaviour singleCombinedBehaviour = (SingleCombinedBehaviour)theEObject; T result = caseSingleCombinedBehaviour(singleCombinedBehaviour); if (result == null) result = caseCombinedBehaviour(singleCombinedBehaviour); @@ -858,8 +787,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.OPTIONAL_BEHAVIOUR: - { + case tdlPackage.OPTIONAL_BEHAVIOUR: { OptionalBehaviour optionalBehaviour = (OptionalBehaviour)theEObject; T result = caseOptionalBehaviour(optionalBehaviour); if (result == null) result = caseSingleCombinedBehaviour(optionalBehaviour); @@ -869,8 +797,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.UNBOUNDED_LOOP_BEHAVIOUR: - { + case tdlPackage.UNBOUNDED_LOOP_BEHAVIOUR: { UnboundedLoopBehaviour unboundedLoopBehaviour = (UnboundedLoopBehaviour)theEObject; T result = caseUnboundedLoopBehaviour(unboundedLoopBehaviour); if (result == null) result = caseSingleCombinedBehaviour(unboundedLoopBehaviour); @@ -880,8 +807,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.CONDITIONAL_BEHAVIOUR: - { + case tdlPackage.CONDITIONAL_BEHAVIOUR: { ConditionalBehaviour conditionalBehaviour = (ConditionalBehaviour)theEObject; T result = caseConditionalBehaviour(conditionalBehaviour); if (result == null) result = caseMultipleCombinedBehaviour(conditionalBehaviour); @@ -891,8 +817,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.COMPOUND_BEHAVIOUR: - { + case tdlPackage.COMPOUND_BEHAVIOUR: { CompoundBehaviour compoundBehaviour = (CompoundBehaviour)theEObject; T result = caseCompoundBehaviour(compoundBehaviour); if (result == null) result = caseSingleCombinedBehaviour(compoundBehaviour); @@ -902,8 +827,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.DEFAULT_BEHAVIOUR: - { + case tdlPackage.DEFAULT_BEHAVIOUR: { DefaultBehaviour defaultBehaviour = (DefaultBehaviour)theEObject; T result = caseDefaultBehaviour(defaultBehaviour); if (result == null) result = caseExceptionalBehaviour(defaultBehaviour); @@ -912,8 +836,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.INTERRUPT_BEHAVIOUR: - { + case tdlPackage.INTERRUPT_BEHAVIOUR: { InterruptBehaviour interruptBehaviour = (InterruptBehaviour)theEObject; T result = caseInterruptBehaviour(interruptBehaviour); if (result == null) result = caseExceptionalBehaviour(interruptBehaviour); @@ -922,16 +845,14 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.TARGET: - { + case tdlPackage.TARGET: { Target target = (Target)theEObject; T result = caseTarget(target); if (result == null) result = caseElement(target); if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.VERDICT_ASSIGNMENT: - { + case tdlPackage.VERDICT_ASSIGNMENT: { VerdictAssignment verdictAssignment = (VerdictAssignment)theEObject; T result = caseVerdictAssignment(verdictAssignment); if (result == null) result = caseAtomicBehaviour(verdictAssignment); @@ -940,8 +861,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.ASSERTION: - { + case tdlPackage.ASSERTION: { Assertion assertion = (Assertion)theEObject; T result = caseAssertion(assertion); if (result == null) result = caseActionBehaviour(assertion); @@ -951,8 +871,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.STOP: - { + case tdlPackage.STOP: { Stop stop = (Stop)theEObject; T result = caseStop(stop); if (result == null) result = caseAtomicBehaviour(stop); @@ -961,8 +880,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.BREAK: - { + case tdlPackage.BREAK: { Break break_ = (Break)theEObject; T result = caseBreak(break_); if (result == null) result = caseAtomicBehaviour(break_); @@ -971,8 +889,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.ASSIGNMENT: - { + case tdlPackage.ASSIGNMENT: { Assignment assignment = (Assignment)theEObject; T result = caseAssignment(assignment); if (result == null) result = caseAtomicBehaviour(assignment); @@ -981,8 +898,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.ACTION_BEHAVIOUR: - { + case tdlPackage.ACTION_BEHAVIOUR: { ActionBehaviour actionBehaviour = (ActionBehaviour)theEObject; T result = caseActionBehaviour(actionBehaviour); if (result == null) result = caseAtomicBehaviour(actionBehaviour); @@ -991,8 +907,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.INLINE_ACTION: - { + case tdlPackage.INLINE_ACTION: { InlineAction inlineAction = (InlineAction)theEObject; T result = caseInlineAction(inlineAction); if (result == null) result = caseActionBehaviour(inlineAction); @@ -1002,8 +917,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.ACTION_REFERENCE: - { + case tdlPackage.ACTION_REFERENCE: { ActionReference actionReference = (ActionReference)theEObject; T result = caseActionReference(actionReference); if (result == null) result = caseActionBehaviour(actionReference); @@ -1013,8 +927,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.TEST_DESCRIPTION_REFERENCE: - { + case tdlPackage.TEST_DESCRIPTION_REFERENCE: { TestDescriptionReference testDescriptionReference = (TestDescriptionReference)theEObject; T result = caseTestDescriptionReference(testDescriptionReference); if (result == null) result = caseAtomicBehaviour(testDescriptionReference); @@ -1023,16 +936,14 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.COMPONENT_INSTANCE_BINDING: - { + case tdlPackage.COMPONENT_INSTANCE_BINDING: { ComponentInstanceBinding componentInstanceBinding = (ComponentInstanceBinding)theEObject; T result = caseComponentInstanceBinding(componentInstanceBinding); if (result == null) result = caseElement(componentInstanceBinding); if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.INTERACTION: - { + case tdlPackage.INTERACTION: { Interaction interaction = (Interaction)theEObject; T result = caseInteraction(interaction); if (result == null) result = caseAtomicBehaviour(interaction); @@ -1041,8 +952,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.MESSAGE: - { + case tdlPackage.MESSAGE: { Message message = (Message)theEObject; T result = caseMessage(message); if (result == null) result = caseInteraction(message); @@ -1052,8 +962,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.PREDEFINED_FUNCTION: - { + case tdlPackage.PREDEFINED_FUNCTION: { PredefinedFunction predefinedFunction = (PredefinedFunction)theEObject; T result = casePredefinedFunction(predefinedFunction); if (result == null) result = casePackageableElement(predefinedFunction); @@ -1062,16 +971,14 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.MEMBER_REFERENCE: - { + case tdlPackage.MEMBER_REFERENCE: { MemberReference memberReference = (MemberReference)theEObject; T result = caseMemberReference(memberReference); if (result == null) result = caseElement(memberReference); if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.PREDEFINED_FUNCTION_CALL: - { + case tdlPackage.PREDEFINED_FUNCTION_CALL: { PredefinedFunctionCall predefinedFunctionCall = (PredefinedFunctionCall)theEObject; T result = casePredefinedFunctionCall(predefinedFunctionCall); if (result == null) result = caseDynamicDataUse(predefinedFunctionCall); @@ -1080,24 +987,21 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.LOCAL_EXPRESSION: - { + case tdlPackage.LOCAL_EXPRESSION: { LocalExpression localExpression = (LocalExpression)theEObject; T result = caseLocalExpression(localExpression); if (result == null) result = caseElement(localExpression); if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.VALUE_ASSIGNMENT: - { + case tdlPackage.VALUE_ASSIGNMENT: { ValueAssignment valueAssignment = (ValueAssignment)theEObject; T result = caseValueAssignment(valueAssignment); if (result == null) result = caseElement(valueAssignment); if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.PROCEDURE_CALL: - { + case tdlPackage.PROCEDURE_CALL: { ProcedureCall procedureCall = (ProcedureCall)theEObject; T result = caseProcedureCall(procedureCall); if (result == null) result = caseInteraction(procedureCall); @@ -1107,8 +1011,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.PROCEDURE_SIGNATURE: - { + case tdlPackage.PROCEDURE_SIGNATURE: { ProcedureSignature procedureSignature = (ProcedureSignature)theEObject; T result = caseProcedureSignature(procedureSignature); if (result == null) result = caseDataType(procedureSignature); @@ -1119,8 +1022,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.PROCEDURE_PARAMETER: - { + case tdlPackage.PROCEDURE_PARAMETER: { ProcedureParameter procedureParameter = (ProcedureParameter)theEObject; T result = caseProcedureParameter(procedureParameter); if (result == null) result = caseParameter(procedureParameter); @@ -1129,8 +1031,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.COLLECTION_DATA_TYPE: - { + case tdlPackage.COLLECTION_DATA_TYPE: { CollectionDataType collectionDataType = (CollectionDataType)theEObject; T result = caseCollectionDataType(collectionDataType); if (result == null) result = caseDataType(collectionDataType); @@ -1141,8 +1042,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.COLLECTION_DATA_INSTANCE: - { + case tdlPackage.COLLECTION_DATA_INSTANCE: { CollectionDataInstance collectionDataInstance = (CollectionDataInstance)theEObject; T result = caseCollectionDataInstance(collectionDataInstance); if (result == null) result = caseDataInstance(collectionDataInstance); @@ -1153,16 +1053,14 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.EXTENSION: - { + case tdlPackage.EXTENSION: { Extension extension = (Extension)theEObject; T result = caseExtension(extension); if (result == null) result = caseElement(extension); if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.LITERAL_VALUE_USE: - { + case tdlPackage.LITERAL_VALUE_USE: { LiteralValueUse literalValueUse = (LiteralValueUse)theEObject; T result = caseLiteralValueUse(literalValueUse); if (result == null) result = caseStaticDataUse(literalValueUse); @@ -1171,8 +1069,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.CONSTRAINT_TYPE: - { + case tdlPackage.CONSTRAINT_TYPE: { ConstraintType constraintType = (ConstraintType)theEObject; T result = caseConstraintType(constraintType); if (result == null) result = casePackageableElement(constraintType); @@ -1181,16 +1078,14 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.CONSTRAINT: - { + case tdlPackage.CONSTRAINT: { Constraint constraint = (Constraint)theEObject; T result = caseConstraint(constraint); if (result == null) result = caseElement(constraint); if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.ENUM_DATA_TYPE: - { + case tdlPackage.ENUM_DATA_TYPE: { EnumDataType enumDataType = (EnumDataType)theEObject; T result = caseEnumDataType(enumDataType); if (result == null) result = caseSimpleDataType(enumDataType); @@ -1202,8 +1097,7 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } - case tdlPackage.DATA_ELEMENT_USE: - { + case tdlPackage.DATA_ELEMENT_USE: { DataElementUse dataElementUse = (DataElementUse)theEObject; T result = caseDataElementUse(dataElementUse); if (result == null) result = caseDataUse(dataElementUse); @@ -1211,6 +1105,15 @@ public class tdlSwitch extends Switch if (result == null) result = defaultCase(theEObject); return result; } + case tdlPackage.CAST_DATA_USE: { + CastDataUse castDataUse = (CastDataUse)theEObject; + T result = caseCastDataUse(castDataUse); + if (result == null) result = caseStaticDataUse(castDataUse); + if (result == null) result = caseDataUse(castDataUse); + if (result == null) result = caseElement(castDataUse); + if (result == null) result = defaultCase(theEObject); + return result; + } default: return defaultCase(theEObject); } } @@ -2895,6 +2798,21 @@ public class tdlSwitch extends Switch return null; } + /** + * Returns the result of interpreting the object as an instance of 'Cast Data Use'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Cast Data Use'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCastDataUse(CastDataUse object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'EObject'. * diff --git a/plugins/org.etsi.mts.tdl.model/src/org/etsi/mts/tdl/Activator.java b/plugins/org.etsi.mts.tdl.model/src/org/etsi/mts/tdl/Activator.java index a5a83545..32f03943 100644 --- a/plugins/org.etsi.mts.tdl.model/src/org/etsi/mts/tdl/Activator.java +++ b/plugins/org.etsi.mts.tdl.model/src/org/etsi/mts/tdl/Activator.java @@ -3,16 +3,23 @@ package org.etsi.mts.tdl; import java.net.URISyntaxException; import java.net.URL; import java.util.List; +import java.util.Map; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.Path; +import org.eclipse.emf.common.util.DiagnosticChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EValidator; import org.eclipse.emf.ecore.resource.Resource.Diagnostic; import org.eclipse.emf.ecore.resource.ResourceSet; import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.ocl.pivot.internal.utilities.EnvironmentFactoryInternal; import org.eclipse.ocl.pivot.resource.CSResource; import org.eclipse.ocl.pivot.utilities.PivotUtil; @@ -59,6 +66,18 @@ public class Activator implements BundleActivator { } return success; } + @Override + protected boolean validatePivot(@NonNull EClassifier eClassifier, @Nullable Object object, + @Nullable DiagnosticChain diagnostics, Map validationContext) { + // Don't validate derived files + if (object instanceof EObject) { + URI uri = ((EObject) object).eResource().getURI(); + IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(uri.toPlatformString(true))); + if (file != null && file.isDerived()) + return true; + } + return super.validatePivot(eClassifier, object, diagnostics, validationContext); + } }; EValidator.Registry.INSTANCE.put(tdlPackage.eINSTANCE, validator); } catch (URISyntaxException e) { diff --git a/plugins/org.etsi.mts.tdl.openapi2tdl.next/src/org/etsi/mts/tdl/openapi2tdl/next/ConverterNext.java b/plugins/org.etsi.mts.tdl.openapi2tdl.next/src/org/etsi/mts/tdl/openapi2tdl/next/ConverterNext.java index ad827c85..af15ab57 100644 --- a/plugins/org.etsi.mts.tdl.openapi2tdl.next/src/org/etsi/mts/tdl/openapi2tdl/next/ConverterNext.java +++ b/plugins/org.etsi.mts.tdl.openapi2tdl.next/src/org/etsi/mts/tdl/openapi2tdl/next/ConverterNext.java @@ -57,7 +57,7 @@ public class ConverterNext { try { Resource tr = TDLHelper.create(outputPath); translator.setTargetResource(tr); - translator.initTargetResource(translator.cleanName(new File(inputPath).getName())); + translator.initTargetResource(translator.getCleanName(new File(inputPath).getName())); translator.translate(inputPath); name = ((Package) tr.getContents().get(0)).getName(); TDLHelper.store(tr, true); diff --git a/plugins/org.etsi.mts.tdl.openapi2tdl.next/src/org/etsi/mts/tdl/openapi2tdl/next/OpenAPI2TDLTranslatorNext.java b/plugins/org.etsi.mts.tdl.openapi2tdl.next/src/org/etsi/mts/tdl/openapi2tdl/next/OpenAPI2TDLTranslatorNext.java index b1a39b41..707d6d6b 100644 --- a/plugins/org.etsi.mts.tdl.openapi2tdl.next/src/org/etsi/mts/tdl/openapi2tdl/next/OpenAPI2TDLTranslatorNext.java +++ b/plugins/org.etsi.mts.tdl.openapi2tdl.next/src/org/etsi/mts/tdl/openapi2tdl/next/OpenAPI2TDLTranslatorNext.java @@ -26,7 +26,6 @@ import org.etsi.mts.tdl.Extension; import org.etsi.mts.tdl.LiteralValueUse; import org.etsi.mts.tdl.Member; import org.etsi.mts.tdl.MemberAssignment; -import org.etsi.mts.tdl.NamedElement; import org.etsi.mts.tdl.Package; import org.etsi.mts.tdl.PackageableElement; import org.etsi.mts.tdl.ParameterBinding; @@ -96,7 +95,7 @@ public class OpenAPI2TDLTranslatorNext extends AbstractTranslator { model = parseSpec(filename, inline); if (model.getInfo().getTitle() != null) - getGeneratedPackage().setName(cleanName(model.getInfo().getTitle())); + getGeneratedPackage().setName(getCleanName(model.getInfo().getTitle())); drm = getTypeFor(sourceMappingTag, tdlPackage.Literals.DATA_RESOURCE_MAPPING); drm.setResourceURI(new File(filename).getName()); @@ -188,7 +187,7 @@ public class OpenAPI2TDLTranslatorNext extends AbstractTranslator { annot.setKey((AnnotationType) e); annot.setValue("Java"); // XXX disabled due to serialization problem - // drmTarget.getAnnotation().add(annot); + drmTarget.getAnnotation().add(annot); break; } } @@ -394,7 +393,7 @@ public class OpenAPI2TDLTranslatorNext extends AbstractTranslator { if (resourceClass.getSimpleName().equals("XtextResource")) { isXtext = true; break; - } + } resourceClass = resourceClass.getSuperclass(); } while (resourceClass != null); @@ -545,7 +544,7 @@ public class OpenAPI2TDLTranslatorNext extends AbstractTranslator { collectionType.setItemType(itemType); return collectionType; } - + public String getCleanName(String name) { String replacement = name; @@ -562,32 +561,6 @@ public class OpenAPI2TDLTranslatorNext extends AbstractTranslator { return replacement; } - public void ensureUniqueNames(Package p) { - Set names = new HashSet<>(); - for (PackageableElement pe: p.getPackagedElement()) { - makeUnique(pe, names); - if (pe instanceof EnumDataType) - for (PackageableElement l: ((EnumDataType) pe).getValue()) - makeUnique(l, names); - else if (pe instanceof Package) { - ensureUniqueNames((Package) pe); - } - } - - } - - private void makeUnique(NamedElement e, Set names) { - String name = e.getName(); - int i = 1; - String newName = name; - while (names.contains(newName)) { - newName = name + "_" + i++; - } - if (!newName.equals(name)) - e.setName(newName); - names.add(newName); - } - /** * Helper method for parsing specs into an intermediary OpenAPI structure for * pre-processing. diff --git a/plugins/org.etsi.mts.tdl.tools.to.docx/.classpath b/plugins/org.etsi.mts.tdl.tools.to.docx/.classpath index 6dc14ee9..49b9e43e 100644 --- a/plugins/org.etsi.mts.tdl.tools.to.docx/.classpath +++ b/plugins/org.etsi.mts.tdl.tools.to.docx/.classpath @@ -1,17 +1,12 @@ - - - - - - - - - - - + + + + + + diff --git a/plugins/org.etsi.mts.tdl.tools.to.docx/META-INF/MANIFEST.MF b/plugins/org.etsi.mts.tdl.tools.to.docx/META-INF/MANIFEST.MF index b72961c5..227774f7 100644 --- a/plugins/org.etsi.mts.tdl.tools.to.docx/META-INF/MANIFEST.MF +++ b/plugins/org.etsi.mts.tdl.tools.to.docx/META-INF/MANIFEST.MF @@ -14,14 +14,5 @@ Require-Bundle: org.eclipse.core.runtime, org.etsi.mts.tdl.TPLan2.ui, org.etsi.mts.tdl.TPLan2 Export-Package: org.etsi.mts.tdl.tools.to.docx -Bundle-ClassPath: lib/docx4j-3.2.1.jar, - lib/jaxb-xmldsig-core-1.0.0.jar, - lib/jaxb-xslfo-1.0.1.jar, - lib/log4j-1.2.17.jar, - lib/serializer.jar, - lib/slf4j-api-1.7.12.jar, - lib/slf4j-log4j12-1.7.12.jar, - lib/xalan.jar, - lib/xercesImpl.jar, - lib/xml-apis.jar, - . +Bundle-ClassPath: ., + lib/docx4j-1.0-jar-with-dependencies.jar diff --git a/plugins/org.etsi.mts.tdl.tools.to.docx/build.properties b/plugins/org.etsi.mts.tdl.tools.to.docx/build.properties index 7f5d3a53..2ef4e6f3 100644 --- a/plugins/org.etsi.mts.tdl.tools.to.docx/build.properties +++ b/plugins/org.etsi.mts.tdl.tools.to.docx/build.properties @@ -2,17 +2,8 @@ source.. = src/ output.. = target/classes/ bin.includes = META-INF/,\ .,\ - lib/docx4j-3.2.1.jar,\ - lib/jaxb-xmldsig-core-1.0.0.jar,\ - lib/jaxb-xslfo-1.0.1.jar,\ - lib/log4j-1.2.17.jar,\ - lib/serializer.jar,\ - lib/slf4j-api-1.7.12.jar,\ - lib/slf4j-log4j12-1.7.12.jar,\ - lib/xalan.jar,\ - lib/xercesImpl.jar,\ - lib/xml-apis.jar,\ TO_TableTemplatesR1.docx,\ - empty.docx + empty.docx,\ + lib/docx4j-1.0-jar-with-dependencies.jar src.includes = TO_TableTemplatesR1.docx,\ empty.docx diff --git a/plugins/org.etsi.mts.tdl.tx/.launch/TDL.tx and TDL.txi.launch b/plugins/org.etsi.mts.tdl.tx/.launch/TDL.tx and TDL.txi.launch index 88e42895..80505826 100644 --- a/plugins/org.etsi.mts.tdl.tx/.launch/TDL.tx and TDL.txi.launch +++ b/plugins/org.etsi.mts.tdl.tx/.launch/TDL.tx and TDL.txi.launch @@ -23,22 +23,19 @@ - + - + - - - @@ -57,8 +54,6 @@ - - @@ -71,7 +66,6 @@ - @@ -99,7 +93,6 @@ - @@ -155,15 +148,12 @@ - - - @@ -202,13 +192,11 @@ - - @@ -263,6 +251,11 @@ + + + + + @@ -275,18 +268,20 @@ + + + - - + @@ -303,6 +298,7 @@ + diff --git a/plugins/org.etsi.mts.tdl.yang2tdl/META-INF/MANIFEST.MF b/plugins/org.etsi.mts.tdl.yang2tdl/META-INF/MANIFEST.MF index d457411d..743af89c 100644 --- a/plugins/org.etsi.mts.tdl.yang2tdl/META-INF/MANIFEST.MF +++ b/plugins/org.etsi.mts.tdl.yang2tdl/META-INF/MANIFEST.MF @@ -8,10 +8,11 @@ Export-Package: org.etsi.mts.tdl.yang2tdl Require-Bundle: org.etsi.mts.tdl.common, org.eclipse.emf.ecore, org.eclipse.xtext, + org.etsi.mts.tdl.common, org.etsi.mts.tdl.helper, org.eclipse.ui;resolution:=optional, org.eclipse.core.resources;resolution:=optional, org.eclipse.core.runtime;bundle-version="3.26.100";resolution:=optional, - org.etsi.mts.tdl.extras.yang.tools.wrapper.mvn + org.etsi.mts.tdl.extras.yang.tools.wrapper Automatic-Module-Name: org.etsi.mts.tdl.yang2tdl Bundle-ClassPath: . diff --git a/plugins/org.etsi.mts.tdl.yang2tdl/src/org/etsi/mts/tdl/yang2tdl/YANGConverter.java b/plugins/org.etsi.mts.tdl.yang2tdl/src/org/etsi/mts/tdl/yang2tdl/YANGConverter.java index f9824894..6226d38a 100644 --- a/plugins/org.etsi.mts.tdl.yang2tdl/src/org/etsi/mts/tdl/yang2tdl/YANGConverter.java +++ b/plugins/org.etsi.mts.tdl.yang2tdl/src/org/etsi/mts/tdl/yang2tdl/YANGConverter.java @@ -32,7 +32,7 @@ public class YANGConverter { // Resource tr = TDLHelper.create(outputPath+".tdl"); Resource tr = TDLHelper.create(outputPath); translator.setTargetResource(tr); - translator.initTargetResource(translator.cleanName(new File(inputPath).getName())); + translator.initTargetResource(translator.getCleanName(new File(inputPath).getName())); translator.translate(inputPath); //update non-unique names //TODO: does not quite work yet diff --git a/plugins/org.etsi.mts.tdl.yang2tdl/src/org/etsi/mts/tdl/yang2tdl/Yang2TDLTranslator.java b/plugins/org.etsi.mts.tdl.yang2tdl/src/org/etsi/mts/tdl/yang2tdl/Yang2TDLTranslator.java index 37334086..dfecea5f 100644 --- a/plugins/org.etsi.mts.tdl.yang2tdl/src/org/etsi/mts/tdl/yang2tdl/Yang2TDLTranslator.java +++ b/plugins/org.etsi.mts.tdl.yang2tdl/src/org/etsi/mts/tdl/yang2tdl/Yang2TDLTranslator.java @@ -10,18 +10,21 @@ import java.util.List; import java.util.stream.Collectors; import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.ProjectScope; +import org.eclipse.emf.ecore.resource.Resource; import org.etsi.mts.tdl.CollectionDataType; import org.etsi.mts.tdl.Constraint; -import org.etsi.mts.tdl.ConstraintType; import org.etsi.mts.tdl.DataElementMapping; import org.etsi.mts.tdl.DataType; +import org.etsi.mts.tdl.ElementImport; import org.etsi.mts.tdl.EnumDataType; import org.etsi.mts.tdl.Extension; import org.etsi.mts.tdl.LiteralValueUse; import org.etsi.mts.tdl.Member; +import org.etsi.mts.tdl.Package; +import org.etsi.mts.tdl.PackageableElement; import org.etsi.mts.tdl.SimpleDataInstance; import org.etsi.mts.tdl.SimpleDataType; -import org.etsi.mts.tdl.StructuredDataInstance; import org.etsi.mts.tdl.StructuredDataType; import org.etsi.mts.tdl.tdlFactory; import org.etsi.mts.tdl.tdlPackage; @@ -34,24 +37,20 @@ import org.opendaylight.yangtools.yang.model.api.ContainerLike; import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode; import org.opendaylight.yangtools.yang.model.api.DataNodeContainer; import org.opendaylight.yangtools.yang.model.api.DataSchemaNode; -import org.opendaylight.yangtools.yang.model.api.ElementCountConstraint; import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode; import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; import org.opendaylight.yangtools.yang.model.api.ListSchemaNode; import org.opendaylight.yangtools.yang.model.api.SchemaContext; import org.opendaylight.yangtools.yang.model.api.TypeDefinition; import org.opendaylight.yangtools.yang.model.api.TypedDataSchemaNode; -import org.opendaylight.yangtools.yang.model.api.stmt.CaseStatement; import org.opendaylight.yangtools.yang.model.api.stmt.LeafStatement; import org.opendaylight.yangtools.yang.model.api.type.EnumTypeDefinition; import org.opendaylight.yangtools.yang.model.api.type.EnumTypeDefinition.EnumPair; import org.opendaylight.yangtools.yang.model.api.type.IdentityrefTypeDefinition; import org.opendaylight.yangtools.yang.model.api.type.LeafrefTypeDefinition; -import org.opendaylight.yangtools.yang.model.api.type.LengthRestrictedTypeDefinition; import org.opendaylight.yangtools.yang.model.api.type.PatternConstraint; import org.opendaylight.yangtools.yang.model.api.type.StringTypeDefinition; import org.opendaylight.yangtools.yang.model.api.type.UnionTypeDefinition; -import org.opendaylight.yangtools.yang.model.ri.type.BaseTypes; import org.opendaylight.yangtools.yang.model.ri.stmt.impl.eff.DeclaredCaseEffectiveStatement; import org.opendaylight.yangtools.yang.model.ri.stmt.impl.eff.EmptyChoiceEffectiveStatement; import org.opendaylight.yangtools.yang.model.ri.stmt.impl.eff.EmptyLeafEffectiveStatement; @@ -62,7 +61,6 @@ import org.opendaylight.yangtools.yang.model.ri.stmt.impl.eff.RegularLeafListEff import org.opendaylight.yangtools.yang.model.ri.stmt.impl.eff.SlimLeafListEffectiveStatement; import org.opendaylight.yangtools.yang.model.ri.stmt.impl.eff.UndeclaredCaseEffectiveStatement; import org.opendaylight.yangtools.yang.model.spi.meta.AbstractDeclaredEffectiveStatement.Default; -import org.opendaylight.yangtools.yang.model.spi.meta.AbstractDeclaredEffectiveStatement.DefaultWithDataTree; import org.opendaylight.yangtools.yang.model.spi.source.FileYangTextSource; import org.opendaylight.yangtools.yang.parser.api.YangParserConfiguration; import org.opendaylight.yangtools.yang.parser.api.YangSyntaxErrorException; @@ -72,23 +70,107 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.ModelProcessingPhase; import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException; import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor; import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor.BuildAction; +import org.osgi.service.prefs.Preferences; public class Yang2TDLTranslator extends AbstractTranslator { private static final String REFERENCE_DESCRIPTION = "ReferenceDescription"; private static final String LIST_KEY = "ListKey"; private static final String LEAF_REF_PATH = "LeafRefPath"; + + private boolean isXtext = false; + + private Package theTdlPackage; + private StructuredDataType messageBody = null; + private String limit = null; + public void setLimit(String limit) { this.limit = limit; } + @Override + public void setTargetResource(Resource targetResource) { + super.setTargetResource(targetResource); + + Class resourceClass = targetResource.getClass(); + do { + // Flaky + if (resourceClass.getSimpleName().equals("XtextResource")) { + isXtext = true; + break; + } + resourceClass = resourceClass.getSuperclass(); + } while (resourceClass != null); + } + + public String getCleanName(String name) { + + String replacement = name; + if (isXtext) { + if (replacement.matches(idStartDigitRegex)) + replacement = "_" + replacement; + replacement = replacement.replaceAll(idInvalidCharRegex, "_"); + // This isn't needed because keywords are escaped by IDValueConverter + /* + * if (xtextKyewords.contains(replacement)) { replacement = "^" + replacement; } + */ + } + + return replacement; + } + //inherited entry point @Override public void translate(String targetFilename) throws Exception { +// this.sourceMappingTag = "YangSpecification"; + this.targetMappingTag = "YangSpecification"; + drm = getTypeFor(sourceMappingTag, tdlPackage.Literals.DATA_RESOURCE_MAPPING); drm.setResourceURI(new File(targetFilename).getName()); + + IProject project = TDLHelper.getProjectForResource(getTargetResource()); + Preferences preferences = null; + if (project != null) { + ProjectScope ps = new ProjectScope(project); + preferences = ps.getNode(PropertyPage.PREFERENCE_SCOPE); + } + + theTdlPackage = TDLHelper.getTdlPackage(getTargetResource()); + if (theTdlPackage != null) { + ElementImport importTdl = tdlFactory.eINSTANCE.createElementImport(); + importTdl.setImportedPackage(theTdlPackage); + getGeneratedPackage().getImport().add(importTdl); + // TODO Remove default string type + getGeneratedPackage().getPackagedElement().remove(stringType); + } + + Package httpPackage = TDLHelper.getHttpPackage(getTargetResource()); + Package httpMessageBasedPackage = null; + boolean useMessageBasedApi = true; + if (preferences != null) + useMessageBasedApi = !preferences.getBoolean(PropertyPage.PROCEDURE_BASED, false); + if (useMessageBasedApi) { + if (httpPackage != null) { + packages: for (Package p : httpPackage.getNestedPackage()) { + for (PackageableElement e : p.getPackagedElement()) { + if (e.eClass().equals(tdlPackage.eINSTANCE.getStructuredDataType()) + && e.getName().equals("Body")) { + this.messageBody = (StructuredDataType) e; + httpMessageBasedPackage = p; + break packages; + } + } + } + if (httpMessageBasedPackage != null) { + ElementImport importHttp = tdlFactory.eINSTANCE.createElementImport(); + importHttp.setImportedPackage(httpMessageBasedPackage); + getGeneratedPackage().getImport().add(importHttp); + } + } + } + CrossSourceStatementReactor reactor = createReactor(); BuildAction build = reactor.newBuild(); @@ -103,15 +185,12 @@ public class Yang2TDLTranslator extends AbstractTranslator { parent = parent.getParent(); } if (parent != target) { - Files.walk(parent).filter(f-> - f.toFile().isFile() && - f.toString().endsWith(".yang") && - !f.toString().equals(targetFilename) - ).forEach(f -> { + Files.walk(parent).filter( + f -> f.toFile().isFile() && f.toString().endsWith(".yang") && !f.toString().equals(targetFilename)) + .forEach(f -> { System.out.println(f); build.addLibSource(moduleFromPath(f.toString())); - } - ); + }); // Files.find(parent, 20, (f, p) -> // p.isRegularFile() && // f.toString().endsWith(".yang") && @@ -131,15 +210,12 @@ public class Yang2TDLTranslator extends AbstractTranslator { // ); System.out.println("Processing: "+target); if (target.toFile().isDirectory()) { - Files.walk(target).filter(f-> - f.toFile().isFile() && - f.toString().endsWith(".yang") && - !f.toString().equals(targetFilename) - ).forEach(f -> { + Files.walk(target).filter( + f -> f.toFile().isFile() && f.toString().endsWith(".yang") && !f.toString().equals(targetFilename)) + .forEach(f -> { System.out.println(f); build.addSource(moduleFromPath(f.toString())); - } - ); + }); //non-recursive version // Files.list(target) // .filter(p->p.toString().endsWith("yang")) @@ -158,8 +234,9 @@ public class Yang2TDLTranslator extends AbstractTranslator { // mappingsPackage.getPackagedElement().add(drmTarget); drmTarget.setResourceURI("TODO"); translate(schemaContext); - } + ensureUniqueNames(getGeneratedPackage()); + } private void translate(SchemaContext schemaContext) { for (DataSchemaNode c : schemaContext.getChildNodes()) { @@ -185,14 +262,15 @@ public class Yang2TDLTranslator extends AbstractTranslator { } private DataType translateOnly(DataSchemaNode c, String parent) { - String baseName = cleanName(c.getQName().getLocalName()); + String baseName = getCleanName(c.getQName().getLocalName()); String name = baseName; if (parent != null) { name = parent+"___"+name; } System.out.println(name); if (c instanceof ContainerSchemaNode) { - //DONE: remove wrapper container structured data type of only a collection is contained + // DONE: remove wrapper container structured data type of only a collection is + // contained Collection childNodes = ((ContainerSchemaNode) c).getChildNodes(); if (childNodes.isEmpty()) { //create structured data type @@ -211,13 +289,12 @@ public class Yang2TDLTranslator extends AbstractTranslator { } else if (c instanceof ListSchemaNode) { StructuredDataType itemType = translateStructuredDataType((ListSchemaNode) c, baseName, name); CollectionDataType collectionType = getCollectionDataTypeFor(itemType); - addMapping(c.toString().replaceAll(".+?argument=", "").replaceAll("}", ""), collectionType, sourceMappingTag, targetMappingTag); + addMapping(c.toString().replaceAll(".+?argument=", "").replaceAll("}", ""), collectionType, + sourceMappingTag, targetMappingTag); //TODO: add key annotation? List keyDefinition = ((ListSchemaNode) c).getKeyDefinition(); - String key = keyDefinition.stream() - .map(QName::getLocalName) - .collect(Collectors.joining(", ")); + String key = keyDefinition.stream().map(QName::getLocalName).collect(Collectors.joining(", ")); // TODO: make optional // annotateWith(collectionType, LIST_KEY, key); @@ -260,7 +337,8 @@ public class Yang2TDLTranslator extends AbstractTranslator { //TODO: what is the difference? is it used String typeName = ((RegularLeafEffectiveStatement) c).getType().getQName().getLocalName(); SimpleDataType dataType = getSimpleDataTypeFor(typeName); - addMapping(c.toString().replaceAll(".+?argument=", "").replaceAll("}", ""), dataType, sourceMappingTag, targetMappingTag); + addMapping(c.toString().replaceAll(".+?argument=", "").replaceAll("}", ""), dataType, sourceMappingTag, + targetMappingTag); return dataType; } else if (c instanceof RegularChoiceEffectiveStatement) { //TODO: difference? @@ -268,7 +346,8 @@ public class Yang2TDLTranslator extends AbstractTranslator { for (CaseSchemaNode child : ((RegularChoiceEffectiveStatement) c).getCases()) { translateMember(baseName, dataType, child); } - addMapping(c.toString().replaceAll(".+?argument=", "").replaceAll("}", ""), dataType, sourceMappingTag, targetMappingTag); + addMapping(c.toString().replaceAll(".+?argument=", "").replaceAll("}", ""), dataType, sourceMappingTag, + targetMappingTag); return dataType; } else if (c instanceof EmptyChoiceEffectiveStatement) { //TODO: add annotation choice @@ -278,7 +357,8 @@ public class Yang2TDLTranslator extends AbstractTranslator { for (CaseSchemaNode child : ((EmptyChoiceEffectiveStatement) c).getCases()) { translateMember(baseName, dataType, child); } - addMapping(c.toString().replaceAll(".+?argument=", "").replaceAll("}", ""), dataType, sourceMappingTag, targetMappingTag); + addMapping(c.toString().replaceAll(".+?argument=", "").replaceAll("}", ""), dataType, sourceMappingTag, + targetMappingTag); return dataType; } else if (c instanceof UndeclaredCaseEffectiveStatement) { //choice -> container? (no case) @@ -297,7 +377,8 @@ public class Yang2TDLTranslator extends AbstractTranslator { private CollectionDataType translateSimpleDataCollection(String name, TypeDefinition type) { SimpleDataType itemType = translateSimpleDataType(name, type); CollectionDataType collectionType = getCollectionDataTypeFor(itemType); - addMapping(type.toString().replaceAll(".+?argument=", "").replaceAll("}", ""), collectionType, sourceMappingTag, targetMappingTag); + addMapping(type.toString().replaceAll(".+?argument=", "").replaceAll("}", ""), collectionType, sourceMappingTag, + targetMappingTag); return collectionType; } @@ -322,7 +403,8 @@ public class Yang2TDLTranslator extends AbstractTranslator { eInstance.setDataType(dataType); dataType.getValue().add(eInstance); } - addMapping(type.toString().replaceAll(".+?argument=", "").replaceAll("}", ""), dataType, sourceMappingTag, targetMappingTag); + addMapping(type.toString().replaceAll(".+?argument=", "").replaceAll("}", ""), dataType, sourceMappingTag, + targetMappingTag); //TODO: add default? return dataType; @@ -335,7 +417,8 @@ public class Yang2TDLTranslator extends AbstractTranslator { eInstance.setDataType(dataType); dataType.getValue().add(eInstance); } - addMapping(type.toString().replaceAll(".+?argument=", "").replaceAll("}", ""), dataType, sourceMappingTag, targetMappingTag); + addMapping(type.toString().replaceAll(".+?argument=", "").replaceAll("}", ""), dataType, sourceMappingTag, + targetMappingTag); return dataType; } else if (type instanceof UnionTypeDefinition) { @@ -352,7 +435,8 @@ public class Yang2TDLTranslator extends AbstractTranslator { constraint.getQuantifier().add(ut); } } - addMapping(type.toString().replaceAll(".+?argument=", "").replaceAll("}", ""), dataType, sourceMappingTag, targetMappingTag); + addMapping(type.toString().replaceAll(".+?argument=", "").replaceAll("}", ""), dataType, sourceMappingTag, + targetMappingTag); return dataType; } else { @@ -366,7 +450,8 @@ public class Yang2TDLTranslator extends AbstractTranslator { e.setExtending(superType); dataType.setExtension(e); } - addMapping(type.toString().replaceAll(".+?argument=", "").replaceAll("}", ""), dataType, sourceMappingTag, targetMappingTag); + addMapping(type.toString().replaceAll(".+?argument=", "").replaceAll("}", ""), dataType, sourceMappingTag, + targetMappingTag); if (type instanceof StringTypeDefinition) { List patternConstraints = ((StringTypeDefinition) type).getPatternConstraints(); @@ -387,7 +472,6 @@ public class Yang2TDLTranslator extends AbstractTranslator { } } - private void translateMember(String baseName, StructuredDataType dataType, DataSchemaNode child) { DataType memberType = translate(child, baseName); String propertyName = child.getQName().getLocalName(); @@ -406,13 +490,13 @@ public class Yang2TDLTranslator extends AbstractTranslator { } } - private StructuredDataType translateStructuredDataType(DataNodeContainer c, String baseName, String name) { StructuredDataType dataType = getStructuredDataTypeFor(name); for (DataSchemaNode child : c.getChildNodes()) { translateMember(baseName, dataType, child); } - addMapping(c.toString().replaceAll(".+?argument=", "").replaceAll("}", ""), dataType, sourceMappingTag, targetMappingTag); + addMapping(c.toString().replaceAll(".+?argument=", "").replaceAll("}", ""), dataType, sourceMappingTag, + targetMappingTag); return dataType; } @@ -424,8 +508,7 @@ public class Yang2TDLTranslator extends AbstractTranslator { DataElementMapping sourceMapping = addDataElementMapping(uri, dataType, sourceMappingTag); // TODO: make configurable? - DataElementMapping targetMapping = addDataElementMapping("target://" + uri, dataType, - targetMappingTag); + DataElementMapping targetMapping = addDataElementMapping("target://" + uri, dataType, targetMappingTag); targetMapping.setDataResourceMapping(drmTarget); if (dataType instanceof StructuredDataType) { @@ -437,28 +520,20 @@ public class Yang2TDLTranslator extends AbstractTranslator { } } - - - //---------------------------------------------------------- //TODO: clean up below - public static void main(String[] args) throws Exception { CrossSourceStatementReactor reactor = createReactor(); // processStatic(reactor); BuildAction build = reactor.newBuild(); - Files.list(Path.of("samples", "ietf")).forEach(p -> - build.addSource(moduleFromPath(p.toString())) - ); + Files.list(Path.of("samples", "ietf")).forEach(p -> build.addSource(moduleFromPath(p.toString()))); // Files.list(Path.of("samples", "nfv")).forEach(p -> // build.addSource(moduleFromPath(p.toString())) // ); - Files.list(Path.of("samples", "simple")).forEach(p -> - build.addSource(moduleFromPath(p.toString())) - ); + Files.list(Path.of("samples", "simple")).forEach(p -> build.addSource(moduleFromPath(p.toString()))); // build.addSource(moduleFromPath("samples/nfv/etsi-nfv-descriptors.yang")); @@ -473,7 +548,6 @@ public class Yang2TDLTranslator extends AbstractTranslator { expand(" ", schemaContext); } - private static CrossSourceStatementReactor createReactor() { CrossSourceStatementReactor reactor = RFC7950Reactors.vanillaReactorBuilder() .addStatementSupport(ModelProcessingPhase.FULL_DECLARATION, @@ -498,24 +572,19 @@ public class Yang2TDLTranslator extends AbstractTranslator { moduleFromPath("samples/ietf/ietf-yang-types@2013-07-15.yang"), moduleFromPath("samples/ietf/ietf-restconf@2017-01-26.yang"), moduleFromPath("samples/ietf/ietf-inet-types@2013-07-15.yang"), - moduleFromPath("samples/nfv/etsi-nfv-common.yang"), - moduleFromPath("samples/nfv/etsi-nfv-nsd.yang"), - moduleFromPath("samples/nfv/etsi-nfv-pnfd.yang"), - moduleFromPath("samples/nfv/etsi-nfv-vnfd.yang"), - moduleFromPath("samples/nfv/etsi-nfv-descriptors.yang"), - moduleFromPath("samples/nfv/etsi-nfv-ns.yang"), - moduleFromPath("samples/nfv/etsi-nfv-pnf.yang"), - moduleFromPath("samples/nfv/etsi-nfv-vnf.yang") - ) + moduleFromPath("samples/nfv/etsi-nfv-common.yang"), moduleFromPath("samples/nfv/etsi-nfv-nsd.yang"), + moduleFromPath("samples/nfv/etsi-nfv-pnfd.yang"), moduleFromPath("samples/nfv/etsi-nfv-vnfd.yang"), + moduleFromPath("samples/nfv/etsi-nfv-descriptors.yang"), moduleFromPath("samples/nfv/etsi-nfv-ns.yang"), + moduleFromPath("samples/nfv/etsi-nfv-pnf.yang"), moduleFromPath("samples/nfv/etsi-nfv-vnf.yang")) // moduleFromResources("/simple/sports.yang")) - .buildEffective() - .getChildNodes().forEach(e->System.out.println(e.getQName())); + .buildEffective().getChildNodes().forEach(e -> System.out.println(e.getQName())); ; } private static YangStatementStreamSource moduleFromPath(String path) { return moduleFromPath(Path.of(path)); } + private static YangStatementStreamSource moduleFromPath(Path path) { try { // return new YangStatementSourceImpl("/example.yang", false); @@ -541,7 +610,8 @@ public class Yang2TDLTranslator extends AbstractTranslator { private static void expand(String prefix, DataSchemaNode c) { //TODO: this is not accurately reflecting the structures.. if (c instanceof LeafListSchemaNode) { - System.out.println(prefix+c.getQName().getLocalName() + " : " + ((LeafListSchemaNode) c).getType().getQName()); + System.out.println( + prefix + c.getQName().getLocalName() + " : " + ((LeafListSchemaNode) c).getType().getQName()); } else if (c instanceof ContainerSchemaNode) { System.out.println("!c"+prefix+c.getQName().getLocalName() + " : " ); //create structured data type @@ -551,10 +621,12 @@ public class Yang2TDLTranslator extends AbstractTranslator { //create collection of structured data type expand(prefix+" ", (ListSchemaNode) c); } else if (c instanceof RegularLeafEffectiveStatement) { - System.out.println("!r"+prefix+c.getQName().getLocalName() + " : " + ((RegularLeafEffectiveStatement) c).getDeclared().getType().argument()); + System.out.println("!r" + prefix + c.getQName().getLocalName() + " : " + + ((RegularLeafEffectiveStatement) c).getDeclared().getType().argument()); //create member of reference data type? } else if (c instanceof EmptyLeafEffectiveStatement) { - System.out.println("!e"+prefix+c.getQName().getLocalName() + " : " + ((EmptyLeafEffectiveStatement) c).getType().getQName()); + System.out.println("!e" + prefix + c.getQName().getLocalName() + " : " + + ((EmptyLeafEffectiveStatement) c).getType().getQName()); //create member of data type? } else if (c instanceof LeafrefTypeDefinition) { //not working? -- GitLab