diff options
author | Ed Willink | 2015-07-12 14:04:48 +0000 |
---|---|---|
committer | Ed Willink | 2015-07-12 14:04:48 +0000 |
commit | 733a0f698eece0a59d422db51ba324449f17e1b9 (patch) | |
tree | 242c700bc021a2093af54c41fbe2b321d4ac0983 | |
parent | e171dbe7fb3ef8021e6217b9bc31bb0128d702ba (diff) | |
download | org.eclipse.qvtd-733a0f698eece0a59d422db51ba324449f17e1b9.tar.gz org.eclipse.qvtd-733a0f698eece0a59d422db51ba324449f17e1b9.tar.xz org.eclipse.qvtd-733a0f698eece0a59d422db51ba324449f17e1b9.zip |
[397429] Restore local QVTiTxHelper
3 files changed, 35 insertions, 2 deletions
diff --git a/plugins/org.eclipse.qvtd.cs2as.build/META-INF/MANIFEST.MF b/plugins/org.eclipse.qvtd.cs2as.build/META-INF/MANIFEST.MF index 34f302c3c..62f903ed6 100644 --- a/plugins/org.eclipse.qvtd.cs2as.build/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.qvtd.cs2as.build/META-INF/MANIFEST.MF @@ -8,5 +8,6 @@ Require-Bundle: org.eclipse.emf.mwe.core;bundle-version="[1.3.10,2.0.0)", org.eclipse.emf.mwe.utils;bundle-version="[1.3.10,2.0.0)", org.eclipse.ocl.examples.build;bundle-version="[2.1.0,2.2.0)", org.eclipse.qvtd.cs2as.compiler;bundle-version="[0.13.0,0.14.0)", - org.eclipse.emf.codegen.ecore;bundle-version="[2.7.0,3.0.0)" + org.eclipse.emf.codegen.ecore;bundle-version="[2.7.0,3.0.0)", + org.eclipse.ocl.pivot;bundle-version="[1.1.0,2.0.0)" Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/OCL2QVTiTestCases.java b/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/OCL2QVTiTestCases.java index 975d7f11c..e9b0428f7 100644 --- a/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/OCL2QVTiTestCases.java +++ b/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/OCL2QVTiTestCases.java @@ -45,7 +45,6 @@ import org.eclipse.qvtd.cs2as.compiler.CS2ASJavaCompilerParameters; import org.eclipse.qvtd.cs2as.compiler.internal.CS2ASJavaCompilerImpl; import org.eclipse.qvtd.cs2as.compiler.internal.CS2ASJavaCompilerParametersImpl; import org.eclipse.qvtd.cs2as.compiler.internal.OCL2QVTiBroker; -import org.eclipse.qvtd.cs2as.runtime.QVTiTxHelper; import org.eclipse.qvtd.pivot.qvtbase.QVTbasePackage; import org.eclipse.qvtd.pivot.qvtbase.Transformation; import org.eclipse.qvtd.pivot.qvtcorebase.QVTcoreBasePackage; diff --git a/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/QVTiTxHelper.java b/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/QVTiTxHelper.java new file mode 100644 index 000000000..c2985623f --- /dev/null +++ b/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/QVTiTxHelper.java @@ -0,0 +1,33 @@ +package org.eclipse.qvtd.cs2as.compiler.tests; + +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.ocl.pivot.evaluation.tx.TransformationExecutor; +import org.eclipse.ocl.pivot.evaluation.tx.Transformer; +import org.eclipse.qvtd.pivot.qvtbase.Transformation; +import org.eclipse.qvtd.pivot.qvtimperative.evaluation.BasicQVTiExecutor; +import org.eclipse.qvtd.pivot.qvtimperative.evaluation.QVTiEnvironmentFactory; +import org.eclipse.qvtd.pivot.qvtimperative.evaluation.QVTiTransformationExecutor; +import org.eclipse.qvtd.pivot.qvtimperative.utilities.QVTimperative; + +public class QVTiTxHelper { + + final private QVTimperative qvti; + + public QVTiTxHelper(@NonNull QVTimperative qvti) { + this.qvti = qvti; + } + + private @NonNull QVTiEnvironmentFactory getEnvironmentFactory() { + return (QVTiEnvironmentFactory) qvti.getEnvironmentFactory(); + } + + public @NonNull BasicQVTiExecutor createExecutor(Transformation transformation) { + return new BasicQVTiExecutor(getEnvironmentFactory(), transformation); + } + + // FIXME why do we need this ? + public @NonNull TransformationExecutor createTxEvaluator(Class<? extends Transformer> txClass) throws ReflectiveOperationException { + return new QVTiTransformationExecutor(getEnvironmentFactory(), txClass); + } + +} |