diff options
author | Adolfo SBH | 2015-03-06 16:24:05 +0000 |
---|---|---|
committer | Ed Willink | 2015-03-07 12:16:58 +0000 |
commit | 34d094d581ed2e926b9dd4102e842238de3fcef0 (patch) | |
tree | 3b32c939d3b923cb26c6a45bdbae41d4e0b26b6f | |
parent | 9f1826523bd26120f8b39d03dd0a68be8855c479 (diff) | |
download | org.eclipse.qvtd-34d094d581ed2e926b9dd4102e842238de3fcef0.tar.gz org.eclipse.qvtd-34d094d581ed2e926b9dd4102e842238de3fcef0.tar.xz org.eclipse.qvtd-34d094d581ed2e926b9dd4102e842238de3fcef0.zip |
[ocl2qvti] - Generating the addElements operations java implementation
14 files changed, 1237 insertions, 336 deletions
diff --git a/tests/org.eclipse.qvtd.build.cs2as.tests/src/org/eclipse/qvtd/build/cs2as/tests/models/example2/ClassesNameResolution.ocl b/tests/org.eclipse.qvtd.build.cs2as.tests/src/org/eclipse/qvtd/build/cs2as/tests/models/example2/ClassesNameResolution.ocl index e7bb754a3..f5ff73456 100644 --- a/tests/org.eclipse.qvtd.build.cs2as.tests/src/org/eclipse/qvtd/build/cs2as/tests/models/example2/ClassesNameResolution.ocl +++ b/tests/org.eclipse.qvtd.build.cs2as.tests/src/org/eclipse/qvtd/build/cs2as/tests/models/example2/ClassesNameResolution.ocl @@ -28,19 +28,6 @@ context Environment -- def : parentEnv : Environment = null -- General Environment configuration operations -def : addElement(element : classes::NamedElement) : Environment = - Environment{ - namedElements = namedElements->asSequence() -- FIXME bug 460682 - ->including(element), - parentEnv = parentEnv - } - -def : addElements(elements : Collection(classes::NamedElement)) : Environment = - Environment{ - namedElements = namedElements->asSequence() -- FIXME bug 460682 - ->includingAll(elements), - parentEnv = parentEnv - } def : mergEnv(env : Environment) : Environment = Environment { diff --git a/tests/org.eclipse.qvtd.build.cs2as.tests/src/org/eclipse/qvtd/build/cs2as/tests/models/example2/EnvExample2.genmodel b/tests/org.eclipse.qvtd.build.cs2as.tests/src/org/eclipse/qvtd/build/cs2as/tests/models/example2/EnvExample2.genmodel index e7d052885..f1eb6fcd0 100644 --- a/tests/org.eclipse.qvtd.build.cs2as.tests/src/org/eclipse/qvtd/build/cs2as/tests/models/example2/EnvExample2.genmodel +++ b/tests/org.eclipse.qvtd.build.cs2as.tests/src/org/eclipse/qvtd/build/cs2as/tests/models/example2/EnvExample2.genmodel @@ -4,13 +4,26 @@ modelPluginID="org.eclipse.qvtd.build.cs2as.tests" modelName="Example2Environment" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" importerID="org.eclipse.emf.importer.ecore" complianceLevel="7.0" copyrightFields="false" usedGenPackages="Classes.genmodel#//classes" - operationReflection="true" importOrganizing="true"> + importOrganizing="true"> <foreignModel>EnvExample2.ecore</foreignModel> + <modelPluginVariables>org.eclipse.ocl.pivot</modelPluginVariables> + <modelPluginVariables>org.eclipse.ocl.examples.codegen</modelPluginVariables> <genPackages prefix="Environment" basePackage="example2" disposableProviderFactory="true" ecorePackage="EnvExample2.ecore#/"> <genClasses image="false" ecoreClass="EnvExample2.ecore#//Environment"> <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference EnvExample2.ecore#//Environment/namedElements"/> <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference EnvExample2.ecore#//Environment/parentEnv"/> + <genOperations ecoreOperation="EnvExample2.ecore#//Environment/addElements"> + <genParameters ecoreParameter="EnvExample2.ecore#//Environment/addElements/elements"/> + </genOperations> + <genOperations ecoreOperation="EnvExample2.ecore#//Environment/addElement"> + <genParameters ecoreParameter="EnvExample2.ecore#//Environment/addElement/element"/> + </genOperations> </genClasses> + <genClasses image="false" ecoreClass="EnvExample2.ecore#//Env4CG"> + <genOperations ecoreOperation="EnvExample2.ecore#//Env4CG/hasFinalResult"/> + <genOperations ecoreOperation="EnvExample2.ecore#//Env4CG/getEvaluator"/> + </genClasses> + <genClasses image="false" ecoreClass="EnvExample2.ecore#//Evaluator"/> </genPackages> </genmodel:GenModel> diff --git a/tests/org.eclipse.qvtd.build.cs2as.tests/src/org/eclipse/qvtd/build/cs2as/tests/models/example2/mwe/GenerateClassesTables.mwe2 b/tests/org.eclipse.qvtd.build.cs2as.tests/src/org/eclipse/qvtd/build/cs2as/tests/models/example2/mwe/GenerateClassesTables.mwe2 new file mode 100644 index 000000000..738d58b3a --- /dev/null +++ b/tests/org.eclipse.qvtd.build.cs2as.tests/src/org/eclipse/qvtd/build/cs2as/tests/models/example2/mwe/GenerateClassesTables.mwe2 @@ -0,0 +1,19 @@ +module org.eclipse.qvtd.build.cs2as.tests.GenerateClasessTables
+
+import org.eclipse.ocl.examples.build.utilities.*
+import org.eclipse.emf.mwe.utils.*
+import org.eclipse.emf.ecore.resource.impl.*
+
+var projectName = "org.eclipse.qvtd.build.cs2as.tests"
+var examplesFolder = "src/org/eclipse/qvtd/build/cs2as/tests/models/example2"
+
+
+Workflow {
+ bean = ResourceSetImpl : resourceSet {}
+ bean = ProjectMapSetup { resourceSet = resourceSet }
+ bean = GenModelSetup { resourceSet = resourceSet }
+ component = Model2tablesGenerator { resourceSet = resourceSet
+ genModelFile = "/${projectName}/${examplesFolder}/EnvExample2.genmodel"
+ }
+}
+
diff --git a/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/cg/classescs2as_qvtp_qvtias.java b/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/cg/classescs2as_qvtp_qvtias.java index 558772549..7a1b575c3 100644 --- a/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/cg/classescs2as_qvtp_qvtias.java +++ b/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/cg/classescs2as_qvtp_qvtias.java @@ -9,9 +9,22 @@ package cg; +import example2.classes.ClassesFactory; +import example2.classes.ClassesPackage; +import example2.classes.NamedElement; +import example2.classes.Package; +import example2.classes.Root; +import example2.classescs.ClassCS; +import example2.classescs.ClassescsPackage; +import example2.classescs.PackageCS; +import example2.classescs.PathElementCS; +import example2.classescs.PathNameCS; +import example2.classescs.RootCS; +import example2.env.Environment; +import example2.env.EnvironmentPackage; import java.util.Iterator; import java.util.List; - +import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EcorePackage; import org.eclipse.jdt.annotation.NonNull; @@ -29,8 +42,6 @@ import org.eclipse.ocl.pivot.ids.TypeId; import org.eclipse.ocl.pivot.library.classifier.ClassifierAllInstancesOperation; import org.eclipse.ocl.pivot.library.classifier.ClassifierOclContainerOperation; import org.eclipse.ocl.pivot.library.collection.CollectionAsOrderedSetOperation; -import org.eclipse.ocl.pivot.library.collection.CollectionAsSequenceOperation; -import org.eclipse.ocl.pivot.library.collection.CollectionIncludingAllOperation; import org.eclipse.ocl.pivot.library.collection.CollectionIsEmptyOperation; import org.eclipse.ocl.pivot.library.collection.CollectionSelectByKindOperation; import org.eclipse.ocl.pivot.library.collection.CollectionSizeOperation; @@ -41,7 +52,6 @@ import org.eclipse.ocl.pivot.library.numeric.NumericMinusOperation; import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsTypeOperation; import org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsKindOfOperation; import org.eclipse.ocl.pivot.utilities.ValueUtil; -import org.eclipse.ocl.pivot.values.CollectionValue; import org.eclipse.ocl.pivot.values.IntegerValue; import org.eclipse.ocl.pivot.values.InvalidValueException; import org.eclipse.ocl.pivot.values.OrderedSetValue; @@ -49,20 +59,6 @@ import org.eclipse.ocl.pivot.values.SequenceValue; import org.eclipse.ocl.pivot.values.SetValue; import org.eclipse.qvtd.pivot.qvtbase.evaluation.AbstractTransformationExecutor; -import example2.classes.ClassesFactory; -import example2.classes.ClassesPackage; -import example2.classes.NamedElement; -import example2.classes.Package; -import example2.classes.Root; -import example2.classescs.ClassCS; -import example2.classescs.ClassescsPackage; -import example2.classescs.PackageCS; -import example2.classescs.PathElementCS; -import example2.classescs.PathNameCS; -import example2.classescs.RootCS; -import example2.env.Environment; -import example2.env.EnvironmentPackage; - /** * The classescs2as_qvtp_qvtias transformation: * <p> @@ -96,17 +92,14 @@ public class classescs2as_qvtp_qvtias extends AbstractTransformationExecutor public static final @NonNull /*@NonInvalid*/ ClassId CLSSid_Root = PACKid_http_c_s_s_cs2as_s_tests_s_example2_s_classes_s_1_0.getClassId("Root", 0); public static final @NonNull /*@NonInvalid*/ ClassId CLSSid_RootCS = PACKid_http_c_s_s_cs2as_s_tests_s_example2_s_classescs_s_1_0.getClassId("RootCS", 0); public static final @NonNull /*@NonInvalid*/ IntegerValue INT_1 = ValueUtil.integerValueOf("1"); - public static final @NonNull /*@NonInvalid*/ CollectionTypeId COL_CLSSid_NamedElement = TypeId.COLLECTION.getSpecializedId(CLSSid_NamedElement); public static final @NonNull /*@NonInvalid*/ CollectionTypeId ORD_CLSSid_Class = TypeId.ORDERED_SET.getSpecializedId(CLSSid_Class); public static final @NonNull /*@NonInvalid*/ CollectionTypeId ORD_CLSSid_ClassCS = TypeId.ORDERED_SET.getSpecializedId(CLSSid_ClassCS); public static final @NonNull /*@NonInvalid*/ CollectionTypeId ORD_CLSSid_NamedElement = TypeId.ORDERED_SET.getSpecializedId(CLSSid_NamedElement); public static final @NonNull /*@NonInvalid*/ CollectionTypeId ORD_CLSSid_Package = TypeId.ORDERED_SET.getSpecializedId(CLSSid_Package); public static final @NonNull /*@NonInvalid*/ CollectionTypeId ORD_CLSSid_PackageCS = TypeId.ORDERED_SET.getSpecializedId(CLSSid_PackageCS); public static final @NonNull /*@NonInvalid*/ CollectionTypeId ORD_CLSSid_PathElementCS = TypeId.ORDERED_SET.getSpecializedId(CLSSid_PathElementCS); - public static final @NonNull /*@NonInvalid*/ PropertyId PROPid_namedElements = CLSSid_Environment.getPropertyId("namedElements"); public static final @NonNull /*@NonInvalid*/ PropertyId PROPid_parentEnv = CLSSid_Environment.getPropertyId("parentEnv"); public static final @NonNull /*@NonInvalid*/ CollectionTypeId SEQ_CLSSid_Class = TypeId.SEQUENCE.getSpecializedId(CLSSid_Class); - public static final @NonNull /*@NonInvalid*/ CollectionTypeId SEQ_CLSSid_NamedElement = TypeId.SEQUENCE.getSpecializedId(CLSSid_NamedElement); public static final @NonNull /*@NonInvalid*/ CollectionTypeId SEQ_CLSSid_Package = TypeId.SEQUENCE.getSpecializedId(CLSSid_Package); public static final @NonNull /*@NonInvalid*/ CollectionTypeId SET_CLSSid_ClassCS = TypeId.SET.getSpecializedId(CLSSid_ClassCS); public static final @NonNull /*@NonInvalid*/ CollectionTypeId SET_CLSSid_PackageCS = TypeId.SET.getSpecializedId(CLSSid_PackageCS); @@ -157,14 +150,14 @@ public class classescs2as_qvtp_qvtias extends AbstractTransformationExecutor final @NonNull /*@NonInvalid*/ IdResolver idResolver = evaluator.getIdResolver(); final @NonNull /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_classes_c_c_Package_0 = idResolver.getClass(CLSSid_Package, null); final /*@Thrown*/ boolean oclIsKindOf = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(evaluator, parent, TYP_classes_c_c_Package_0).booleanValue(); - @NonNull /*@Thrown*/ Environment symbol_3; + @NonNull /*@Thrown*/ Environment symbol_2; if (oclIsKindOf) { final @Nullable /*@Thrown*/ Package oclAsType = (Package)OclAnyOclAsTypeOperation.INSTANCE.evaluate(evaluator, parent, TYP_classes_c_c_Package_0); if (oclAsType == null) { throw new InvalidValueException("Null source for \'classes::Package::_env(OclElement) : env::Environment\'"); } final @NonNull /*@Thrown*/ Environment _env = this._env(oclAsType, self_1); - symbol_3 = _env; + symbol_2 = _env; } else { final @NonNull /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_classes_c_c_Root_0 = idResolver.getClass(CLSSid_Root, null); @@ -178,26 +171,12 @@ public class classescs2as_qvtp_qvtias extends AbstractTransformationExecutor if (self_5 == null) { throw new InvalidValueException("Null source for \'classes::Root::ownedPackages\'"); } - final @Nullable /*@Thrown*/ List<Package> elements = self_5.getOwnedPackages(); - assert elements != null; - final @NonNull /*@NonInvalid*/ Property CTORid_parentEnv_0 = idResolver.getProperty(PROPid_parentEnv); - final @NonNull /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_env_c_c_Environment_2 = idResolver.getClass(CLSSid_Environment, null); - final @NonNull /*@NonInvalid*/ Property CTORid_namedElements = idResolver.getProperty(PROPid_namedElements); - final @NonNull /*@Thrown*/ Environment symbol_2 = (Environment)TYP_env_c_c_Environment_2.createInstance(); - final @Nullable /*@Thrown*/ List<NamedElement> namedElements = symbol_1.getNamedElements(); - assert namedElements != null; - final @NonNull /*@Thrown*/ OrderedSetValue BOXED_namedElements = idResolver.createOrderedSetOfAll(ORD_CLSSid_NamedElement, namedElements); - final @NonNull /*@Thrown*/ SequenceValue asSequence = CollectionAsSequenceOperation.INSTANCE.evaluate(BOXED_namedElements); - final @NonNull /*@Thrown*/ CollectionValue BOXED_elements = idResolver.createCollectionOfAll(COL_CLSSid_NamedElement, elements); - final @NonNull /*@Thrown*/ CollectionValue includingAll = CollectionIncludingAllOperation.INSTANCE.evaluate(asSequence, BOXED_elements); - final List<NamedElement> UNBOXED_includingAll = includingAll.asEcoreObjects(idResolver, NamedElement.class); - assert UNBOXED_includingAll != null; - CTORid_namedElements.initValue(symbol_2, UNBOXED_includingAll); - final @Nullable /*@Thrown*/ Environment parentEnv_0 = symbol_1.getParentEnv(); - CTORid_parentEnv_0.initValue(symbol_2, parentEnv_0); - symbol_3 = symbol_2; + final @Nullable /*@Thrown*/ List<Package> ownedPackages = self_5.getOwnedPackages(); + assert ownedPackages != null; + final @NonNull /*@Thrown*/ Environment addElements = symbol_1.addElements((EList)ownedPackages); + symbol_2 = addElements; } - return symbol_3; + return symbol_2; } /** @@ -216,43 +195,13 @@ public class classescs2as_qvtp_qvtias extends AbstractTransformationExecutor final @NonNull /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_env_c_c_Environment_0 = idResolver.getClass(CLSSid_Environment, null); final @NonNull /*@Thrown*/ Environment symbol_0 = (Environment)TYP_env_c_c_Environment_0.createInstance(); CTORid_parentEnv.initValue(symbol_0, self_5); - final @Nullable /*@Thrown*/ List<example2.classes.Class> elements = self_0.getOwnedClasses(); - assert elements != null; - final @NonNull /*@NonInvalid*/ IdResolver idResolver_0 = evaluator.getIdResolver(); - final @NonNull /*@NonInvalid*/ Property CTORid_parentEnv_0 = idResolver_0.getProperty(PROPid_parentEnv); - final @NonNull /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_env_c_c_Environment_1 = idResolver_0.getClass(CLSSid_Environment, null); - final @NonNull /*@NonInvalid*/ Property CTORid_namedElements = idResolver_0.getProperty(PROPid_namedElements); - final @NonNull /*@Thrown*/ Environment symbol_1 = (Environment)TYP_env_c_c_Environment_1.createInstance(); - final @Nullable /*@Thrown*/ List<NamedElement> namedElements = symbol_0.getNamedElements(); - assert namedElements != null; - final @NonNull /*@Thrown*/ OrderedSetValue BOXED_namedElements = idResolver_0.createOrderedSetOfAll(ORD_CLSSid_NamedElement, namedElements); - final @NonNull /*@Thrown*/ SequenceValue asSequence = CollectionAsSequenceOperation.INSTANCE.evaluate(BOXED_namedElements); - final @NonNull /*@Thrown*/ CollectionValue BOXED_elements = idResolver_0.createCollectionOfAll(COL_CLSSid_NamedElement, elements); - final @NonNull /*@Thrown*/ CollectionValue includingAll = CollectionIncludingAllOperation.INSTANCE.evaluate(asSequence, BOXED_elements); - final List<NamedElement> UNBOXED_includingAll = includingAll.asEcoreObjects(idResolver_0, NamedElement.class); - assert UNBOXED_includingAll != null; - CTORid_namedElements.initValue(symbol_1, UNBOXED_includingAll); - final @Nullable /*@Thrown*/ Environment parentEnv_0 = symbol_0.getParentEnv(); - CTORid_parentEnv_0.initValue(symbol_1, parentEnv_0); - final @Nullable /*@Thrown*/ List<Package> elements_0 = self_0.getOwnedPackages(); - assert elements_0 != null; - final @NonNull /*@NonInvalid*/ IdResolver idResolver_1 = evaluator.getIdResolver(); - final @NonNull /*@NonInvalid*/ Property CTORid_parentEnv_1 = idResolver_1.getProperty(PROPid_parentEnv); - final @NonNull /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_env_c_c_Environment_2 = idResolver_1.getClass(CLSSid_Environment, null); - final @NonNull /*@NonInvalid*/ Property CTORid_namedElements_0 = idResolver_1.getProperty(PROPid_namedElements); - final @NonNull /*@Thrown*/ Environment symbol_2 = (Environment)TYP_env_c_c_Environment_2.createInstance(); - final @Nullable /*@Thrown*/ List<NamedElement> namedElements_1 = symbol_1.getNamedElements(); - assert namedElements_1 != null; - final @NonNull /*@Thrown*/ OrderedSetValue BOXED_namedElements_1 = idResolver_1.createOrderedSetOfAll(ORD_CLSSid_NamedElement, namedElements_1); - final @NonNull /*@Thrown*/ SequenceValue asSequence_0 = CollectionAsSequenceOperation.INSTANCE.evaluate(BOXED_namedElements_1); - final @NonNull /*@Thrown*/ CollectionValue BOXED_elements_0 = idResolver_1.createCollectionOfAll(COL_CLSSid_NamedElement, elements_0); - final @NonNull /*@Thrown*/ CollectionValue includingAll_0 = CollectionIncludingAllOperation.INSTANCE.evaluate(asSequence_0, BOXED_elements_0); - final List<NamedElement> UNBOXED_includingAll_0 = includingAll_0.asEcoreObjects(idResolver_1, NamedElement.class); - assert UNBOXED_includingAll_0 != null; - CTORid_namedElements_0.initValue(symbol_2, UNBOXED_includingAll_0); - final @Nullable /*@Thrown*/ Environment parentEnv_2 = symbol_1.getParentEnv(); - CTORid_parentEnv_1.initValue(symbol_2, parentEnv_2); - return symbol_2; + final @Nullable /*@Thrown*/ List<example2.classes.Class> ownedClasses = self_0.getOwnedClasses(); + assert ownedClasses != null; + final @NonNull /*@Thrown*/ Environment addElements = symbol_0.addElements((EList)ownedClasses); + final @Nullable /*@Thrown*/ List<Package> ownedPackages = self_0.getOwnedPackages(); + assert ownedPackages != null; + final @NonNull /*@Thrown*/ Environment addElements_0 = addElements.addElements((EList)ownedPackages); + return addElements_0; } /** diff --git a/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/classes/ClassesTables.java b/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/classes/ClassesTables.java new file mode 100644 index 000000000..4de77b637 --- /dev/null +++ b/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/classes/ClassesTables.java @@ -0,0 +1,705 @@ +/******************************************************************************* + ************************************************************************* + * This code is 100% auto-generated + * from: + * platform:/resource/org.eclipse.qvtd.build.cs2as.tests/src/org/eclipse/qvtd/build/cs2as/tests/models/example2/Classes.ecore + * using: + * platform:/resource/org.eclipse.qvtd.build.cs2as.tests/src/org/eclipse/qvtd/build/cs2as/tests/models/example2/Classes.genmodel + * org.eclipse.ocl.examples.codegen.oclinecore.OCLinEcoreTables + * + * Do not edit it. + *******************************************************************************/ +package example2.classes; + +import example2.classes.ClassesTables; +import org.eclipse.ocl.pivot.internal.library.ecore.EcoreExecutorPackage; +import org.eclipse.ocl.pivot.internal.library.ecore.EcoreExecutorProperty; +import org.eclipse.ocl.pivot.internal.library.ecore.EcoreExecutorType; +import org.eclipse.ocl.pivot.internal.library.ecore.EcoreLibraryOppositeProperty; +import org.eclipse.ocl.pivot.internal.library.executor.ExecutorFragment; +import org.eclipse.ocl.pivot.internal.library.executor.ExecutorOperation; +import org.eclipse.ocl.pivot.internal.library.executor.ExecutorProperty; +import org.eclipse.ocl.pivot.internal.library.executor.ExecutorPropertyWithImplementation; +import org.eclipse.ocl.pivot.internal.library.executor.ExecutorStandardLibrary; +import org.eclipse.ocl.pivot.oclstdlib.OCLstdlibTables; + +/** + * ClassesTables provides the dispatch tables for the classes for use by the OCL dispatcher. + * + * In order to ensure correct static initialization, a top level class element must be accessed + * before any nested class element. Therefore an access to PACKAGE.getClass() is recommended. + */ +@SuppressWarnings("nls") +public class ClassesTables +{ + static { + Init.initStart(); + } + + /** + * The package descriptor for the package. + */ + public static final /*@NonNull*/ EcoreExecutorPackage PACKAGE = new EcoreExecutorPackage(ClassesPackage.eINSTANCE); + + /** + * The library of all packages and types. + */ + public static final /*@NonNull*/ ExecutorStandardLibrary LIBRARY = OCLstdlibTables.LIBRARY; + + /** + * The type parameters for templated types and operations. + */ + public static class TypeParameters { + static { + Init.initStart(); + ClassesTables.init(); + } + + static { + Init.initEnd(); + } + + /** + * Force initialization of the fields of ClassesTables::TypeParameters and all preceding sub-packages. + */ + public static void init() {} + } + + /** + * The type descriptors for each type. + */ + public static class Types { + static { + Init.initStart(); + TypeParameters.init(); + } + + public static final /*@NonNull*/ EcoreExecutorType _Class = new EcoreExecutorType(ClassesPackage.Literals.CLASS, PACKAGE, 0); + public static final /*@NonNull*/ EcoreExecutorType _Element = new EcoreExecutorType(ClassesPackage.Literals.ELEMENT, PACKAGE, 0); + public static final /*@NonNull*/ EcoreExecutorType _NamedElement = new EcoreExecutorType(ClassesPackage.Literals.NAMED_ELEMENT, PACKAGE, 0); + public static final /*@NonNull*/ EcoreExecutorType _Namespace = new EcoreExecutorType(ClassesPackage.Literals.NAMESPACE, PACKAGE, 0); + public static final /*@NonNull*/ EcoreExecutorType _Package = new EcoreExecutorType(ClassesPackage.Literals.PACKAGE, PACKAGE, 0); + public static final /*@NonNull*/ EcoreExecutorType _Root = new EcoreExecutorType(ClassesPackage.Literals.ROOT, PACKAGE, 0); + public static final /*@NonNull*/ EcoreExecutorType _Visitable = new EcoreExecutorType("Visitable", PACKAGE, 0); + + private static final /*@NonNull*/ EcoreExecutorType[] types = { + _Class, + _Element, + _NamedElement, + _Namespace, + _Package, + _Root, + _Visitable + }; + + /* + * Install the type descriptors in the package descriptor. + */ + static { + PACKAGE.init(LIBRARY, types); + Init.initEnd(); + } + + /** + * Force initialization of the fields of ClassesTables::Types and all preceding sub-packages. + */ + public static void init() {} + } + + /** + * The fragment descriptors for the local elements of each type and its supertypes. + */ + public static class Fragments { + static { + Init.initStart(); + Types.init(); + } + + private static final /*@NonNull*/ ExecutorFragment _Class__Class = new ExecutorFragment(Types._Class, ClassesTables.Types._Class); + private static final /*@NonNull*/ ExecutorFragment _Class__Element = new ExecutorFragment(Types._Class, ClassesTables.Types._Element); + private static final /*@NonNull*/ ExecutorFragment _Class__NamedElement = new ExecutorFragment(Types._Class, ClassesTables.Types._NamedElement); + private static final /*@NonNull*/ ExecutorFragment _Class__OclAny = new ExecutorFragment(Types._Class, OCLstdlibTables.Types._OclAny); + private static final /*@NonNull*/ ExecutorFragment _Class__OclElement = new ExecutorFragment(Types._Class, OCLstdlibTables.Types._OclElement); + private static final /*@NonNull*/ ExecutorFragment _Class__Visitable = new ExecutorFragment(Types._Class, ClassesTables.Types._Visitable); + + private static final /*@NonNull*/ ExecutorFragment _Element__Element = new ExecutorFragment(Types._Element, ClassesTables.Types._Element); + private static final /*@NonNull*/ ExecutorFragment _Element__OclAny = new ExecutorFragment(Types._Element, OCLstdlibTables.Types._OclAny); + private static final /*@NonNull*/ ExecutorFragment _Element__OclElement = new ExecutorFragment(Types._Element, OCLstdlibTables.Types._OclElement); + private static final /*@NonNull*/ ExecutorFragment _Element__Visitable = new ExecutorFragment(Types._Element, ClassesTables.Types._Visitable); + + private static final /*@NonNull*/ ExecutorFragment _NamedElement__Element = new ExecutorFragment(Types._NamedElement, ClassesTables.Types._Element); + private static final /*@NonNull*/ ExecutorFragment _NamedElement__NamedElement = new ExecutorFragment(Types._NamedElement, ClassesTables.Types._NamedElement); + private static final /*@NonNull*/ ExecutorFragment _NamedElement__OclAny = new ExecutorFragment(Types._NamedElement, OCLstdlibTables.Types._OclAny); + private static final /*@NonNull*/ ExecutorFragment _NamedElement__OclElement = new ExecutorFragment(Types._NamedElement, OCLstdlibTables.Types._OclElement); + private static final /*@NonNull*/ ExecutorFragment _NamedElement__Visitable = new ExecutorFragment(Types._NamedElement, ClassesTables.Types._Visitable); + + private static final /*@NonNull*/ ExecutorFragment _Namespace__Element = new ExecutorFragment(Types._Namespace, ClassesTables.Types._Element); + private static final /*@NonNull*/ ExecutorFragment _Namespace__Namespace = new ExecutorFragment(Types._Namespace, ClassesTables.Types._Namespace); + private static final /*@NonNull*/ ExecutorFragment _Namespace__OclAny = new ExecutorFragment(Types._Namespace, OCLstdlibTables.Types._OclAny); + private static final /*@NonNull*/ ExecutorFragment _Namespace__OclElement = new ExecutorFragment(Types._Namespace, OCLstdlibTables.Types._OclElement); + private static final /*@NonNull*/ ExecutorFragment _Namespace__Visitable = new ExecutorFragment(Types._Namespace, ClassesTables.Types._Visitable); + + private static final /*@NonNull*/ ExecutorFragment _Package__Element = new ExecutorFragment(Types._Package, ClassesTables.Types._Element); + private static final /*@NonNull*/ ExecutorFragment _Package__NamedElement = new ExecutorFragment(Types._Package, ClassesTables.Types._NamedElement); + private static final /*@NonNull*/ ExecutorFragment _Package__Namespace = new ExecutorFragment(Types._Package, ClassesTables.Types._Namespace); + private static final /*@NonNull*/ ExecutorFragment _Package__OclAny = new ExecutorFragment(Types._Package, OCLstdlibTables.Types._OclAny); + private static final /*@NonNull*/ ExecutorFragment _Package__OclElement = new ExecutorFragment(Types._Package, OCLstdlibTables.Types._OclElement); + private static final /*@NonNull*/ ExecutorFragment _Package__Package = new ExecutorFragment(Types._Package, ClassesTables.Types._Package); + private static final /*@NonNull*/ ExecutorFragment _Package__Visitable = new ExecutorFragment(Types._Package, ClassesTables.Types._Visitable); + + private static final /*@NonNull*/ ExecutorFragment _Root__Element = new ExecutorFragment(Types._Root, ClassesTables.Types._Element); + private static final /*@NonNull*/ ExecutorFragment _Root__OclAny = new ExecutorFragment(Types._Root, OCLstdlibTables.Types._OclAny); + private static final /*@NonNull*/ ExecutorFragment _Root__OclElement = new ExecutorFragment(Types._Root, OCLstdlibTables.Types._OclElement); + private static final /*@NonNull*/ ExecutorFragment _Root__Root = new ExecutorFragment(Types._Root, ClassesTables.Types._Root); + private static final /*@NonNull*/ ExecutorFragment _Root__Visitable = new ExecutorFragment(Types._Root, ClassesTables.Types._Visitable); + + private static final /*@NonNull*/ ExecutorFragment _Visitable__OclAny = new ExecutorFragment(Types._Visitable, OCLstdlibTables.Types._OclAny); + private static final /*@NonNull*/ ExecutorFragment _Visitable__OclElement = new ExecutorFragment(Types._Visitable, OCLstdlibTables.Types._OclElement); + private static final /*@NonNull*/ ExecutorFragment _Visitable__Visitable = new ExecutorFragment(Types._Visitable, ClassesTables.Types._Visitable); + + static { + Init.initEnd(); + } + + /** + * Force initialization of the fields of ClassesTables::Fragments and all preceding sub-packages. + */ + public static void init() {} + } + + /** + * The parameter lists shared by operations. + */ + public static class Parameters { + static { + Init.initStart(); + Fragments.init(); + } + + + static { + Init.initEnd(); + } + + /** + * Force initialization of the fields of ClassesTables::Parameters and all preceding sub-packages. + */ + public static void init() {} + } + + /** + * The operation descriptors for each operation of each type. + */ + public static class Operations { + static { + Init.initStart(); + Parameters.init(); + } + + static { + Init.initEnd(); + } + + /** + * Force initialization of the fields of ClassesTables::Operations and all preceding sub-packages. + */ + public static void init() {} + } + + /** + * The property descriptors for each property of each type. + */ + public static class Properties { + static { + Init.initStart(); + Operations.init(); + } + + public static final /*@NonNull*/ ExecutorProperty _Class__superClass = new EcoreExecutorProperty(ClassesPackage.Literals.CLASS__SUPER_CLASS, Types._Class, 0); + public static final /*@NonNull*/ ExecutorProperty _Class__Class__superClass = new ExecutorPropertyWithImplementation("Class", Types._Class, 1, new EcoreLibraryOppositeProperty(ClassesPackage.Literals.CLASS__SUPER_CLASS)); + public static final /*@NonNull*/ ExecutorProperty _Class__Package__ownedClasses = new ExecutorPropertyWithImplementation("Package", Types._Class, 2, new EcoreLibraryOppositeProperty(ClassesPackage.Literals.PACKAGE__OWNED_CLASSES)); + + public static final /*@NonNull*/ ExecutorProperty _NamedElement__name = new EcoreExecutorProperty(ClassesPackage.Literals.NAMED_ELEMENT__NAME, Types._NamedElement, 0); + + public static final /*@NonNull*/ ExecutorProperty _Package__ownedClasses = new EcoreExecutorProperty(ClassesPackage.Literals.PACKAGE__OWNED_CLASSES, Types._Package, 0); + public static final /*@NonNull*/ ExecutorProperty _Package__ownedPackages = new EcoreExecutorProperty(ClassesPackage.Literals.PACKAGE__OWNED_PACKAGES, Types._Package, 1); + public static final /*@NonNull*/ ExecutorProperty _Package__Package__ownedPackages = new ExecutorPropertyWithImplementation("Package", Types._Package, 2, new EcoreLibraryOppositeProperty(ClassesPackage.Literals.PACKAGE__OWNED_PACKAGES)); + public static final /*@NonNull*/ ExecutorProperty _Package__Root__ownedPackages = new ExecutorPropertyWithImplementation("Root", Types._Package, 3, new EcoreLibraryOppositeProperty(ClassesPackage.Literals.ROOT__OWNED_PACKAGES)); + + public static final /*@NonNull*/ ExecutorProperty _Root__ownedPackages = new EcoreExecutorProperty(ClassesPackage.Literals.ROOT__OWNED_PACKAGES, Types._Root, 0); + static { + Init.initEnd(); + } + + /** + * Force initialization of the fields of ClassesTables::Properties and all preceding sub-packages. + */ + public static void init() {} + } + + /** + * The fragments for all base types in depth order: OclAny first, OclSelf last. + */ + public static class TypeFragments { + static { + Init.initStart(); + Properties.init(); + } + + private static final /*@NonNull*/ ExecutorFragment[] _Class = + { + Fragments._Class__OclAny /* 0 */, + Fragments._Class__OclElement /* 1 */, + Fragments._Class__Visitable /* 2 */, + Fragments._Class__Element /* 3 */, + Fragments._Class__NamedElement /* 4 */, + Fragments._Class__Class /* 5 */ + }; + private static final /*@NonNull*/ int[] __Class = { 1,1,1,1,1,1 }; + + private static final /*@NonNull*/ ExecutorFragment[] _Element = + { + Fragments._Element__OclAny /* 0 */, + Fragments._Element__OclElement /* 1 */, + Fragments._Element__Visitable /* 2 */, + Fragments._Element__Element /* 3 */ + }; + private static final /*@NonNull*/ int[] __Element = { 1,1,1,1 }; + + private static final /*@NonNull*/ ExecutorFragment[] _NamedElement = + { + Fragments._NamedElement__OclAny /* 0 */, + Fragments._NamedElement__OclElement /* 1 */, + Fragments._NamedElement__Visitable /* 2 */, + Fragments._NamedElement__Element /* 3 */, + Fragments._NamedElement__NamedElement /* 4 */ + }; + private static final /*@NonNull*/ int[] __NamedElement = { 1,1,1,1,1 }; + + private static final /*@NonNull*/ ExecutorFragment[] _Namespace = + { + Fragments._Namespace__OclAny /* 0 */, + Fragments._Namespace__OclElement /* 1 */, + Fragments._Namespace__Visitable /* 2 */, + Fragments._Namespace__Element /* 3 */, + Fragments._Namespace__Namespace /* 4 */ + }; + private static final /*@NonNull*/ int[] __Namespace = { 1,1,1,1,1 }; + + private static final /*@NonNull*/ ExecutorFragment[] _Package = + { + Fragments._Package__OclAny /* 0 */, + Fragments._Package__OclElement /* 1 */, + Fragments._Package__Visitable /* 2 */, + Fragments._Package__Element /* 3 */, + Fragments._Package__NamedElement /* 4 */, + Fragments._Package__Namespace /* 4 */, + Fragments._Package__Package /* 5 */ + }; + private static final /*@NonNull*/ int[] __Package = { 1,1,1,1,2,1 }; + + private static final /*@NonNull*/ ExecutorFragment[] _Root = + { + Fragments._Root__OclAny /* 0 */, + Fragments._Root__OclElement /* 1 */, + Fragments._Root__Visitable /* 2 */, + Fragments._Root__Element /* 3 */, + Fragments._Root__Root /* 4 */ + }; + private static final /*@NonNull*/ int[] __Root = { 1,1,1,1,1 }; + + private static final /*@NonNull*/ ExecutorFragment[] _Visitable = + { + Fragments._Visitable__OclAny /* 0 */, + Fragments._Visitable__OclElement /* 1 */, + Fragments._Visitable__Visitable /* 2 */ + }; + private static final /*@NonNull*/ int[] __Visitable = { 1,1,1 }; + + /** + * Install the fragment descriptors in the class descriptors. + */ + static { + Types._Class.initFragments(_Class, __Class); + Types._Element.initFragments(_Element, __Element); + Types._NamedElement.initFragments(_NamedElement, __NamedElement); + Types._Namespace.initFragments(_Namespace, __Namespace); + Types._Package.initFragments(_Package, __Package); + Types._Root.initFragments(_Root, __Root); + Types._Visitable.initFragments(_Visitable, __Visitable); + + Init.initEnd(); + } + + /** + * Force initialization of the fields of ClassesTables::TypeFragments and all preceding sub-packages. + */ + public static void init() {} + } + + /** + * The lists of local operations or local operation overrides for each fragment of each type. + */ + public static class FragmentOperations { + static { + Init.initStart(); + TypeFragments.init(); + } + + private static final /*@NonNull*/ ExecutorOperation[] _Class__Class = {}; + private static final /*@NonNull*/ ExecutorOperation[] _Class__Element = {}; + private static final /*@NonNull*/ ExecutorOperation[] _Class__NamedElement = {}; + private static final /*@NonNull*/ ExecutorOperation[] _Class__OclAny = { + OCLstdlibTables.Operations._OclAny___lt__gt_ /* _'<>'(OclSelf) */, + OCLstdlibTables.Operations._OclAny___eq_ /* _'='(OclSelf) */, + OCLstdlibTables.Operations._OclAny__oclAsSet /* oclAsSet() */, + OCLstdlibTables.Operations._OclAny__oclAsType /* oclAsType(TT)(TT) */, + OCLstdlibTables.Operations._OclAny__oclIsInState /* oclIsInState(OclState) */, + OCLstdlibTables.Operations._OclAny__oclIsInvalid /* oclIsInvalid() */, + OCLstdlibTables.Operations._OclAny__oclIsKindOf /* oclIsKindOf(OclType) */, + OCLstdlibTables.Operations._OclAny__oclIsNew /* oclIsNew() */, + OCLstdlibTables.Operations._OclAny__oclIsTypeOf /* oclIsTypeOf(OclType) */, + OCLstdlibTables.Operations._OclAny__oclIsUndefined /* oclIsUndefined() */, + OCLstdlibTables.Operations._OclAny__0_oclLog /* oclLog() */, + OCLstdlibTables.Operations._OclAny__1_oclLog /* oclLog(String) */, + OCLstdlibTables.Operations._OclAny__oclType /* oclType() */, + OCLstdlibTables.Operations._OclAny__toString /* toString() */ + }; + private static final /*@NonNull*/ ExecutorOperation[] _Class__OclElement = { + OCLstdlibTables.Operations._OclElement__allInstances /* allInstances() */, + OCLstdlibTables.Operations._OclElement__oclContainer /* oclContainer() */, + OCLstdlibTables.Operations._OclElement__oclContents /* oclContents() */ + }; + private static final /*@NonNull*/ ExecutorOperation[] _Class__Visitable = {}; + + private static final /*@NonNull*/ ExecutorOperation[] _Element__Element = {}; + private static final /*@NonNull*/ ExecutorOperation[] _Element__OclAny = { + OCLstdlibTables.Operations._OclAny___lt__gt_ /* _'<>'(OclSelf) */, + OCLstdlibTables.Operations._OclAny___eq_ /* _'='(OclSelf) */, + OCLstdlibTables.Operations._OclAny__oclAsSet /* oclAsSet() */, + OCLstdlibTables.Operations._OclAny__oclAsType /* oclAsType(TT)(TT) */, + OCLstdlibTables.Operations._OclAny__oclIsInState /* oclIsInState(OclState) */, + OCLstdlibTables.Operations._OclAny__oclIsInvalid /* oclIsInvalid() */, + OCLstdlibTables.Operations._OclAny__oclIsKindOf /* oclIsKindOf(OclType) */, + OCLstdlibTables.Operations._OclAny__oclIsNew /* oclIsNew() */, + OCLstdlibTables.Operations._OclAny__oclIsTypeOf /* oclIsTypeOf(OclType) */, + OCLstdlibTables.Operations._OclAny__oclIsUndefined /* oclIsUndefined() */, + OCLstdlibTables.Operations._OclAny__0_oclLog /* oclLog() */, + OCLstdlibTables.Operations._OclAny__1_oclLog /* oclLog(String) */, + OCLstdlibTables.Operations._OclAny__oclType /* oclType() */, + OCLstdlibTables.Operations._OclAny__toString /* toString() */ + }; + private static final /*@NonNull*/ ExecutorOperation[] _Element__OclElement = { + OCLstdlibTables.Operations._OclElement__allInstances /* allInstances() */, + OCLstdlibTables.Operations._OclElement__oclContainer /* oclContainer() */, + OCLstdlibTables.Operations._OclElement__oclContents /* oclContents() */ + }; + private static final /*@NonNull*/ ExecutorOperation[] _Element__Visitable = {}; + + private static final /*@NonNull*/ ExecutorOperation[] _NamedElement__NamedElement = {}; + private static final /*@NonNull*/ ExecutorOperation[] _NamedElement__Element = {}; + private static final /*@NonNull*/ ExecutorOperation[] _NamedElement__OclAny = { + OCLstdlibTables.Operations._OclAny___lt__gt_ /* _'<>'(OclSelf) */, + OCLstdlibTables.Operations._OclAny___eq_ /* _'='(OclSelf) */, + OCLstdlibTables.Operations._OclAny__oclAsSet /* oclAsSet() */, + OCLstdlibTables.Operations._OclAny__oclAsType /* oclAsType(TT)(TT) */, + OCLstdlibTables.Operations._OclAny__oclIsInState /* oclIsInState(OclState) */, + OCLstdlibTables.Operations._OclAny__oclIsInvalid /* oclIsInvalid() */, + OCLstdlibTables.Operations._OclAny__oclIsKindOf /* oclIsKindOf(OclType) */, + OCLstdlibTables.Operations._OclAny__oclIsNew /* oclIsNew() */, + OCLstdlibTables.Operations._OclAny__oclIsTypeOf /* oclIsTypeOf(OclType) */, + OCLstdlibTables.Operations._OclAny__oclIsUndefined /* oclIsUndefined() */, + OCLstdlibTables.Operations._OclAny__0_oclLog /* oclLog() */, + OCLstdlibTables.Operations._OclAny__1_oclLog /* oclLog(String) */, + OCLstdlibTables.Operations._OclAny__oclType /* oclType() */, + OCLstdlibTables.Operations._OclAny__toString /* toString() */ + }; + private static final /*@NonNull*/ ExecutorOperation[] _NamedElement__OclElement = { + OCLstdlibTables.Operations._OclElement__allInstances /* allInstances() */, + OCLstdlibTables.Operations._OclElement__oclContainer /* oclContainer() */, + OCLstdlibTables.Operations._OclElement__oclContents /* oclContents() */ + }; + private static final /*@NonNull*/ ExecutorOperation[] _NamedElement__Visitable = {}; + + private static final /*@NonNull*/ ExecutorOperation[] _Namespace__Namespace = {}; + private static final /*@NonNull*/ ExecutorOperation[] _Namespace__Element = {}; + private static final /*@NonNull*/ ExecutorOperation[] _Namespace__OclAny = { + OCLstdlibTables.Operations._OclAny___lt__gt_ /* _'<>'(OclSelf) */, + OCLstdlibTables.Operations._OclAny___eq_ /* _'='(OclSelf) */, + OCLstdlibTables.Operations._OclAny__oclAsSet /* oclAsSet() */, + OCLstdlibTables.Operations._OclAny__oclAsType /* oclAsType(TT)(TT) */, + OCLstdlibTables.Operations._OclAny__oclIsInState /* oclIsInState(OclState) */, + OCLstdlibTables.Operations._OclAny__oclIsInvalid /* oclIsInvalid() */, + OCLstdlibTables.Operations._OclAny__oclIsKindOf /* oclIsKindOf(OclType) */, + OCLstdlibTables.Operations._OclAny__oclIsNew /* oclIsNew() */, + OCLstdlibTables.Operations._OclAny__oclIsTypeOf /* oclIsTypeOf(OclType) */, + OCLstdlibTables.Operations._OclAny__oclIsUndefined /* oclIsUndefined() */, + OCLstdlibTables.Operations._OclAny__0_oclLog /* oclLog() */, + OCLstdlibTables.Operations._OclAny__1_oclLog /* oclLog(String) */, + OCLstdlibTables.Operations._OclAny__oclType /* oclType() */, + OCLstdlibTables.Operations._OclAny__toString /* toString() */ + }; + private static final /*@NonNull*/ ExecutorOperation[] _Namespace__OclElement = { + OCLstdlibTables.Operations._OclElement__allInstances /* allInstances() */, + OCLstdlibTables.Operations._OclElement__oclContainer /* oclContainer() */, + OCLstdlibTables.Operations._OclElement__oclContents /* oclContents() */ + }; + private static final /*@NonNull*/ ExecutorOperation[] _Namespace__Visitable = {}; + + private static final /*@NonNull*/ ExecutorOperation[] _Package__Package = {}; + private static final /*@NonNull*/ ExecutorOperation[] _Package__Element = {}; + private static final /*@NonNull*/ ExecutorOperation[] _Package__NamedElement = {}; + private static final /*@NonNull*/ ExecutorOperation[] _Package__Namespace = {}; + private static final /*@NonNull*/ ExecutorOperation[] _Package__OclAny = { + OCLstdlibTables.Operations._OclAny___lt__gt_ /* _'<>'(OclSelf) */, + OCLstdlibTables.Operations._OclAny___eq_ /* _'='(OclSelf) */, + OCLstdlibTables.Operations._OclAny__oclAsSet /* oclAsSet() */, + OCLstdlibTables.Operations._OclAny__oclAsType /* oclAsType(TT)(TT) */, + OCLstdlibTables.Operations._OclAny__oclIsInState /* oclIsInState(OclState) */, + OCLstdlibTables.Operations._OclAny__oclIsInvalid /* oclIsInvalid() */, + OCLstdlibTables.Operations._OclAny__oclIsKindOf /* oclIsKindOf(OclType) */, + OCLstdlibTables.Operations._OclAny__oclIsNew /* oclIsNew() */, + OCLstdlibTables.Operations._OclAny__oclIsTypeOf /* oclIsTypeOf(OclType) */, + OCLstdlibTables.Operations._OclAny__oclIsUndefined /* oclIsUndefined() */, + OCLstdlibTables.Operations._OclAny__0_oclLog /* oclLog() */, + OCLstdlibTables.Operations._OclAny__1_oclLog /* oclLog(String) */, + OCLstdlibTables.Operations._OclAny__oclType /* oclType() */, + OCLstdlibTables.Operations._OclAny__toString /* toString() */ + }; + private static final /*@NonNull*/ ExecutorOperation[] _Package__OclElement = { + OCLstdlibTables.Operations._OclElement__allInstances /* allInstances() */, + OCLstdlibTables.Operations._OclElement__oclContainer /* oclContainer() */, + OCLstdlibTables.Operations._OclElement__oclContents /* oclContents() */ + }; + private static final /*@NonNull*/ ExecutorOperation[] _Package__Visitable = {}; + + private static final /*@NonNull*/ ExecutorOperation[] _Root__Root = {}; + private static final /*@NonNull*/ ExecutorOperation[] _Root__Element = {}; + private static final /*@NonNull*/ ExecutorOperation[] _Root__OclAny = { + OCLstdlibTables.Operations._OclAny___lt__gt_ /* _'<>'(OclSelf) */, + OCLstdlibTables.Operations._OclAny___eq_ /* _'='(OclSelf) */, + OCLstdlibTables.Operations._OclAny__oclAsSet /* oclAsSet() */, + OCLstdlibTables.Operations._OclAny__oclAsType /* oclAsType(TT)(TT) */, + OCLstdlibTables.Operations._OclAny__oclIsInState /* oclIsInState(OclState) */, + OCLstdlibTables.Operations._OclAny__oclIsInvalid /* oclIsInvalid() */, + OCLstdlibTables.Operations._OclAny__oclIsKindOf /* oclIsKindOf(OclType) */, + OCLstdlibTables.Operations._OclAny__oclIsNew /* oclIsNew() */, + OCLstdlibTables.Operations._OclAny__oclIsTypeOf /* oclIsTypeOf(OclType) */, + OCLstdlibTables.Operations._OclAny__oclIsUndefined /* oclIsUndefined() */, + OCLstdlibTables.Operations._OclAny__0_oclLog /* oclLog() */, + OCLstdlibTables.Operations._OclAny__1_oclLog /* oclLog(String) */, + OCLstdlibTables.Operations._OclAny__oclType /* oclType() */, + OCLstdlibTables.Operations._OclAny__toString /* toString() */ + }; + private static final /*@NonNull*/ ExecutorOperation[] _Root__OclElement = { + OCLstdlibTables.Operations._OclElement__allInstances /* allInstances() */, + OCLstdlibTables.Operations._OclElement__oclContainer /* oclContainer() */, + OCLstdlibTables.Operations._OclElement__oclContents /* oclContents() */ + }; + private static final /*@NonNull*/ ExecutorOperation[] _Root__Visitable = {}; + + private static final /*@NonNull*/ ExecutorOperation[] _Visitable__Visitable = {}; + private static final /*@NonNull*/ ExecutorOperation[] _Visitable__OclAny = { + OCLstdlibTables.Operations._OclAny___lt__gt_ /* _'<>'(OclSelf) */, + OCLstdlibTables.Operations._OclAny___eq_ /* _'='(OclSelf) */, + OCLstdlibTables.Operations._OclAny__oclAsSet /* oclAsSet() */, + OCLstdlibTables.Operations._OclAny__oclAsType /* oclAsType(TT)(TT) */, + OCLstdlibTables.Operations._OclAny__oclIsInState /* oclIsInState(OclState) */, + OCLstdlibTables.Operations._OclAny__oclIsInvalid /* oclIsInvalid() */, + OCLstdlibTables.Operations._OclAny__oclIsKindOf /* oclIsKindOf(OclType) */, + OCLstdlibTables.Operations._OclAny__oclIsNew /* oclIsNew() */, + OCLstdlibTables.Operations._OclAny__oclIsTypeOf /* oclIsTypeOf(OclType) */, + OCLstdlibTables.Operations._OclAny__oclIsUndefined /* oclIsUndefined() */, + OCLstdlibTables.Operations._OclAny__0_oclLog /* oclLog() */, + OCLstdlibTables.Operations._OclAny__1_oclLog /* oclLog(String) */, + OCLstdlibTables.Operations._OclAny__oclType /* oclType() */, + OCLstdlibTables.Operations._OclAny__toString /* toString() */ + }; + private static final /*@NonNull*/ ExecutorOperation[] _Visitable__OclElement = { + OCLstdlibTables.Operations._OclElement__allInstances /* allInstances() */, + OCLstdlibTables.Operations._OclElement__oclContainer /* oclContainer() */, + OCLstdlibTables.Operations._OclElement__oclContents /* oclContents() */ + }; + + /* + * Install the operation descriptors in the fragment descriptors. + */ + static { + Fragments._Class__Class.initOperations(_Class__Class); + Fragments._Class__Element.initOperations(_Class__Element); + Fragments._Class__NamedElement.initOperations(_Class__NamedElement); + Fragments._Class__OclAny.initOperations(_Class__OclAny); + Fragments._Class__OclElement.initOperations(_Class__OclElement); + Fragments._Class__Visitable.initOperations(_Class__Visitable); + + Fragments._Element__Element.initOperations(_Element__Element); + Fragments._Element__OclAny.initOperations(_Element__OclAny); + Fragments._Element__OclElement.initOperations(_Element__OclElement); + Fragments._Element__Visitable.initOperations(_Element__Visitable); + + Fragments._NamedElement__Element.initOperations(_NamedElement__Element); + Fragments._NamedElement__NamedElement.initOperations(_NamedElement__NamedElement); + Fragments._NamedElement__OclAny.initOperations(_NamedElement__OclAny); + Fragments._NamedElement__OclElement.initOperations(_NamedElement__OclElement); + Fragments._NamedElement__Visitable.initOperations(_NamedElement__Visitable); + + Fragments._Namespace__Element.initOperations(_Namespace__Element); + Fragments._Namespace__Namespace.initOperations(_Namespace__Namespace); + Fragments._Namespace__OclAny.initOperations(_Namespace__OclAny); + Fragments._Namespace__OclElement.initOperations(_Namespace__OclElement); + Fragments._Namespace__Visitable.initOperations(_Namespace__Visitable); + + Fragments._Package__Element.initOperations(_Package__Element); + Fragments._Package__NamedElement.initOperations(_Package__NamedElement); + Fragments._Package__Namespace.initOperations(_Package__Namespace); + Fragments._Package__OclAny.initOperations(_Package__OclAny); + Fragments._Package__OclElement.initOperations(_Package__OclElement); + Fragments._Package__Package.initOperations(_Package__Package); + Fragments._Package__Visitable.initOperations(_Package__Visitable); + + Fragments._Root__Element.initOperations(_Root__Element); + Fragments._Root__OclAny.initOperations(_Root__OclAny); + Fragments._Root__OclElement.initOperations(_Root__OclElement); + Fragments._Root__Root.initOperations(_Root__Root); + Fragments._Root__Visitable.initOperations(_Root__Visitable); + + Fragments._Visitable__OclAny.initOperations(_Visitable__OclAny); + Fragments._Visitable__OclElement.initOperations(_Visitable__OclElement); + Fragments._Visitable__Visitable.initOperations(_Visitable__Visitable); + + Init.initEnd(); + } + + /** + * Force initialization of the fields of ClassesTables::FragmentOperations and all preceding sub-packages. + */ + public static void init() {} + } + + /** + * The lists of local properties for the local fragment of each type. + */ + public static class FragmentProperties { + static { + Init.initStart(); + FragmentOperations.init(); + } + + private static final /*@NonNull*/ ExecutorProperty[] _Class = { + ClassesTables.Properties._NamedElement__name, + ClassesTables.Properties._Class__superClass, + ClassesTables.Properties._Class__Class__superClass, + ClassesTables.Properties._Class__Package__ownedClasses + }; + + private static final /*@NonNull*/ ExecutorProperty[] _Element = {}; + + private static final /*@NonNull*/ ExecutorProperty[] _NamedElement = { + ClassesTables.Properties._NamedElement__name + }; + + private static final /*@NonNull*/ ExecutorProperty[] _Namespace = {}; + + private static final /*@NonNull*/ ExecutorProperty[] _Package = { + ClassesTables.Properties._NamedElement__name, + ClassesTables.Properties._Package__ownedClasses, + ClassesTables.Properties._Package__ownedPackages, + ClassesTables.Properties._Package__Package__ownedPackages, + ClassesTables.Properties._Package__Root__ownedPackages + }; + + private static final /*@NonNull*/ ExecutorProperty[] _Root = { + ClassesTables.Properties._Root__ownedPackages + }; + + private static final /*@NonNull*/ ExecutorProperty[] _Visitable = {}; + + /** + * Install the property descriptors in the fragment descriptors. + */ + static { + Fragments._Class__Class.initProperties(_Class); + Fragments._Element__Element.initProperties(_Element); + Fragments._NamedElement__NamedElement.initProperties(_NamedElement); + Fragments._Namespace__Namespace.initProperties(_Namespace); + Fragments._Package__Package.initProperties(_Package); + Fragments._Root__Root.initProperties(_Root); + Fragments._Visitable__Visitable.initProperties(_Visitable); + + Init.initEnd(); + } + + /** + * Force initialization of the fields of ClassesTables::FragmentProperties and all preceding sub-packages. + */ + public static void init() {} + } + + /** + * The lists of enumeration literals for each enumeration. + */ + public static class EnumerationLiterals { + static { + Init.initStart(); + FragmentProperties.init(); + } + + /** + * Install the enumeration literals in the enumerations. + */ + static { + + Init.initEnd(); + } + + /** + * Force initialization of the fields of ClassesTables::EnumerationLiterals and all preceding sub-packages. + */ + public static void init() {} + } + + /** + * The multiple packages above avoid problems with the Java 65536 byte limit but introduce a difficulty in ensuring that + * static construction occurs in the disciplined order of the packages when construction may start in any of the packages. + * The problem is resolved by ensuring that the static construction of each package first initializes its immediate predecessor. + * On completion of predecessor initialization, the residual packages are initialized by starting an initialization in the last package. + * This class maintains a count so that the various predecessors can distinguish whether they are the starting point and so + * ensure that residual construction occurs just once after all predecessors. + */ + private static class Init { + /** + * Counter of nested static constructions. On return to zero residual construction starts. -ve once residual construction started. + */ + private static int initCount = 0; + + /** + * Invoked at the start of a static construction to defer residual cobstruction until primary constructions complete. + */ + private static void initStart() { + if (initCount >= 0) { + initCount++; + } + } + + /** + * Invoked at the end of a static construction to activate residual cobstruction once primary constructions complete. + */ + private static void initEnd() { + if (initCount > 0) { + if (--initCount == 0) { + initCount = -1; + EnumerationLiterals.init(); + } + } + } + } + + static { + Init.initEnd(); + } + + /* + * Force initialization of outer fields. Inner fields are lazily initialized. + */ + public static void init() {} +} diff --git a/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/Env4CG.java b/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/Env4CG.java index 08dae216a..af63f80ac 100644 --- a/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/Env4CG.java +++ b/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/Env4CG.java @@ -19,7 +19,7 @@ public interface Env4CG extends EObject { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @model annotation="http://www.eclipse.org/emf/2002/GenModel body='throw new <%java.lang.UnsupportedOperationException%>(\"Enviroment::hasFinalResult() has been created for CG purposes. Don\'t call this method\");'" + * @model annotation="http://www.eclipse.org/emf/2002/GenModel body='throw new UnsupportedOperationException(); // FIXME Unimplemented http://cs2as/tests/example2/env/1.0!Env4CG!hasFinalResult()'" * @generated */ boolean hasFinalResult(); @@ -28,7 +28,7 @@ public interface Env4CG extends EObject { * <!-- begin-user-doc --> * <!-- end-user-doc --> * @model kind="operation" type="example2.env.Evaluator" - * annotation="http://www.eclipse.org/emf/2002/GenModel body='throw new <%java.lang.UnsupportedOperationException%>(\"Enviroment::getEvaluator() has been created for CG purposes. Don\'t call this method\");'" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='throw new UnsupportedOperationException(); // FIXME Unimplemented http://cs2as/tests/example2/env/1.0!Env4CG!getEvaluator()'" * @generated */ Evaluator getEvaluator(); diff --git a/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/Environment.java b/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/Environment.java index 3115282ae..2eace364d 100644 --- a/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/Environment.java +++ b/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/Environment.java @@ -35,7 +35,7 @@ public interface Environment extends Env4CG { * <!-- end-user-doc --> * @return the value of the '<em>Named Elements</em>' reference list. * @see example2.env.EnvironmentPackage#getEnvironment_NamedElements() - * @model + * @model annotation="http://www.eclipse.org/emf/2002/GenModel get='throw new UnsupportedOperationException(); // FIXME Unimplemented http://cs2as/tests/example2/env/1.0!Environment!namedElements'" * @generated */ EList<NamedElement> getNamedElements(); @@ -51,7 +51,7 @@ public interface Environment extends Env4CG { * @return the value of the '<em>Parent Env</em>' reference. * @see #setParentEnv(Environment) * @see example2.env.EnvironmentPackage#getEnvironment_ParentEnv() - * @model + * @model annotation="http://www.eclipse.org/emf/2002/GenModel get='throw new UnsupportedOperationException(); // FIXME Unimplemented http://cs2as/tests/example2/env/1.0!Environment!parentEnv'" * @generated */ Environment getParentEnv(); @@ -70,6 +70,7 @@ public interface Environment extends Env4CG { * <!-- begin-user-doc --> * <!-- end-user-doc --> * @model elementsMany="true" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='/**\n * Environment{\n * namedElements = namedElements->asSequence()\n * ->includingAll(elements), parentEnv = parentEnv}\n \052/\nfinal /*@NonNull\052/ /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.evaluation.Evaluator%> evaluator = <%org.eclipse.ocl.pivot.internal.utilities.PivotUtilInternal%>.getEvaluator(this);\nfinal /*@NonNull\052/ /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.ids.IdResolver%> idResolver = evaluator.getIdResolver();\nfinal /*@NonNull\052/ /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.Property%> CTORid_namedElements = idResolver.getProperty(<%example2.env.EnvironmentTables%>.PROPid_namedElements);\nfinal /*@NonNull\052/ /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.Property%> CTORid_parentEnv = idResolver.getProperty(<%example2.env.EnvironmentTables%>.PROPid_parentEnv);\nfinal /*@NonNull\052/ /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.Class%> TYP_env_c_c_Environment_0 = idResolver.getClass(<%example2.env.EnvironmentTables%>.CLSSid_Environment, null);\nfinal /*@NonNull\052/ /*@Thrown\052/ <%example2.env.Environment%> symbol_0 = (<%example2.env.Environment%>)TYP_env_c_c_Environment_0.createInstance();\nfinal /*@NonNull\052/ /*@Thrown\052/ <%java.util.List%><<%example2.classes.NamedElement%>> namedElements = this.getNamedElements();\nfinal /*@NonNull\052/ /*@Thrown\052/ <%org.eclipse.ocl.pivot.values.OrderedSetValue%> BOXED_namedElements = idResolver.createOrderedSetOfAll(<%example2.env.EnvironmentTables%>.ORD_CLSSid_NamedElement, namedElements);\nfinal /*@NonNull\052/ /*@Thrown\052/ <%org.eclipse.ocl.pivot.values.SequenceValue%> asSequence = <%org.eclipse.ocl.pivot.utilities.ClassUtil%>.nonNullState(<%org.eclipse.ocl.pivot.library.collection.CollectionAsSequenceOperation%>.INSTANCE.evaluate(BOXED_namedElements));\nfinal /*@NonNull\052/ /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.values.OrderedSetValue%> BOXED_elements = idResolver.createOrderedSetOfAll(<%example2.env.EnvironmentTables%>.ORD_CLSSid_NamedElement, elements);\nfinal /*@NonNull\052/ /*@Thrown\052/ <%org.eclipse.ocl.pivot.values.CollectionValue%> includingAll = <%org.eclipse.ocl.pivot.utilities.ClassUtil%>.nonNullState(<%org.eclipse.ocl.pivot.library.collection.CollectionIncludingAllOperation%>.INSTANCE.evaluate(asSequence, BOXED_elements));\nfinal <%java.util.List%><<%example2.classes.NamedElement%>> UNBOXED_includingAll = includingAll.asEcoreObjects(idResolver, example2.classes.NamedElement.class);\nassert UNBOXED_includingAll != null;\nCTORid_namedElements.initValue(symbol_0, UNBOXED_includingAll);\nfinal /*@Nullable\052/ /*@Thrown\052/ <%example2.env.Environment%> parentEnv = this.getParentEnv();\nCTORid_parentEnv.initValue(symbol_0, parentEnv);\nreturn (<%example2.env.Environment%>)symbol_0;'" * @generated */ Environment addElements(EList<NamedElement> elements); @@ -77,7 +78,7 @@ public interface Environment extends Env4CG { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @model + * @model annotation="http://www.eclipse.org/emf/2002/GenModel body='/**\n * Environment{\n * namedElements = namedElements->asSequence()\n * ->including(element), parentEnv = parentEnv}\n \052/\nfinal /*@NonNull\052/ /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.evaluation.Evaluator%> evaluator = <%org.eclipse.ocl.pivot.internal.utilities.PivotUtilInternal%>.getEvaluator(this);\nfinal /*@NonNull\052/ /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.ids.IdResolver%> idResolver = evaluator.getIdResolver();\nfinal /*@NonNull\052/ /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.Property%> CTORid_namedElements = idResolver.getProperty(<%example2.env.EnvironmentTables%>.PROPid_namedElements);\nfinal /*@NonNull\052/ /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.Property%> CTORid_parentEnv = idResolver.getProperty(<%example2.env.EnvironmentTables%>.PROPid_parentEnv);\nfinal /*@NonNull\052/ /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.Class%> TYP_env_c_c_Environment_0 = idResolver.getClass(<%example2.env.EnvironmentTables%>.CLSSid_Environment, null);\nfinal /*@NonNull\052/ /*@Thrown\052/ <%example2.env.Environment%> symbol_0 = (<%example2.env.Environment%>)TYP_env_c_c_Environment_0.createInstance();\nfinal /*@NonNull\052/ /*@Thrown\052/ <%java.util.List%><<%example2.classes.NamedElement%>> namedElements = this.getNamedElements();\nfinal /*@NonNull\052/ /*@Thrown\052/ <%org.eclipse.ocl.pivot.values.OrderedSetValue%> BOXED_namedElements = idResolver.createOrderedSetOfAll(<%example2.env.EnvironmentTables%>.ORD_CLSSid_NamedElement, namedElements);\nfinal /*@NonNull\052/ /*@Thrown\052/ <%org.eclipse.ocl.pivot.values.SequenceValue%> asSequence = <%org.eclipse.ocl.pivot.utilities.ClassUtil%>.nonNullState(<%org.eclipse.ocl.pivot.library.collection.CollectionAsSequenceOperation%>.INSTANCE.evaluate(BOXED_namedElements));\nfinal /*@NonNull\052/ /*@Thrown\052/ <%org.eclipse.ocl.pivot.values.SequenceValue%> including = <%org.eclipse.ocl.pivot.utilities.ClassUtil%>.nonNullState((<%org.eclipse.ocl.pivot.values.SequenceValue%>)<%org.eclipse.ocl.pivot.library.collection.CollectionIncludingOperation%>.INSTANCE.evaluate(asSequence, element));\nfinal <%java.util.List%><<%example2.classes.NamedElement%>> UNBOXED_including = including.asEcoreObjects(idResolver, example2.classes.NamedElement.class);\nassert UNBOXED_including != null;\nCTORid_namedElements.initValue(symbol_0, UNBOXED_including);\nfinal /*@Nullable\052/ /*@Thrown\052/ <%example2.env.Environment%> parentEnv = this.getParentEnv();\nCTORid_parentEnv.initValue(symbol_0, parentEnv);\nreturn (<%example2.env.Environment%>)symbol_0;'" * @generated */ Environment addElement(NamedElement element); diff --git a/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/EnvironmentPackage.java b/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/EnvironmentPackage.java index efb5a4ada..f3bd3c049 100644 --- a/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/EnvironmentPackage.java +++ b/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/EnvironmentPackage.java @@ -3,7 +3,6 @@ package example2.env; import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; @@ -21,6 +20,7 @@ import org.eclipse.emf.ecore.EReference; * <!-- end-user-doc --> * @see example2.env.EnvironmentFactory * @model kind="package" + * annotation="http://www.eclipse.org/OCL/Import classes='Classes.ecore#/'" * @generated */ public interface EnvironmentPackage extends EPackage { @@ -76,33 +76,6 @@ public interface EnvironmentPackage extends EPackage { int ENV4_CG_FEATURE_COUNT = 0; /** - * The operation id for the '<em>Has Final Result</em>' operation. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - int ENV4_CG___HAS_FINAL_RESULT = 0; - - /** - * The operation id for the '<em>Get Evaluator</em>' operation. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - int ENV4_CG___GET_EVALUATOR = 1; - - /** - * The number of operations of the '<em>Env4 CG</em>' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - int ENV4_CG_OPERATION_COUNT = 2; - - /** * The meta object id for the '{@link example2.env.impl.EnvironmentImpl <em>Environment</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -140,52 +113,6 @@ public interface EnvironmentPackage extends EPackage { int ENVIRONMENT_FEATURE_COUNT = ENV4_CG_FEATURE_COUNT + 2; /** - * The operation id for the '<em>Has Final Result</em>' operation. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - int ENVIRONMENT___HAS_FINAL_RESULT = ENV4_CG___HAS_FINAL_RESULT; - - /** - * The operation id for the '<em>Get Evaluator</em>' operation. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - int ENVIRONMENT___GET_EVALUATOR = ENV4_CG___GET_EVALUATOR; - - /** - * The operation id for the '<em>Add Elements</em>' operation. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - int ENVIRONMENT___ADD_ELEMENTS__ELIST = ENV4_CG_OPERATION_COUNT + 0; - - /** - * The operation id for the '<em>Add Element</em>' operation. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - int ENVIRONMENT___ADD_ELEMENT__NAMEDELEMENT = ENV4_CG_OPERATION_COUNT + 1; - - /** - * The number of operations of the '<em>Environment</em>' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - int ENVIRONMENT_OPERATION_COUNT = ENV4_CG_OPERATION_COUNT + 2; - - - /** * The meta object id for the '{@link org.eclipse.ocl.pivot.evaluation.Evaluator <em>Evaluator</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -205,16 +132,6 @@ public interface EnvironmentPackage extends EPackage { int EVALUATOR_FEATURE_COUNT = 0; /** - * The number of operations of the '<em>Evaluator</em>' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - int EVALUATOR_OPERATION_COUNT = 0; - - - /** * Returns the meta object for class '{@link example2.env.Environment <em>Environment</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -247,26 +164,6 @@ public interface EnvironmentPackage extends EPackage { EReference getEnvironment_ParentEnv(); /** - * Returns the meta object for the '{@link example2.env.Environment#addElements(org.eclipse.emf.common.util.EList) <em>Add Elements</em>}' operation. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the '<em>Add Elements</em>' operation. - * @see example2.env.Environment#addElements(org.eclipse.emf.common.util.EList) - * @generated - */ - EOperation getEnvironment__AddElements__EList(); - - /** - * Returns the meta object for the '{@link example2.env.Environment#addElement(example2.classes.NamedElement) <em>Add Element</em>}' operation. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the '<em>Add Element</em>' operation. - * @see example2.env.Environment#addElement(example2.classes.NamedElement) - * @generated - */ - EOperation getEnvironment__AddElement__NamedElement(); - - /** * Returns the meta object for class '{@link example2.env.Env4CG <em>Env4 CG</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -277,26 +174,6 @@ public interface EnvironmentPackage extends EPackage { EClass getEnv4CG(); /** - * Returns the meta object for the '{@link example2.env.Env4CG#hasFinalResult() <em>Has Final Result</em>}' operation. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the '<em>Has Final Result</em>' operation. - * @see example2.env.Env4CG#hasFinalResult() - * @generated - */ - EOperation getEnv4CG__HasFinalResult(); - - /** - * Returns the meta object for the '{@link example2.env.Env4CG#getEvaluator() <em>Get Evaluator</em>}' operation. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the '<em>Get Evaluator</em>' operation. - * @see example2.env.Env4CG#getEvaluator() - * @generated - */ - EOperation getEnv4CG__GetEvaluator(); - - /** * Returns the meta object for class '{@link org.eclipse.ocl.pivot.evaluation.Evaluator <em>Evaluator</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -357,22 +234,6 @@ public interface EnvironmentPackage extends EPackage { EReference ENVIRONMENT__PARENT_ENV = eINSTANCE.getEnvironment_ParentEnv(); /** - * The meta object literal for the '<em><b>Add Elements</b></em>' operation. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - EOperation ENVIRONMENT___ADD_ELEMENTS__ELIST = eINSTANCE.getEnvironment__AddElements__EList(); - - /** - * The meta object literal for the '<em><b>Add Element</b></em>' operation. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - EOperation ENVIRONMENT___ADD_ELEMENT__NAMEDELEMENT = eINSTANCE.getEnvironment__AddElement__NamedElement(); - - /** * The meta object literal for the '{@link example2.env.Env4CG <em>Env4 CG</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -383,22 +244,6 @@ public interface EnvironmentPackage extends EPackage { EClass ENV4_CG = eINSTANCE.getEnv4CG(); /** - * The meta object literal for the '<em><b>Has Final Result</b></em>' operation. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - EOperation ENV4_CG___HAS_FINAL_RESULT = eINSTANCE.getEnv4CG__HasFinalResult(); - - /** - * The meta object literal for the '<em><b>Get Evaluator</b></em>' operation. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - EOperation ENV4_CG___GET_EVALUATOR = eINSTANCE.getEnv4CG__GetEvaluator(); - - /** * The meta object literal for the '{@link org.eclipse.ocl.pivot.evaluation.Evaluator <em>Evaluator</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/EnvironmentTables.java b/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/EnvironmentTables.java new file mode 100644 index 000000000..b671e19c0 --- /dev/null +++ b/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/EnvironmentTables.java @@ -0,0 +1,363 @@ +/******************************************************************************* + ************************************************************************* + * This code is 100% auto-generated + * from: + * platform:/resource/org.eclipse.qvtd.build.cs2as.tests/src/org/eclipse/qvtd/build/cs2as/tests/models/example2/EnvExample2.ecore + * using: + * platform:/resource/org.eclipse.qvtd.build.cs2as.tests/src/org/eclipse/qvtd/build/cs2as/tests/models/example2/EnvExample2.genmodel + * org.eclipse.ocl.examples.codegen.oclinecore.OCLinEcoreTables + * + * Do not edit it. + *******************************************************************************/ +package example2.env; + +import example2.classes.ClassesPackage; +import example2.classes.ClassesTables; +import example2.env.EnvironmentPackage; +import example2.env.EnvironmentTables; +import org.eclipse.ocl.pivot.ParameterTypes; +import org.eclipse.ocl.pivot.TemplateParameters; +import org.eclipse.ocl.pivot.ids.ClassId; +import org.eclipse.ocl.pivot.ids.CollectionTypeId; +import org.eclipse.ocl.pivot.ids.IdManager; +import org.eclipse.ocl.pivot.ids.NsURIPackageId; +import org.eclipse.ocl.pivot.ids.PropertyId; +import org.eclipse.ocl.pivot.ids.TypeId; +import org.eclipse.ocl.pivot.internal.library.ecore.EcoreExecutorPackage; +import org.eclipse.ocl.pivot.internal.library.ecore.EcoreExecutorProperty; +import org.eclipse.ocl.pivot.internal.library.ecore.EcoreExecutorType; +import org.eclipse.ocl.pivot.internal.library.ecore.EcoreLibraryOppositeProperty; +import org.eclipse.ocl.pivot.internal.library.executor.ExecutorFragment; +import org.eclipse.ocl.pivot.internal.library.executor.ExecutorOperation; +import org.eclipse.ocl.pivot.internal.library.executor.ExecutorProperty; +import org.eclipse.ocl.pivot.internal.library.executor.ExecutorPropertyWithImplementation; +import org.eclipse.ocl.pivot.internal.library.executor.ExecutorSpecializedType; +import org.eclipse.ocl.pivot.internal.library.executor.ExecutorStandardLibrary; +import org.eclipse.ocl.pivot.oclstdlib.OCLstdlibTables; +import org.eclipse.ocl.pivot.utilities.TypeUtil; + +/** + * EnvironmentTables provides the dispatch tables for the env for use by the OCL dispatcher. + * + * In order to ensure correct static initialization, a top level class element must be accessed + * before any nested class element. Therefore an access to PACKAGE.getClass() is recommended. + */ +@SuppressWarnings("nls") +public class EnvironmentTables +{ + /** + * The package descriptor for the package. + */ + public static final /*@NonNull*/ EcoreExecutorPackage PACKAGE = new EcoreExecutorPackage(EnvironmentPackage.eINSTANCE); + + /** + * The library of all packages and types. + */ + public static final /*@NonNull*/ ExecutorStandardLibrary LIBRARY = OCLstdlibTables.LIBRARY; + + /** + * Constants used by auto-generated code. + */ + public static final /*@NonNull*/ /*@NonInvalid*/ NsURIPackageId PACKid_http_c_s_s_cs2as_s_tests_s_example2_s_classes_s_1_0 = IdManager.getNsURIPackageId("http://cs2as/tests/example2/classes/1.0", null, ClassesPackage.eINSTANCE); + public static final /*@NonNull*/ /*@NonInvalid*/ NsURIPackageId PACKid_http_c_s_s_cs2as_s_tests_s_example2_s_env_s_1_0 = IdManager.getNsURIPackageId("http://cs2as/tests/example2/env/1.0", null, EnvironmentPackage.eINSTANCE); + public static final /*@NonNull*/ /*@NonInvalid*/ ClassId CLSSid_Environment = EnvironmentTables.PACKid_http_c_s_s_cs2as_s_tests_s_example2_s_env_s_1_0.getClassId("Environment", 0); + public static final /*@NonNull*/ /*@NonInvalid*/ ClassId CLSSid_Evaluator = EnvironmentTables.PACKid_http_c_s_s_cs2as_s_tests_s_example2_s_env_s_1_0.getClassId("Evaluator", 0); + public static final /*@NonNull*/ /*@NonInvalid*/ ClassId CLSSid_NamedElement = EnvironmentTables.PACKid_http_c_s_s_cs2as_s_tests_s_example2_s_classes_s_1_0.getClassId("NamedElement", 0); + public static final /*@NonNull*/ /*@NonInvalid*/ CollectionTypeId BAG_CLSSid_Environment = TypeId.BAG.getSpecializedId(EnvironmentTables.CLSSid_Environment); + public static final /*@NonNull*/ /*@NonInvalid*/ CollectionTypeId COL_CLSSid_NamedElement = TypeId.COLLECTION.getSpecializedId(EnvironmentTables.CLSSid_NamedElement); + public static final /*@NonNull*/ /*@NonInvalid*/ CollectionTypeId ORD_CLSSid_NamedElement = TypeId.ORDERED_SET.getSpecializedId(EnvironmentTables.CLSSid_NamedElement); + public static final /*@NonNull*/ /*@NonInvalid*/ PropertyId PROPid_namedElements = EnvironmentTables.CLSSid_Environment.getPropertyId("namedElements"); + public static final /*@NonNull*/ /*@NonInvalid*/ PropertyId PROPid_parentEnv = EnvironmentTables.CLSSid_Environment.getPropertyId("parentEnv"); + public static final /*@NonNull*/ /*@NonInvalid*/ CollectionTypeId SEQ_CLSSid_NamedElement = TypeId.SEQUENCE.getSpecializedId(EnvironmentTables.CLSSid_NamedElement); + + /** + * The type parameters for templated types and operations. + */ + public static class TypeParameters { } + + /** + * The type descriptors for each type. + */ + public static class Types { + public static final /*@NonNull*/ EcoreExecutorType _Env4CG = new EcoreExecutorType(EnvironmentPackage.Literals.ENV4_CG, PACKAGE, 0); + public static final /*@NonNull*/ EcoreExecutorType _Environment = new EcoreExecutorType(EnvironmentPackage.Literals.ENVIRONMENT, PACKAGE, 0); + public static final /*@NonNull*/ EcoreExecutorType _Evaluator = new EcoreExecutorType(EnvironmentPackage.Literals.EVALUATOR, PACKAGE, 0); + + private static final /*@NonNull*/ EcoreExecutorType[] types = { + _Env4CG, + _Environment, + _Evaluator + }; + + /* + * Install the type descriptors in the package descriptor. + */ + static { + PACKAGE.init(LIBRARY, types); + TypeFragments.init(); + FragmentOperations.init(); + FragmentProperties.init(); + } + + public static void init() {} + } + + /** + * The fragment descriptors for the local elements of each type and its supertypes. + */ + public static class Fragments { + private static final /*@NonNull*/ ExecutorFragment _Env4CG__Env4CG = new ExecutorFragment(Types._Env4CG, EnvironmentTables.Types._Env4CG); + private static final /*@NonNull*/ ExecutorFragment _Env4CG__OclAny = new ExecutorFragment(Types._Env4CG, OCLstdlibTables.Types._OclAny); + private static final /*@NonNull*/ ExecutorFragment _Env4CG__OclElement = new ExecutorFragment(Types._Env4CG, OCLstdlibTables.Types._OclElement); + + private static final /*@NonNull*/ ExecutorFragment _Environment__Env4CG = new ExecutorFragment(Types._Environment, EnvironmentTables.Types._Env4CG); + private static final /*@NonNull*/ ExecutorFragment _Environment__Environment = new ExecutorFragment(Types._Environment, EnvironmentTables.Types._Environment); + private static final /*@NonNull*/ ExecutorFragment _Environment__OclAny = new ExecutorFragment(Types._Environment, OCLstdlibTables.Types._OclAny); + private static final /*@NonNull*/ ExecutorFragment _Environment__OclElement = new ExecutorFragment(Types._Environment, OCLstdlibTables.Types._OclElement); + + private static final /*@NonNull*/ ExecutorFragment _Evaluator__Evaluator = new ExecutorFragment(Types._Evaluator, EnvironmentTables.Types._Evaluator); + private static final /*@NonNull*/ ExecutorFragment _Evaluator__OclAny = new ExecutorFragment(Types._Evaluator, OCLstdlibTables.Types._OclAny); + private static final /*@NonNull*/ ExecutorFragment _Evaluator__OclElement = new ExecutorFragment(Types._Evaluator, OCLstdlibTables.Types._OclElement); + + /* + * Force initialization. + */ + public static void init() { + Types.init(); + } + } + + /** + * The parameter lists shared by operations. + */ + public static class Parameters { + public static final /*@NonNull*/ ParameterTypes _ = TypeUtil.createParameterTypes(); + public static final /*@NonNull*/ ParameterTypes _NamedElement = TypeUtil.createParameterTypes(ClassesTables.Types._NamedElement); + public static final /*@NonNull*/ ParameterTypes _OrderedSet__NamedElement__ = TypeUtil.createParameterTypes(new ExecutorSpecializedType("OrderedSet", ClassesTables.Types._NamedElement)); + } + + /** + * The operation descriptors for each operation of each type. + */ + public static class Operations { + public static final /*@NonNull*/ ExecutorOperation _Env4CG__getEvaluator = new ExecutorOperation("getEvaluator", Parameters._, Types._Env4CG, + 0, TemplateParameters.EMPTY_LIST, null); + public static final /*@NonNull*/ ExecutorOperation _Env4CG__hasFinalResult = new ExecutorOperation("hasFinalResult", Parameters._, Types._Env4CG, + 1, TemplateParameters.EMPTY_LIST, null); + + public static final /*@NonNull*/ ExecutorOperation _Environment__addElement = new ExecutorOperation("addElement", Parameters._NamedElement, Types._Environment, + 0, TemplateParameters.EMPTY_LIST, null); + public static final /*@NonNull*/ ExecutorOperation _Environment__addElements = new ExecutorOperation("addElements", Parameters._OrderedSet__NamedElement__, Types._Environment, + 1, TemplateParameters.EMPTY_LIST, null); + + } + + /** + * The property descriptors for each property of each type. + */ + public static class Properties { + + public static final /*@NonNull*/ ExecutorProperty _Environment__namedElements = new EcoreExecutorProperty(EnvironmentPackage.Literals.ENVIRONMENT__NAMED_ELEMENTS, Types._Environment, 0); + public static final /*@NonNull*/ ExecutorProperty _Environment__parentEnv = new EcoreExecutorProperty(EnvironmentPackage.Literals.ENVIRONMENT__PARENT_ENV, Types._Environment, 1); + public static final /*@NonNull*/ ExecutorProperty _Environment__Environment__parentEnv = new ExecutorPropertyWithImplementation("Environment", Types._Environment, 2, new EcoreLibraryOppositeProperty(EnvironmentPackage.Literals.ENVIRONMENT__PARENT_ENV)); + + /* + * Force initialization. + */ + public static void init() { + Types.init(); + } + } + + /** + * The fragments for all base types in depth order: OclAny first, OclSelf last. + */ + public static class TypeFragments { + private static final /*@NonNull*/ ExecutorFragment[] _Env4CG = + { + Fragments._Env4CG__OclAny /* 0 */, + Fragments._Env4CG__OclElement /* 1 */, + Fragments._Env4CG__Env4CG /* 2 */ + }; + private static final /*@NonNull*/ int[] __Env4CG = { 1,1,1 }; + + private static final /*@NonNull*/ ExecutorFragment[] _Environment = + { + Fragments._Environment__OclAny /* 0 */, + Fragments._Environment__OclElement /* 1 */, + Fragments._Environment__Env4CG /* 2 */, + Fragments._Environment__Environment /* 3 */ + }; + private static final /*@NonNull*/ int[] __Environment = { 1,1,1,1 }; + + private static final /*@NonNull*/ ExecutorFragment[] _Evaluator = + { + Fragments._Evaluator__OclAny /* 0 */, + Fragments._Evaluator__OclElement /* 1 */, + Fragments._Evaluator__Evaluator /* 2 */ + }; + private static final /*@NonNull*/ int[] __Evaluator = { 1,1,1 }; + + /** + * Install the fragment descriptors in the class descriptors. + */ + public static void init() { + Fragments.init(); + Properties.init(); + + Types._Env4CG.initFragments(_Env4CG, __Env4CG); + Types._Environment.initFragments(_Environment, __Environment); + Types._Evaluator.initFragments(_Evaluator, __Evaluator); + } + } + + /** + * The lists of local operations or local operation overrides for each fragment of each type. + */ + public static class FragmentOperations { + private static final /*@NonNull*/ ExecutorOperation[] _Env4CG__Env4CG = { + EnvironmentTables.Operations._Env4CG__getEvaluator /* getEvaluator() */, + EnvironmentTables.Operations._Env4CG__hasFinalResult /* hasFinalResult() */ + }; + private static final /*@NonNull*/ ExecutorOperation[] _Env4CG__OclAny = { + OCLstdlibTables.Operations._OclAny___lt__gt_ /* _'<>'(OclSelf) */, + OCLstdlibTables.Operations._OclAny___eq_ /* _'='(OclSelf) */, + OCLstdlibTables.Operations._OclAny__oclAsSet /* oclAsSet() */, + OCLstdlibTables.Operations._OclAny__oclAsType /* oclAsType(TT)(TT) */, + OCLstdlibTables.Operations._OclAny__oclIsInState /* oclIsInState(OclState) */, + OCLstdlibTables.Operations._OclAny__oclIsInvalid /* oclIsInvalid() */, + OCLstdlibTables.Operations._OclAny__oclIsKindOf /* oclIsKindOf(OclType) */, + OCLstdlibTables.Operations._OclAny__oclIsNew /* oclIsNew() */, + OCLstdlibTables.Operations._OclAny__oclIsTypeOf /* oclIsTypeOf(OclType) */, + OCLstdlibTables.Operations._OclAny__oclIsUndefined /* oclIsUndefined() */, + OCLstdlibTables.Operations._OclAny__0_oclLog /* oclLog() */, + OCLstdlibTables.Operations._OclAny__1_oclLog /* oclLog(String) */, + OCLstdlibTables.Operations._OclAny__oclType /* oclType() */, + OCLstdlibTables.Operations._OclAny__toString /* toString() */ + }; + private static final /*@NonNull*/ ExecutorOperation[] _Env4CG__OclElement = { + OCLstdlibTables.Operations._OclElement__allInstances /* allInstances() */, + OCLstdlibTables.Operations._OclElement__oclContainer /* oclContainer() */, + OCLstdlibTables.Operations._OclElement__oclContents /* oclContents() */ + }; + + private static final /*@NonNull*/ ExecutorOperation[] _Environment__Environment = { + EnvironmentTables.Operations._Environment__addElement /* addElement(NamedElement[?]) */, + EnvironmentTables.Operations._Environment__addElements /* addElements(OrderedSet(classes::NamedElement)) */ + }; + private static final /*@NonNull*/ ExecutorOperation[] _Environment__Env4CG = { + EnvironmentTables.Operations._Env4CG__getEvaluator /* getEvaluator() */, + EnvironmentTables.Operations._Env4CG__hasFinalResult /* hasFinalResult() */ + }; + private static final /*@NonNull*/ ExecutorOperation[] _Environment__OclAny = { + OCLstdlibTables.Operations._OclAny___lt__gt_ /* _'<>'(OclSelf) */, + OCLstdlibTables.Operations._OclAny___eq_ /* _'='(OclSelf) */, + OCLstdlibTables.Operations._OclAny__oclAsSet /* oclAsSet() */, + OCLstdlibTables.Operations._OclAny__oclAsType /* oclAsType(TT)(TT) */, + OCLstdlibTables.Operations._OclAny__oclIsInState /* oclIsInState(OclState) */, + OCLstdlibTables.Operations._OclAny__oclIsInvalid /* oclIsInvalid() */, + OCLstdlibTables.Operations._OclAny__oclIsKindOf /* oclIsKindOf(OclType) */, + OCLstdlibTables.Operations._OclAny__oclIsNew /* oclIsNew() */, + OCLstdlibTables.Operations._OclAny__oclIsTypeOf /* oclIsTypeOf(OclType) */, + OCLstdlibTables.Operations._OclAny__oclIsUndefined /* oclIsUndefined() */, + OCLstdlibTables.Operations._OclAny__0_oclLog /* oclLog() */, + OCLstdlibTables.Operations._OclAny__1_oclLog /* oclLog(String) */, + OCLstdlibTables.Operations._OclAny__oclType /* oclType() */, + OCLstdlibTables.Operations._OclAny__toString /* toString() */ + }; + private static final /*@NonNull*/ ExecutorOperation[] _Environment__OclElement = { + OCLstdlibTables.Operations._OclElement__allInstances /* allInstances() */, + OCLstdlibTables.Operations._OclElement__oclContainer /* oclContainer() */, + OCLstdlibTables.Operations._OclElement__oclContents /* oclContents() */ + }; + + private static final /*@NonNull*/ ExecutorOperation[] _Evaluator__Evaluator = {}; + private static final /*@NonNull*/ ExecutorOperation[] _Evaluator__OclAny = { + OCLstdlibTables.Operations._OclAny___lt__gt_ /* _'<>'(OclSelf) */, + OCLstdlibTables.Operations._OclAny___eq_ /* _'='(OclSelf) */, + OCLstdlibTables.Operations._OclAny__oclAsSet /* oclAsSet() */, + OCLstdlibTables.Operations._OclAny__oclAsType /* oclAsType(TT)(TT) */, + OCLstdlibTables.Operations._OclAny__oclIsInState /* oclIsInState(OclState) */, + OCLstdlibTables.Operations._OclAny__oclIsInvalid /* oclIsInvalid() */, + OCLstdlibTables.Operations._OclAny__oclIsKindOf /* oclIsKindOf(OclType) */, + OCLstdlibTables.Operations._OclAny__oclIsNew /* oclIsNew() */, + OCLstdlibTables.Operations._OclAny__oclIsTypeOf /* oclIsTypeOf(OclType) */, + OCLstdlibTables.Operations._OclAny__oclIsUndefined /* oclIsUndefined() */, + OCLstdlibTables.Operations._OclAny__0_oclLog /* oclLog() */, + OCLstdlibTables.Operations._OclAny__1_oclLog /* oclLog(String) */, + OCLstdlibTables.Operations._OclAny__oclType /* oclType() */, + OCLstdlibTables.Operations._OclAny__toString /* toString() */ + }; + private static final /*@NonNull*/ ExecutorOperation[] _Evaluator__OclElement = { + OCLstdlibTables.Operations._OclElement__allInstances /* allInstances() */, + OCLstdlibTables.Operations._OclElement__oclContainer /* oclContainer() */, + OCLstdlibTables.Operations._OclElement__oclContents /* oclContents() */ + }; + + /* + * Install the operation descriptors in the fragment descriptors. + */ + public static void init() { + TypeFragments.init(); + + Fragments._Env4CG__Env4CG.initOperations(_Env4CG__Env4CG); + Fragments._Env4CG__OclAny.initOperations(_Env4CG__OclAny); + Fragments._Env4CG__OclElement.initOperations(_Env4CG__OclElement); + + Fragments._Environment__Env4CG.initOperations(_Environment__Env4CG); + Fragments._Environment__Environment.initOperations(_Environment__Environment); + Fragments._Environment__OclAny.initOperations(_Environment__OclAny); + Fragments._Environment__OclElement.initOperations(_Environment__OclElement); + + Fragments._Evaluator__Evaluator.initOperations(_Evaluator__Evaluator); + Fragments._Evaluator__OclAny.initOperations(_Evaluator__OclAny); + Fragments._Evaluator__OclElement.initOperations(_Evaluator__OclElement); + } + } + + /** + * The lists of local properties for the local fragment of each type. + */ + public static class FragmentProperties { + private static final /*@NonNull*/ ExecutorProperty[] _Env4CG = {}; + + private static final /*@NonNull*/ ExecutorProperty[] _Environment = { + EnvironmentTables.Properties._Environment__namedElements, + EnvironmentTables.Properties._Environment__parentEnv, + EnvironmentTables.Properties._Environment__Environment__parentEnv + }; + + private static final /*@NonNull*/ ExecutorProperty[] _Evaluator = {}; + + /** + * Install the property descriptors in the fragment descriptors. + */ + public static void init() { + TypeFragments.init(); + + Fragments._Env4CG__Env4CG.initProperties(_Env4CG); + Fragments._Environment__Environment.initProperties(_Environment); + Fragments._Evaluator__Evaluator.initProperties(_Evaluator); + } + } + + /** + * The lists of enumeration literals for each enumeration. + */ + public static class EnumerationLiterals { + /** + * Install the enumeration literals in the enumerations. + */ + static { + } + + public static void init() {} + } + + /* + * Force initialization. + */ + static { + Types.init(); + } +} diff --git a/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/impl/EnvironmentFactoryImpl.java b/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/impl/EnvironmentFactoryImpl.java index a21e673aa..b9ab1f2b8 100644 --- a/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/impl/EnvironmentFactoryImpl.java +++ b/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/impl/EnvironmentFactoryImpl.java @@ -7,7 +7,6 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.impl.EFactoryImpl; import org.eclipse.emf.ecore.plugin.EcorePlugin; - import example2.env.Environment; import example2.env.EnvironmentFactory; import example2.env.EnvironmentPackage; diff --git a/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/impl/EnvironmentImpl.java b/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/impl/EnvironmentImpl.java index 7d4a32234..3e8eca9a8 100644 --- a/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/impl/EnvironmentImpl.java +++ b/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/impl/EnvironmentImpl.java @@ -2,9 +2,8 @@ */ package example2.env.impl; -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.util.EList; import org.eclipse.emf.ecore.EClass; @@ -12,11 +11,21 @@ import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.ocl.pivot.Property; import org.eclipse.ocl.pivot.evaluation.Evaluator; - +import org.eclipse.ocl.pivot.ids.IdResolver; +import org.eclipse.ocl.pivot.internal.utilities.PivotUtilInternal; +import org.eclipse.ocl.pivot.library.collection.CollectionAsSequenceOperation; +import org.eclipse.ocl.pivot.library.collection.CollectionIncludingAllOperation; +import org.eclipse.ocl.pivot.library.collection.CollectionIncludingOperation; +import org.eclipse.ocl.pivot.utilities.ClassUtil; +import org.eclipse.ocl.pivot.values.CollectionValue; +import org.eclipse.ocl.pivot.values.OrderedSetValue; +import org.eclipse.ocl.pivot.values.SequenceValue; import example2.classes.NamedElement; import example2.env.Environment; import example2.env.EnvironmentPackage; +import example2.env.EnvironmentTables; /** * <!-- begin-user-doc --> @@ -127,10 +136,29 @@ public class EnvironmentImpl extends MinimalEObjectImpl.Container implements Env * <!-- end-user-doc --> * @generated */ - public Environment addElements(EList<NamedElement> elements) { - // TODO: implement this method - // Ensure that you remove @generated or mark it @generated NOT - throw new UnsupportedOperationException(); + public Environment addElements(final EList<NamedElement> elements) { + /** + * Environment{ + * namedElements = namedElements->asSequence() + * ->includingAll(elements), parentEnv = parentEnv} + */ + final /*@NonNull*/ /*@NonInvalid*/ Evaluator evaluator = PivotUtilInternal.getEvaluator(this); + final /*@NonNull*/ /*@NonInvalid*/ IdResolver idResolver = evaluator.getIdResolver(); + final /*@NonNull*/ /*@NonInvalid*/ Property CTORid_namedElements = idResolver.getProperty(EnvironmentTables.PROPid_namedElements); + final /*@NonNull*/ /*@NonInvalid*/ Property CTORid_parentEnv = idResolver.getProperty(EnvironmentTables.PROPid_parentEnv); + final /*@NonNull*/ /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_env_c_c_Environment_0 = idResolver.getClass(EnvironmentTables.CLSSid_Environment, null); + final /*@NonNull*/ /*@Thrown*/ Environment symbol_0 = (Environment)TYP_env_c_c_Environment_0.createInstance(); + final /*@NonNull*/ /*@Thrown*/ List<NamedElement> namedElements = this.getNamedElements(); + final /*@NonNull*/ /*@Thrown*/ OrderedSetValue BOXED_namedElements = idResolver.createOrderedSetOfAll(EnvironmentTables.ORD_CLSSid_NamedElement, namedElements); + final /*@NonNull*/ /*@Thrown*/ SequenceValue asSequence = ClassUtil.nonNullState(CollectionAsSequenceOperation.INSTANCE.evaluate(BOXED_namedElements)); + final /*@NonNull*/ /*@NonInvalid*/ OrderedSetValue BOXED_elements = idResolver.createOrderedSetOfAll(EnvironmentTables.ORD_CLSSid_NamedElement, elements); + final /*@NonNull*/ /*@Thrown*/ CollectionValue includingAll = ClassUtil.nonNullState(CollectionIncludingAllOperation.INSTANCE.evaluate(asSequence, BOXED_elements)); + final List<NamedElement> UNBOXED_includingAll = includingAll.asEcoreObjects(idResolver, example2.classes.NamedElement.class); + assert UNBOXED_includingAll != null; + CTORid_namedElements.initValue(symbol_0, UNBOXED_includingAll); + final /*@Nullable*/ /*@Thrown*/ Environment parentEnv = this.getParentEnv(); + CTORid_parentEnv.initValue(symbol_0, parentEnv); + return (Environment)symbol_0; } /** @@ -138,10 +166,28 @@ public class EnvironmentImpl extends MinimalEObjectImpl.Container implements Env * <!-- end-user-doc --> * @generated */ - public Environment addElement(NamedElement element) { - // TODO: implement this method - // Ensure that you remove @generated or mark it @generated NOT - throw new UnsupportedOperationException(); + public Environment addElement(final NamedElement element) { + /** + * Environment{ + * namedElements = namedElements->asSequence() + * ->including(element), parentEnv = parentEnv} + */ + final /*@NonNull*/ /*@NonInvalid*/ Evaluator evaluator = PivotUtilInternal.getEvaluator(this); + final /*@NonNull*/ /*@NonInvalid*/ IdResolver idResolver = evaluator.getIdResolver(); + final /*@NonNull*/ /*@NonInvalid*/ Property CTORid_namedElements = idResolver.getProperty(EnvironmentTables.PROPid_namedElements); + final /*@NonNull*/ /*@NonInvalid*/ Property CTORid_parentEnv = idResolver.getProperty(EnvironmentTables.PROPid_parentEnv); + final /*@NonNull*/ /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_env_c_c_Environment_0 = idResolver.getClass(EnvironmentTables.CLSSid_Environment, null); + final /*@NonNull*/ /*@Thrown*/ Environment symbol_0 = (Environment)TYP_env_c_c_Environment_0.createInstance(); + final /*@NonNull*/ /*@Thrown*/ List<NamedElement> namedElements = this.getNamedElements(); + final /*@NonNull*/ /*@Thrown*/ OrderedSetValue BOXED_namedElements = idResolver.createOrderedSetOfAll(EnvironmentTables.ORD_CLSSid_NamedElement, namedElements); + final /*@NonNull*/ /*@Thrown*/ SequenceValue asSequence = ClassUtil.nonNullState(CollectionAsSequenceOperation.INSTANCE.evaluate(BOXED_namedElements)); + final /*@NonNull*/ /*@Thrown*/ SequenceValue including = ClassUtil.nonNullState((SequenceValue)CollectionIncludingOperation.INSTANCE.evaluate(asSequence, element)); + final List<NamedElement> UNBOXED_including = including.asEcoreObjects(idResolver, example2.classes.NamedElement.class); + assert UNBOXED_including != null; + CTORid_namedElements.initValue(symbol_0, UNBOXED_including); + final /*@Nullable*/ /*@Thrown*/ Environment parentEnv = this.getParentEnv(); + CTORid_parentEnv.initValue(symbol_0, parentEnv); + return (Environment)symbol_0; } /** @@ -150,7 +196,7 @@ public class EnvironmentImpl extends MinimalEObjectImpl.Container implements Env * @generated */ public boolean hasFinalResult() { - throw new UnsupportedOperationException("Enviroment::hasFinalResult() has been created for CG purposes. Don't call this method"); + throw new UnsupportedOperationException(); // FIXME Unimplemented http://cs2as/tests/example2/env/1.0!Env4CG!hasFinalResult() } /** @@ -159,7 +205,7 @@ public class EnvironmentImpl extends MinimalEObjectImpl.Container implements Env * @generated */ public Evaluator getEvaluator() { - throw new UnsupportedOperationException("Enviroment::getEvaluator() has been created for CG purposes. Don't call this method"); + throw new UnsupportedOperationException(); // FIXME Unimplemented http://cs2as/tests/example2/env/1.0!Env4CG!getEvaluator() } /** @@ -233,27 +279,6 @@ public class EnvironmentImpl extends MinimalEObjectImpl.Container implements Env return super.eIsSet(featureID); } - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - @SuppressWarnings("unchecked") - public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException { - switch (operationID) { - case EnvironmentPackage.ENVIRONMENT___ADD_ELEMENTS__ELIST: - return addElements((EList<NamedElement>)arguments.get(0)); - case EnvironmentPackage.ENVIRONMENT___ADD_ELEMENT__NAMEDELEMENT: - return addElement((NamedElement)arguments.get(0)); - case EnvironmentPackage.ENVIRONMENT___HAS_FINAL_RESULT: - return hasFinalResult(); - case EnvironmentPackage.ENVIRONMENT___GET_EVALUATOR: - return getEvaluator(); - } - return super.eInvoke(operationID, arguments); - } - diff --git a/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/impl/EnvironmentPackageImpl.java b/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/impl/EnvironmentPackageImpl.java index 7fd4e5eee..49f4500da 100644 --- a/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/impl/EnvironmentPackageImpl.java +++ b/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/impl/EnvironmentPackageImpl.java @@ -139,24 +139,6 @@ public class EnvironmentPackageImpl extends EPackageImpl implements EnvironmentP * <!-- end-user-doc --> * @generated */ - public EOperation getEnvironment__AddElements__EList() { - return environmentEClass.getEOperations().get(0); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EOperation getEnvironment__AddElement__NamedElement() { - return environmentEClass.getEOperations().get(1); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ public EClass getEnv4CG() { return env4CGEClass; } @@ -166,24 +148,6 @@ public class EnvironmentPackageImpl extends EPackageImpl implements EnvironmentP * <!-- end-user-doc --> * @generated */ - public EOperation getEnv4CG__HasFinalResult() { - return env4CGEClass.getEOperations().get(0); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EOperation getEnv4CG__GetEvaluator() { - return env4CGEClass.getEOperations().get(1); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ public EClass getEvaluator() { return evaluatorEClass; } @@ -219,12 +183,8 @@ public class EnvironmentPackageImpl extends EPackageImpl implements EnvironmentP environmentEClass = createEClass(ENVIRONMENT); createEReference(environmentEClass, ENVIRONMENT__NAMED_ELEMENTS); createEReference(environmentEClass, ENVIRONMENT__PARENT_ENV); - createEOperation(environmentEClass, ENVIRONMENT___ADD_ELEMENTS__ELIST); - createEOperation(environmentEClass, ENVIRONMENT___ADD_ELEMENT__NAMEDELEMENT); env4CGEClass = createEClass(ENV4_CG); - createEOperation(env4CGEClass, ENV4_CG___HAS_FINAL_RESULT); - createEOperation(env4CGEClass, ENV4_CG___GET_EVALUATOR); evaluatorEClass = createEClass(EVALUATOR); } @@ -262,27 +222,64 @@ public class EnvironmentPackageImpl extends EPackageImpl implements EnvironmentP // Add supertypes to classes environmentEClass.getESuperTypes().add(this.getEnv4CG()); - // Initialize classes, features, and operations; add parameters + // Initialize classes and features; add operations and parameters initEClass(environmentEClass, Environment.class, "Environment", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getEnvironment_NamedElements(), theClassesPackage.getNamedElement(), null, "namedElements", null, 0, -1, Environment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getEnvironment_ParentEnv(), this.getEnvironment(), null, "parentEnv", null, 0, 1, Environment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - EOperation op = initEOperation(getEnvironment__AddElements__EList(), this.getEnvironment(), "addElements", 0, 1, IS_UNIQUE, IS_ORDERED); + EOperation op = addEOperation(environmentEClass, this.getEnvironment(), "addElements", 0, 1, IS_UNIQUE, IS_ORDERED); addEParameter(op, theClassesPackage.getNamedElement(), "elements", 0, -1, IS_UNIQUE, IS_ORDERED); - op = initEOperation(getEnvironment__AddElement__NamedElement(), this.getEnvironment(), "addElement", 0, 1, IS_UNIQUE, IS_ORDERED); + op = addEOperation(environmentEClass, this.getEnvironment(), "addElement", 0, 1, IS_UNIQUE, IS_ORDERED); addEParameter(op, theClassesPackage.getNamedElement(), "element", 0, 1, IS_UNIQUE, IS_ORDERED); initEClass(env4CGEClass, Env4CG.class, "Env4CG", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEOperation(getEnv4CG__HasFinalResult(), ecorePackage.getEBoolean(), "hasFinalResult", 0, 1, IS_UNIQUE, IS_ORDERED); + addEOperation(env4CGEClass, ecorePackage.getEBoolean(), "hasFinalResult", 0, 1, IS_UNIQUE, IS_ORDERED); - initEOperation(getEnv4CG__GetEvaluator(), this.getEvaluator(), "getEvaluator", 0, 1, IS_UNIQUE, IS_ORDERED); + addEOperation(env4CGEClass, this.getEvaluator(), "getEvaluator", 0, 1, IS_UNIQUE, IS_ORDERED); initEClass(evaluatorEClass, Evaluator.class, "Evaluator", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); // Create resource createResource(eNS_URI); + + // Create annotations + // http://www.eclipse.org/OCL/Import + createImportAnnotations(); + // http://www.eclipse.org/emf/2002/Ecore + createEcoreAnnotations(); + } + + /** + * Initializes the annotations for <b>http://www.eclipse.org/OCL/Import</b>. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void createImportAnnotations() { + String source = "http://www.eclipse.org/OCL/Import"; + addAnnotation + (this, + source, + new String[] { + "classes", "Classes.ecore#/" + }); + } + + /** + * Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore</b>. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void createEcoreAnnotations() { + String source = "http://www.eclipse.org/emf/2002/Ecore"; + addAnnotation + (this, + source, + new String[] { + }); } } //EnvironmentPackageImpl diff --git a/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/util/EnvironmentAdapterFactory.java b/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/util/EnvironmentAdapterFactory.java index 98f552d25..3412993a1 100644 --- a/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/util/EnvironmentAdapterFactory.java +++ b/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/util/EnvironmentAdapterFactory.java @@ -7,7 +7,6 @@ import org.eclipse.emf.common.notify.Notifier; import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; import org.eclipse.emf.ecore.EObject; import org.eclipse.ocl.pivot.evaluation.Evaluator; - import example2.env.Env4CG; import example2.env.Environment; import example2.env.EnvironmentPackage; diff --git a/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/util/EnvironmentSwitch.java b/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/util/EnvironmentSwitch.java index b517c6ce8..6c1480b62 100644 --- a/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/util/EnvironmentSwitch.java +++ b/tests/org.eclipse.qvtd.build.cs2as.tests/tests-gen/example2/env/util/EnvironmentSwitch.java @@ -6,7 +6,6 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.util.Switch; import org.eclipse.ocl.pivot.evaluation.Evaluator; - import example2.env.Env4CG; import example2.env.Environment; import example2.env.EnvironmentPackage; |