Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdolfo SBH2015-05-05 17:17:01 +0000
committerAdolfo SBH2015-05-08 10:01:36 +0000
commit75029c66fad6a0c305e7cac86b9d4e592e9ef513 (patch)
tree54dda5da3e9cf79a3b9685fc658633b866fcf94d
parentf292306f3b4237c6bb97a1af4e8d0fb980603319 (diff)
downloadorg.eclipse.qvtd-75029c66fad6a0c305e7cac86b9d4e592e9ef513.tar.gz
org.eclipse.qvtd-75029c66fad6a0c305e7cac86b9d4e592e9ef513.tar.xz
org.eclipse.qvtd-75029c66fad6a0c305e7cac86b9d4e592e9ef513.zip
[445105] - Fix for QVTbase/QVTimperative facades
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/utilities/QVTbase.java15
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/utilities/QVTbaseEnvironmentFactory.java18
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiEnvironmentFactory.java4
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperative.java17
4 files changed, 35 insertions, 19 deletions
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/utilities/QVTbase.java b/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/utilities/QVTbase.java
index aa170d279..b642e3512 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/utilities/QVTbase.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/utilities/QVTbase.java
@@ -13,11 +13,8 @@ package org.eclipse.qvtd.pivot.qvtbase.utilities;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.ocl.pivot.internal.resource.ASResourceFactoryRegistry;
-import org.eclipse.ocl.pivot.internal.utilities.EnvironmentFactoryInternal;
import org.eclipse.ocl.pivot.internal.utilities.OCLInternal;
import org.eclipse.ocl.pivot.resource.ProjectManager;
-import org.eclipse.qvtd.pivot.qvtbase.model.QVTbaseLibrary;
/**
* The QVTbase facade refines the OCL facade to enforce use of the QVTbase Standard Library.
@@ -25,16 +22,20 @@ import org.eclipse.qvtd.pivot.qvtbase.model.QVTbaseLibrary;
public class QVTbase extends OCLInternal
{
public static @NonNull QVTbase newInstance(@NonNull ProjectManager projectManager, @Nullable ResourceSet externalResourceSet) {
- EnvironmentFactoryInternal environmentFactory = ASResourceFactoryRegistry.INSTANCE.createEnvironmentFactory(projectManager, externalResourceSet);
- environmentFactory.getStandardLibrary().setDefaultStandardLibraryURI(QVTbaseLibrary.STDLIB_URI);
+ QVTbaseEnvironmentFactory environmentFactory = new QVTbaseEnvironmentFactory(projectManager, externalResourceSet);
QVTbase qvt = new QVTbase(environmentFactory);
if (externalResourceSet != null) {
environmentFactory.adapt(externalResourceSet);
}
return qvt;
}
-
- public QVTbase(@NonNull EnvironmentFactoryInternal environmentFactory) {
+
+ public QVTbase(@NonNull QVTbaseEnvironmentFactory environmentFactory) {
super(environmentFactory);
}
+
+ @Override
+ public @NonNull QVTbaseEnvironmentFactory getEnvironmentFactory() {
+ return (QVTbaseEnvironmentFactory)super.getEnvironmentFactory();
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/utilities/QVTbaseEnvironmentFactory.java b/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/utilities/QVTbaseEnvironmentFactory.java
new file mode 100644
index 000000000..34f365ab0
--- /dev/null
+++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/utilities/QVTbaseEnvironmentFactory.java
@@ -0,0 +1,18 @@
+package org.eclipse.qvtd.pivot.qvtbase.utilities;
+
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.ocl.pivot.internal.utilities.PivotEnvironmentFactory;
+import org.eclipse.ocl.pivot.resource.ProjectManager;
+import org.eclipse.qvtd.pivot.qvtbase.model.QVTbaseLibrary;
+
+public class QVTbaseEnvironmentFactory extends PivotEnvironmentFactory {
+
+ public QVTbaseEnvironmentFactory(@NonNull ProjectManager projectManager,
+ @Nullable ResourceSet externalResourceSet) {
+ super(projectManager, externalResourceSet);
+ getStandardLibrary().setDefaultStandardLibraryURI(QVTbaseLibrary.STDLIB_URI);
+ }
+
+}
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiEnvironmentFactory.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiEnvironmentFactory.java
index f5d05922d..6a0a974a8 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiEnvironmentFactory.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiEnvironmentFactory.java
@@ -18,11 +18,11 @@ import org.eclipse.ocl.pivot.evaluation.EvaluationEnvironment;
import org.eclipse.ocl.pivot.evaluation.EvaluationVisitor;
import org.eclipse.ocl.pivot.evaluation.ModelManager;
import org.eclipse.ocl.pivot.resource.ProjectManager;
-import org.eclipse.ocl.pivot.utilities.AbstractEnvironmentFactory;
import org.eclipse.qvtd.pivot.qvtbase.Transformation;
+import org.eclipse.qvtd.pivot.qvtbase.utilities.QVTbaseEnvironmentFactory;
import org.eclipse.qvtd.pivot.qvtimperative.model.QVTimperativeLibrary;
-public class QVTiEnvironmentFactory extends AbstractEnvironmentFactory {
+public class QVTiEnvironmentFactory extends QVTbaseEnvironmentFactory {
public QVTiEnvironmentFactory(@NonNull ProjectManager projectMap, @Nullable ResourceSet externalResourceSet) {
super(projectMap, externalResourceSet);
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperative.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperative.java
index 5f24376f2..f01b05232 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperative.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperative.java
@@ -13,11 +13,9 @@ package org.eclipse.qvtd.pivot.qvtimperative.utilities;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.ocl.pivot.internal.resource.ASResourceFactoryRegistry;
-import org.eclipse.ocl.pivot.internal.utilities.EnvironmentFactoryInternal;
import org.eclipse.ocl.pivot.resource.ProjectManager;
import org.eclipse.qvtd.pivot.qvtbase.utilities.QVTbase;
-import org.eclipse.qvtd.pivot.qvtimperative.model.QVTimperativeLibrary;
+import org.eclipse.qvtd.pivot.qvtimperative.evaluation.QVTiEnvironmentFactory;
/**
* The QVTimperative facade refines the QVTbase and OCL facades to enforce use of the QVTimperative Standard Library.
@@ -25,8 +23,7 @@ import org.eclipse.qvtd.pivot.qvtimperative.model.QVTimperativeLibrary;
public class QVTimperative extends QVTbase
{
public static @NonNull QVTimperative newInstance(@NonNull ProjectManager projectManager, @Nullable ResourceSet externalResourceSet) {
- EnvironmentFactoryInternal environmentFactory = ASResourceFactoryRegistry.INSTANCE.createEnvironmentFactory(projectManager, externalResourceSet);
- environmentFactory.getStandardLibrary().setDefaultStandardLibraryURI(QVTimperativeLibrary.STDLIB_URI);
+ QVTiEnvironmentFactory environmentFactory = new QVTiEnvironmentFactory(projectManager, externalResourceSet);
QVTimperative qvt = new QVTimperative(environmentFactory);
if (externalResourceSet != null) {
environmentFactory.adapt(externalResourceSet);
@@ -34,12 +31,12 @@ public class QVTimperative extends QVTbase
return qvt;
}
- public QVTimperative(@NonNull EnvironmentFactoryInternal environmentFactory) {
+ public QVTimperative(@NonNull QVTiEnvironmentFactory environmentFactory) {
super(environmentFactory);
}
-// @Override
-// public @NonNull QVTiEnvironmentFactory getEnvironmentFactory() {
-// return (QVTiEnvironmentFactory) super.getEnvironmentFactory();
-// }
+ @Override
+ public @NonNull QVTiEnvironmentFactory getEnvironmentFactory() {
+ return (QVTiEnvironmentFactory) super.getEnvironmentFactory();
+ }
} \ No newline at end of file

Back to the top