[490539] Eliminate QVTi runtime - not needed for Neon
diff --git a/plugins/org.eclipse.ocl.pivot/.classpath b/plugins/org.eclipse.ocl.pivot/.classpath
index a5fa43f..af856a9 100644
--- a/plugins/org.eclipse.ocl.pivot/.classpath
+++ b/plugins/org.eclipse.ocl.pivot/.classpath
@@ -12,6 +12,5 @@
</classpathentry>
<classpathentry kind="src" path="emf-gen"/>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="src-gen"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/plugins/org.eclipse.ocl.pivot/META-INF/MANIFEST.MF b/plugins/org.eclipse.ocl.pivot/META-INF/MANIFEST.MF
index 1004807..af6316a 100644
--- a/plugins/org.eclipse.ocl.pivot/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.ocl.pivot/META-INF/MANIFEST.MF
@@ -14,7 +14,6 @@
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.eclipse.ocl.pivot,
org.eclipse.ocl.pivot.evaluation,
- org.eclipse.ocl.pivot.evaluation.tx;x-friends:="org.eclipse.ocl.xtext.base",
org.eclipse.ocl.pivot.ids,
org.eclipse.ocl.pivot.internal,
org.eclipse.ocl.pivot.internal.attributes,
@@ -27,7 +26,6 @@
org.eclipse.ocl.pivot.internal.ecore.es2as,
org.eclipse.ocl.pivot.internal.elements,
org.eclipse.ocl.pivot.internal.evaluation,
- org.eclipse.ocl.pivot.internal.evaluation.tx;x-friends:="org.eclipse.ocl.xtext.base",
org.eclipse.ocl.pivot.internal.executor,
org.eclipse.ocl.pivot.internal.helper,
org.eclipse.ocl.pivot.internal.ids,
@@ -56,12 +54,6 @@
org.eclipse.ocl.pivot.library.iterator,
org.eclipse.ocl.pivot.library.logical,
org.eclipse.ocl.pivot.library.map,
- org.eclipse.ocl.pivot.library.model;
- x-friends:="org.eclipse.ocl.xtext.base,
- org.eclipse.ocl.xtext.completeocl,
- org.eclipse.ocl.xtext.essentialocl,
- org.eclipse.ocl.xtext.oclinecore,
- org.eclipse.ocl.xtext.oclstdlib",
org.eclipse.ocl.pivot.library.numeric,
org.eclipse.ocl.pivot.library.oclany,
org.eclipse.ocl.pivot.library.oclinvalid,
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractInvocation.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractInvocation.java
deleted file mode 100644
index 9be6dff..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractInvocation.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\evaluation\AbstractInvocation.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2013, 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.evaluation.tx;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.ocl.pivot.internal.evaluation.tx.AbstractInvocationInternal;
-
-/**
- * AbstractInvocation provides the mandatory shared functionality of the intrusive blocked/waiting linked list functionality.
- * @since 1.1
- */
-public abstract class AbstractInvocation extends AbstractInvocationInternal
-{
- public abstract static class Incremental extends AbstractInvocation implements Invocation.Incremental
- {
- public static final @NonNull List<@NonNull Object> EMPTY_OBJECT_LIST = Collections.emptyList();
- public static final @NonNull List<SlotState.@NonNull Incremental> EMPTY_SLOT_LIST = Collections.emptyList();
-
- private Set<@NonNull Object> createdObjects = null;
- private Set<SlotState.@NonNull Incremental> readSlots = null;
- private Set<SlotState.@NonNull Incremental> writeSlots = null;
-
- @Override
- public void addCreatedObject(@NonNull Object createdObject) {
- if (createdObjects == null) {
- createdObjects = new HashSet<@NonNull Object>();
- }
- createdObjects.add(createdObject);
- }
-
- @Override
- public void addReadSlot(SlotState.@NonNull Incremental readSlot) {
- if (readSlots == null) {
- readSlots = new HashSet<SlotState.@NonNull Incremental>();
- }
- readSlots.add(readSlot);
- readSlot.addTargetInternal(this);
- }
-
- @Override
- public void addWriteSlot(SlotState.@NonNull Incremental writeSlot) {
- if (writeSlots == null) {
- writeSlots = new HashSet<SlotState.@NonNull Incremental>();
- }
- writeSlots.add(writeSlot);
- writeSlot.addSourceInternal(this);
- }
-
- @Override
- public @NonNull Iterable<@NonNull Object> getCreatedObjects() {
- return createdObjects != null ? createdObjects : EMPTY_OBJECT_LIST;
- }
-
- @Override
- public @NonNull Iterable<SlotState.@NonNull Incremental> getReadSlots() {
- return readSlots != null ? readSlots : EMPTY_SLOT_LIST;
- }
-
- @Override
- public @NonNull Iterable<SlotState.@NonNull Incremental> getWriteSlots() {
- return writeSlots != null ? writeSlots : EMPTY_SLOT_LIST;
- }
- }
-
- @Override
- public @Nullable <R> R accept(@NonNull ExecutionVisitor<R> visitor) {
- return visitor.visitInvocation(this);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractInvocationManager.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractInvocationManager.java
deleted file mode 100644
index 0ab8ee5..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractInvocationManager.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\evaluation\AbstractInvocationManager.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2013, 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.evaluation.tx;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-
-/**
- * AbstractInvocationManager provides the mandatory shared functionality for a mapping invocation manager.
- * @since 1.1
- */
-public abstract class AbstractInvocationManager implements InvocationManager
-{
-
- @Override
- public @Nullable <R> R accept(@NonNull ExecutionVisitor<R> visitor) {
- return visitor.visitInvocationManager(this);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractObjectManager.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractObjectManager.java
deleted file mode 100644
index bc87f48..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractObjectManager.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\evaluation\AbstractObjectManager.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2013, 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.evaluation.tx;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-
-/**
- * AbstractObjectManager provides the mandatory shared functionality for an object state manager.
- * @since 1.1
- */
-public abstract class AbstractObjectManager implements ObjectManager
-{
- protected static final @NonNull List<@NonNull SlotState> EMPTY_SLOT_STATE_LIST = Collections.emptyList();
-
- protected final @NonNull InvocationManager invocationManager;
-
- protected AbstractObjectManager(@NonNull InvocationManager invocationManager) {
- this.invocationManager = invocationManager;
- }
-
- @Override
- public @Nullable <R> R accept(@NonNull ExecutionVisitor<R> visitor) {
- return visitor.visitObjectManager(this);
- }
-
- @Override
- public void unblock(@NonNull Invocation anInvocation) {
- invocationManager.unblock(anInvocation);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractSlotState.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractSlotState.java
deleted file mode 100644
index a610c69..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractSlotState.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\evaluation\AbstractSlotState.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2013, 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.evaluation.tx;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-
-/**
- * The abstract implementation of a SlotState provides the mandatory shared functionality for maintaining
- * the state of an object slot.
- *
- * @since 1.1
- */
-public abstract class AbstractSlotState implements SlotState
-{
-
- public abstract static class Incremental extends AbstractSlotState implements SlotState.Incremental
- {
- public static final @NonNull List<Invocation.@NonNull Incremental> EMPTY_INVOCATIONS_LIST = Collections.emptyList();
-
- private Set<Invocation.@NonNull Incremental> sources = null;
- private Set<Invocation.@NonNull Incremental> targets = null;
-
- @Override
- public void addSourceInternal(Invocation.@NonNull Incremental invocation) {
- if (sources == null) {
- sources = new HashSet<Invocation.@NonNull Incremental>();
- }
- sources.add(invocation);
- }
-
- @Override
- public void addTargetInternal(Invocation.@NonNull Incremental invocation) {
- if (targets == null) {
- targets = new HashSet<Invocation.@NonNull Incremental>();
- }
- targets.add(invocation);
- }
-
- @Override
- public @NonNull Iterable<Invocation.@NonNull Incremental> getSources() {
- return sources != null ? sources : EMPTY_INVOCATIONS_LIST;
- }
-
-
- @Override
- public @NonNull Iterable<Invocation.@NonNull Incremental> getTargets() {
- return targets != null ? targets : EMPTY_INVOCATIONS_LIST;
- }
- }
-
- @Override
- public @Nullable <R> R accept(@NonNull ExecutionVisitor<R> visitor) {
- return visitor.visitSlotState(this);
- }
-}
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractTransformationExecutor.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractTransformationExecutor.java
deleted file mode 100644
index c5365ea..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractTransformationExecutor.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\evaluation\AbstractTransformationExecutor.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.evaluation.tx;
-
-import java.lang.reflect.Constructor;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.ocl.pivot.evaluation.Executor;
-import org.eclipse.ocl.pivot.evaluation.ModelManager;
-import org.eclipse.ocl.pivot.ids.IdResolver;
-import org.eclipse.ocl.pivot.internal.library.executor.ExecutorManager;
-import org.eclipse.ocl.pivot.utilities.ClassUtil;
-import org.eclipse.ocl.pivot.utilities.EnvironmentFactory;
-
-/**
- * @since 1.1
- */
-public abstract class AbstractTransformationExecutor extends ExecutorManager implements TransformationExecutor
-{
- protected final @NonNull EnvironmentFactory environmentFactory;
- protected final @NonNull Transformer transformer;
-
- private AbstractTransformationExecutor(@NonNull EnvironmentFactory environmentFactory, @NonNull Constructor<? extends Transformer> txConstructor)
- throws ReflectiveOperationException {
- super(environmentFactory.getCompleteEnvironment());
- this.environmentFactory = environmentFactory;
- transformer = ClassUtil.nonNullState(txConstructor.newInstance(this));
- }
-
- protected AbstractTransformationExecutor(@NonNull EnvironmentFactory environmentFactory, @NonNull Class<? extends Transformer> txClass)
- throws ReflectiveOperationException {
- this(environmentFactory, ClassUtil.nonNullState(txClass.getConstructor(Executor.class)));
- }
-
- @Override
- public @NonNull IdResolver getIdResolver() {
- return environmentFactory.getIdResolver();
- }
-
- @Override
- public @NonNull ModelManager getModelManager() {
- return transformer;
- }
-
- @Override
- public @NonNull Transformer getTransformer() {
- return transformer;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractTransformationInstance.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractTransformationInstance.java
deleted file mode 100644
index 24dcdc1..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractTransformationInstance.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\evaluation\AbstractTransformationInstance.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2013, 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.evaluation.tx;
-
-/**
- * The abstract implementation of a transformation instance provides the mandatory shared functionality for maintaining
- * a run-time representation of a transformation.
- *
- * @since 1.1
- */
-public abstract class AbstractTransformationInstance implements TransformationInstance
-{
-}
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractTransformer.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractTransformer.java
deleted file mode 100644
index 8509723..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractTransformer.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\evaluation\AbstractTransformer.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2013, 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.evaluation.tx;
-
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.ocl.pivot.evaluation.Executor;
-import org.eclipse.ocl.pivot.ids.ClassId;
-import org.eclipse.ocl.pivot.ids.PropertyId;
-import org.eclipse.ocl.pivot.util.PivotPlugin;
-import org.eclipse.ocl.pivot.utilities.TracingOption;
-import org.eclipse.ocl.pivot.internal.evaluation.tx.AbstractTransformerInternal;
-
-/**
- * The abstract implementation of an auto-generated transformation provides the mandatory shared functionality for maintaining
- * models and deferring invocation of not-ready mapping invocations.
- *
- * @since 1.1
- */
-public abstract class AbstractTransformer extends AbstractTransformerInternal
-{
- public static final @NonNull TracingOption EXCEPTIONS = new TracingOption(PivotPlugin.PLUGIN_ID, "tx/exceptions");
- public static final @NonNull TracingOption INVOCATIONS = new TracingOption(PivotPlugin.PLUGIN_ID, "tx/invocations");
-
- protected AbstractTransformer(@NonNull Executor executor, @NonNull String @NonNull [] modelNames,
- @NonNull PropertyId @Nullable [] propertyIndex2propertyId, @NonNull ClassId @Nullable [] classIndex2classId, int @Nullable [] @NonNull [] classIndex2allClassIndexes) {
- super(executor, modelNames, propertyIndex2propertyId, classIndex2classId, classIndex2allClassIndexes) ;
- }
-
- @Override
- public @Nullable <R> R accept(@NonNull ExecutionVisitor<R> visitor) {
- return visitor.visitTransformer(this);
- }
-}
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractTypedModelInstance.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractTypedModelInstance.java
deleted file mode 100644
index a491e14..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/AbstractTypedModelInstance.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\evaluation\AbstractTypedModelInstance.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2013, 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.evaluation.tx;
-
-/**
- * The abstract implementation of a typed model instance provides the mandatory shared functionality for maintaining
- * a run-time representation of a typed model.
- *
- * @since 1.1
- */
-public abstract class AbstractTypedModelInstance implements TypedModelInstance
-{
-}
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/ExecutionVisitable.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/ExecutionVisitable.java
deleted file mode 100644
index 0f3c675..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/ExecutionVisitable.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\evaluation\ExecutionVisitable.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.evaluation.tx;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-
-/**
- * ExecutionVisitable defines the common visitable capability of all run-time execution objects.
- *
- * @noimplement clients should derive from some AbstractXXX class
- * @since 1.1
- */
-public interface ExecutionVisitable
-{
- /**
- * Returns the result of accepting a visit from a visitor.
- * Implementations typically invoke a derived-class-specific
- * variant of visitXXX() to facilitate derived-class-specific
- * processing or just visit() when no such method is available.
- */
- @Nullable <R> R accept(@NonNull ExecutionVisitor<R> visitor);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/ExecutionVisitor.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/ExecutionVisitor.java
deleted file mode 100644
index 27e1a15..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/ExecutionVisitor.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\evaluation\ExecutionVisitor.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *
- * This code is auto-generated
- * from: org.eclipse.ocl.pivot/model/Pivot.genmodel
- *
- * Only the copyright statement is editable.
- *******************************************************************************/
-package org.eclipse.ocl.pivot.evaluation.tx;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-
-/**
- * @since 1.1
- */
-public interface ExecutionVisitor<R>
-{
- /**
- * Return the result of visiting a visitable for which no more specific pivot type method
- * is available.
- */
-// @Nullable R visiting(@NonNull ExecutionVisitable visitable);
-
- @Nullable R visitInvocation(@NonNull Invocation object);
- @Nullable R visitInvocationManager(@NonNull InvocationManager object);
- @Nullable R visitObjectManager(@NonNull ObjectManager object);
- @Nullable R visitSlotState(@NonNull SlotState object);
- @Nullable R visitTransformer(@NonNull Transformer object);
-}
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/Invocation.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/Invocation.java
deleted file mode 100644
index 0632069..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/Invocation.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\evaluation\Invocation.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2013, 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.evaluation.tx;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.ocl.pivot.ids.IdResolver;
-
-/**
- * An Invocation identifies a unique invocation of a Mapping and the objects/values bound to its guard variables.
- *
- * @noimplement clients should derive from AbstractInvocation
- * @since 1.1
- */
-public interface Invocation extends ExecutionVisitable
-{
- /**
- * Execute the mapping invocation, returning true if successfully executed, or false if some predicate failed.
- * @throws InvocationFailedException if a required memory access could not be performed; a retry when ready is required
- * @throws ReflectiveOperationException if a Java failure occurred while constructing an Invocation object
- */
- boolean execute() throws InvocationFailedException, ReflectiveOperationException;
-
- /**
- * Insert this Invocation following predecessor, which may be in the blocked or waiting invocations linked list.
- */
- void insertAfter(@NonNull Invocation predecessor);
-
- /**
- * Return true if a mapping invocation with thoseValues would be a re-invocation of this invocation.
- */
- boolean isEqual(@NonNull IdResolver idResolver, @NonNull Object @NonNull [] thoseValues);
-
- /**
- * Remove this Invocation from the blocked or waiting invocations linked list.
- */
- void remove();
-
- public interface Incremental extends Invocation
- {
- void addCreatedObject(@NonNull Object createdObject);
- void addReadSlot(SlotState.@NonNull Incremental readSlot);
- void addWriteSlot(SlotState.@NonNull Incremental writeSlot);
- @NonNull Iterable<@NonNull Object> getCreatedObjects();
- @NonNull Iterable<SlotState.@NonNull Incremental> getReadSlots();
- @NonNull Iterable<SlotState.@NonNull Incremental> getWriteSlots();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/InvocationFailedException.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/InvocationFailedException.java
deleted file mode 100644
index f452d44..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/InvocationFailedException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\evaluation\InvocationFailedException.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2013, 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.evaluation.tx;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.ocl.pivot.values.InvalidValueException;
-
-/**
- * An InvocationFailedException is thrown when a Mapping invocation fails as a result of an attempt to
- * access a Property before its value has been assigned. The InvocationManager should catch the exception
- * and mark the invocation for a retry once the Property has been assigned.
- *
- * @since 1.1
- */
-@SuppressWarnings("serial")
-public class InvocationFailedException extends InvalidValueException
-{
- public final @NonNull SlotState slotState;
-
- public InvocationFailedException(@NonNull SlotState slotState) {
- super("not-ready");
- this.slotState = slotState;
- }
-
- @Override
- public String toString() {
- return slotState.toString();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/InvocationManager.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/InvocationManager.java
deleted file mode 100644
index 739c608..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/InvocationManager.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\evaluation\InvocationManager.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2013, 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.evaluation.tx;
-
-import org.eclipse.jdt.annotation.NonNull;
-
-/**
- * An InvocationManager supervises the invocations of mappings, inhibiting re-executions and
- * maintaining a blocked list of invocations that have failed and a waiting list of invocations
- * ready to be reattempted.
- *
- * @since 1.1
- * @noimplement clients should derive from AbstractInvocationManager
- */
-public interface InvocationManager extends ExecutionVisitable
-{
- boolean flush() throws ReflectiveOperationException;
- void invoke(@NonNull Invocation invocation, boolean doFlush) throws ReflectiveOperationException;
- void unblock(@NonNull Invocation invocation);
-}
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/ObjectManager.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/ObjectManager.java
deleted file mode 100644
index 4daafd2..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/ObjectManager.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\evaluation\ObjectManager.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2013, 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.evaluation.tx;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-
-/**
- * An ObjectManager supervises the state of relevant properties in objects used by a mapping invocation.
- *
- * getting should be invoked as a pre-access guard to cause the invocation to fail if a not-ready property is accessed.
- *
- * assigned should be invoked to invocation that a property whose access is guarded is now assigned.
- *
- * @since 1.1
- * @noimplement clients should derive from AbstractObjectManager
- */
-public interface ObjectManager extends ExecutionVisitable
-{
- /**
- * Mark the eFeature of eObject as assigned with an ecoreValue. Ordered child assignments may be ordered by the childKey.
- */
- void assigned(@NonNull Object eObject, /*@NonNull*/ EStructuralFeature eFeature, @Nullable Object ecoreValue, @Nullable Object childKey);
-
- /**
- * Mark the eFeature of eObject as assigned with an ecoreValue by an invocation. Ordered child assignments may be ordered by the childKey.
- */
- void assigned(Invocation.@NonNull Incremental invocation, @NonNull Object eObject, /*@NonNull*/ EStructuralFeature eFeature, @Nullable Object ecoreValue, @Nullable Object childKey);
-
- /**
- * Identify the creation of eObject by the current mapping invocation.
- */
- void created(Invocation.@NonNull Incremental invocation, @NonNull Object eObject);
-
- @NonNull Iterable<@NonNull ? extends Object> getObjects();
- @NonNull Iterable<@NonNull ? extends SlotState> getSlotStates(@NonNull Object object);
-
- /**
- * Throw an InvocationFailedException if the eFeature of eObject has not yet been assigned.
- * If isOpposite, the eFeature's opposite is to be be assessed.
- */
- void getting(@NonNull Object eObject, /*@NonNull*/ EStructuralFeature eFeature, boolean isOpposite) throws InvocationFailedException;
-
- /**
- * Identify that the read of eFeature of eObject return ecoreValue.
- */
- void got(Invocation.@NonNull Incremental invocation, @NonNull Object eObject, /*@NonNull*/ EStructuralFeature eFeature, @Nullable Object ecoreValue);
-
- void unblock(@NonNull Invocation anInvocation);
-}
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/SlotState.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/SlotState.java
deleted file mode 100644
index 543f20d..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/SlotState.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\evaluation\SlotState.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2013, 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.evaluation.tx;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-
-/**
- * A SlotState identifies the assigned/not assigned state of an Object slot.
- *
- * @since 1.1
- * @noimplement clients should derive from AbstractSlotState
- */
-public interface SlotState extends ExecutionVisitable
-{
- /**
- * Update the SlotState as a result of an assignment of ecoreValue to the eFeature of eObject.
- */
- void assigned(@NonNull Object eObject, @NonNull EStructuralFeature eFeature, @Nullable Object ecoreValue);
-
- void block(@NonNull Invocation invocation);
-
- /**
- * Throw an InvocationFailedException if the eFeature of eObject has not been assigned.
- */
- void getting(@NonNull Object eObject, @NonNull EStructuralFeature eFeature) throws InvocationFailedException;
-
- public interface Incremental extends SlotState
- {
- void addSourceInternal(Invocation.@NonNull Incremental invocation);
- void addTargetInternal(Invocation.@NonNull Incremental invocation);
- @NonNull EStructuralFeature getEFeature();
- SlotState.@NonNull Incremental getPrimarySlotState();
- @Nullable Object getValue();
- @NonNull Iterable<Invocation.@NonNull Incremental> getSources();
- @NonNull Iterable<Invocation.@NonNull Incremental> getTargets();
- }
-}
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/TransformationExecutor.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/TransformationExecutor.java
deleted file mode 100644
index 234bfc9..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/TransformationExecutor.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\evaluation\TransformationExecutor.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2013, 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.evaluation.tx;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.ocl.pivot.evaluation.Executor;
-
-/**
- * A TransformationExecutor supervises the execution of an auto-generated transformation.
- *
- * @since 1.1
- * @noimplement
- */
-public interface TransformationExecutor extends Executor
-{
- @NonNull Transformer getTransformer();
-}
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/TransformationInstance.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/TransformationInstance.java
deleted file mode 100644
index a58497b..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/TransformationInstance.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\evaluation\TransformationInstance.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.evaluation.tx;
-
-import org.eclipse.jdt.annotation.Nullable;
-
-/**
- * A TransformationInstance reifies an executing transformation as a useable
- * transformation model instance during the execution of a transformation.
- *
- * @since 1.1
- * @noimplement clients should derive from AbstractTransformationInstance
- */
-public interface TransformationInstance
-{
- @Nullable String getName();
-}
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/Transformer.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/Transformer.java
deleted file mode 100644
index a18f0ba..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/Transformer.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\evaluation\Transformer.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2015, 2016 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.evaluation.tx;
-
-import java.util.Collection;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.ocl.pivot.evaluation.ModelManager;
-
-/**
- * A Transformer provides the core support to execute an auto-generated transformation
- * between models.
- *
- * @since 1.1
- * @noimplement clients should derive from AbstractTransformer
- */
-public interface Transformer extends ModelManager//, ExecutionVisitable
-{
- /**
- * Clients may reference this explicitly to force a compile-time failure for a mismatch.
- *
- * @noreference this is solely for development usage.
- *
- * 1.1.0-1 API version introduced, ObjectManager etc interfaces separated out, AbstractObjectManager etc enforced.
- * 1.1.0-2 Preliminary incremental support.
- */
- public static int RUN_TIME_EVALUATOR_API_VERSION_1_1_0_2 = 1*1000 + 1 * 100 + 0*10 + 2;
-
- /**
- * The run-time API version.
- *
- * @noreference this is solely for development usage.
- */
- public static int RUN_TIME_EVALUATOR_API_VERSION = RUN_TIME_EVALUATOR_API_VERSION_1_1_0_2;
-
- void addRootObjects(@NonNull String modelName, @NonNull Iterable<@NonNull ? extends Object> rootObjects);
- @NonNull Collection<@NonNull ? extends EObject> getRootEObjects(@NonNull String modelName);
- @NonNull Collection<@NonNull Object> getRootObjects(@NonNull String modelName);
- boolean run() throws Exception;
-}
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/TypedModelInstance.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/TypedModelInstance.java
deleted file mode 100644
index e48560a..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/evaluation/tx/TypedModelInstance.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\evaluation\TypedModelInstance.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.evaluation.tx;
-
-import java.util.Collection;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-
-/**
- * A TypedModelInstance makes an input or output model of an executing transformation
- * accessible as a model instance.
- *
- * @since 1.1
- * @noimplement clients should derive from AbstractTypedModelInstance
- */
-public interface TypedModelInstance
-{
- @NonNull Collection<@NonNull ? extends Object> getAllObjects();
- @Nullable String getName();
- @NonNull Collection<@NonNull ? extends Object> getObjectsOfKind(org.eclipse.ocl.pivot.@NonNull Class type);
- @NonNull Collection<@NonNull ? extends Object> getObjectsOfType(org.eclipse.ocl.pivot.@NonNull Class type);
- @NonNull Collection<@NonNull ? extends Object> getRootObjects();
-}
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/evaluation/tx/AbstractInvocationInternal.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/evaluation/tx/AbstractInvocationInternal.java
deleted file mode 100644
index 4548916..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/evaluation/tx/AbstractInvocationInternal.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\internal\evaluation\AbstractInvocationInternal.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2013, 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.internal.evaluation.tx;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.ocl.pivot.evaluation.tx.Invocation;
-import org.eclipse.ocl.pivot.evaluation.tx.SlotState;
-
-/**
- * AbstractInvocation provides the shared implementation of the intrusive blocked/waiting linked list functionality.
- * @since 1.1
- */
-public abstract class AbstractInvocationInternal implements Invocation
-{
- @NonNull AbstractInvocationInternal prev = this;
- @NonNull AbstractInvocationInternal next = this;
- public @Nullable SlotState debug_blockedBy = null;
-
- @Override
- public void insertAfter(@NonNull Invocation predecessor) {
- @NonNull AbstractInvocationInternal castPredecessor = (AbstractInvocationInternal)predecessor;
- @NonNull AbstractInvocationInternal successor = castPredecessor.next;
- successor.prev = this;
- next = successor;
- castPredecessor.next = this;
- prev = castPredecessor;
- }
-
- @Override
- public void remove() {
- prev.next = next;
- next.prev = prev;
- prev = this;
- next = this;
- }
-
- @Override
- public String toString() {
- return getClass().getSimpleName() + "@" + Integer.toHexString(System.identityHashCode(this));
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/evaluation/tx/AbstractTransformerInternal.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/evaluation/tx/AbstractTransformerInternal.java
deleted file mode 100644
index 6f91028..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/evaluation/tx/AbstractTransformerInternal.java
+++ /dev/null
@@ -1,644 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\internal\evaluation\AbstractTransformerInternal.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2013, 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.internal.evaluation.tx;
-
-
-import java.lang.reflect.Constructor;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.ocl.pivot.evaluation.AbstractModelManager;
-import org.eclipse.ocl.pivot.evaluation.Evaluator;
-import org.eclipse.ocl.pivot.evaluation.Executor;
-import org.eclipse.ocl.pivot.ids.ClassId;
-import org.eclipse.ocl.pivot.ids.IdManager;
-import org.eclipse.ocl.pivot.ids.IdResolver;
-import org.eclipse.ocl.pivot.ids.PackageId;
-import org.eclipse.ocl.pivot.ids.PropertyId;
-import org.eclipse.ocl.pivot.ids.TypeId;
-import org.eclipse.ocl.pivot.utilities.ClassUtil;
-import org.eclipse.ocl.pivot.utilities.NameUtil;
-import org.eclipse.ocl.pivot.values.InvalidValueException;
-import org.eclipse.ocl.pivot.evaluation.tx.AbstractTransformer;
-import org.eclipse.ocl.pivot.evaluation.tx.AbstractTypedModelInstance;
-import org.eclipse.ocl.pivot.evaluation.tx.ExecutionVisitable;
-import org.eclipse.ocl.pivot.evaluation.tx.Invocation;
-import org.eclipse.ocl.pivot.evaluation.tx.InvocationFailedException;
-import org.eclipse.ocl.pivot.evaluation.tx.InvocationManager;
-import org.eclipse.ocl.pivot.evaluation.tx.ObjectManager;
-import org.eclipse.ocl.pivot.evaluation.tx.Transformer;
-
-/**
- * The abstract implementation of an auto-generated transformation provides the shared infrastructure for maintaining
- * models and deferring invocation of not-ready mapping invocations.
- *
- * @since 1.1
- */
-public abstract class AbstractTransformerInternal extends AbstractModelManager implements Transformer, ExecutionVisitable
-{
- private static final @NonNull List<@NonNull Integer> EMPTY_INDEX_LIST = Collections.emptyList();
- private static final @NonNull List<@NonNull Object> EMPTY_EOBJECT_LIST = Collections.emptyList();
-
- protected class Model extends AbstractTypedModelInstance
- {
- protected final @NonNull String name;
- private @Nullable Set<@NonNull Object> allEObjects = null;
- private @Nullable List<@NonNull Object> rootEObjects = null;
- private @Nullable Map<@NonNull EClass, @NonNull Set<@NonNull Integer>> eClass2allClassIndexes = null;
-
- /**
- * All possible allInstances() returns indexed by the ClassIndex of the ClassId for which allInstances() may be invoked.
- */
- private final @NonNull Set<@NonNull Object>[] classIndex2objects;
-
- public Model(@NonNull String name, @NonNull PropertyId @Nullable [] propertyIndex2propertyId, @NonNull ClassId @Nullable [] classIndex2classId, int @Nullable [] @NonNull [] classIndex2allClassIndexes) {
- this.name = name;
- //
- // Prepare the allInstances() fields
- //
- if (classIndex2classId != null) {
- assert classIndex2allClassIndexes != null;
- int classIds = classIndex2classId.length;
- @SuppressWarnings("unchecked")@NonNull Set<Object> @NonNull [] classIndex2objects = (@NonNull Set<Object> @NonNull []) new @NonNull HashSet<?> @NonNull [classIds];
- this.classIndex2objects = classIndex2objects;
- for (int i = 0; i < classIds; i++) {
- classIndex2objects[i] = new HashSet<Object>();
- }
- }
- else {
- this.classIndex2objects = null;
- }
- }
-
- /**
- * Add eObject to the caches.
- * <p>
- * If eClass2allClassIndexes is non-null, eObject is added to the allInstances() caches potentially updating eClass2allClassIndexes with
- * the state of a new EClass.
- * <p>
- * If eClass2allPropertyIndexes is non-null, eObject is added to the unnavigable opposites caches potentially updating eClass2allPropertyIndexes with
- * the state of a new EClass.
- */
- private void accumulateEObject(@Nullable Map<@NonNull EClass, @NonNull Set<@NonNull Integer>> eClass2allClassIndexes,
- @Nullable Map<@NonNull EClass, @NonNull List<@NonNull Integer>> eClass2allPropertyIndexes, @Nullable Map<@NonNull EReference, @NonNull Integer> eReference2propertyIndex,
- @NonNull Object eObject) {
- EClass eClass = eClass(eObject);
- if (eClass2allClassIndexes != null) {
- Set<@NonNull Integer> allClassIndexes = eClass2allClassIndexes.get(eClass);
- if (allClassIndexes == null) {
- allClassIndexes = getClassIndexes(eClass);
- eClass2allClassIndexes.put(eClass, allClassIndexes);
- }
- Set<@NonNull Object>[] classIndex2objects2 = classIndex2objects;
- assert classIndex2objects2 != null;
- for (@NonNull Integer classIndex : allClassIndexes) {
- classIndex2objects2[classIndex].add(eObject);
- }
- }
- if (eClass2allPropertyIndexes != null) {
- assert eReference2propertyIndex != null;
- List<@NonNull Integer> allPropertyIndexes = eClass2allPropertyIndexes.get(eClass);
- if (allPropertyIndexes == null) {
- allPropertyIndexes = getOppositePropertyIndexes(eReference2propertyIndex, eClass);
- eClass2allPropertyIndexes.put(eClass, allPropertyIndexes);
- }
- Map<@NonNull Object, @NonNull Object>[] object2oppositeObject2 = object2oppositeObject;
- assert object2oppositeObject2 != null;
- for (@NonNull Integer propertyIndex : allPropertyIndexes) {
- assert propertyIndex2eReference != null;
- EReference eReference = propertyIndex2eReference[propertyIndex];
- if (eReference == null) {
- assert propertyIndex2propertyId != null;
- PropertyId propertyId = propertyIndex2propertyId[propertyIndex];
- assert propertyId != null;
- eReference = (EReference) NameUtil.getENamedElement(eClass.getEAllStructuralFeatures(), propertyId.getName());
- assert eReference != null;
- }
- Object object = eGet(eObject, eReference);
- assert object != null;
- object2oppositeObject2[propertyIndex].put(object, eObject);
- }
- }
- }
-
- public void add(@NonNull EObject eObject) {
- Set<@NonNull Object> allEObjects2 = allEObjects;
- if (allEObjects2 == null) {
- allEObjects = allEObjects2 = new HashSet<@NonNull Object>();
- }
- rootEObjects = null;
- allEObjects2.add(eObject);
- if ((eClass2allClassIndexes == null) && (classId2classIndexes != null) && (classIndex2objects != null)) {
- eClass2allClassIndexes = new HashMap<@NonNull EClass, @NonNull Set<@NonNull Integer>>();
- }
- accumulateEObject(eClass2allClassIndexes, null, null, eObject);
- }
-
- /**
- * Add eRootObjects to the modelIndex model.
- */
- public void addRootObjects(@NonNull Iterable<@NonNull ? extends Object> eRootObjects) {
- List<@NonNull Object> rootEObjects2 = rootEObjects;
- if (rootEObjects2 == null) {
- rootEObjects = rootEObjects2 = new ArrayList<@NonNull Object>();
- }
- allEObjects = null;
- Map<@NonNull EClass, @NonNull Set<@NonNull Integer>> eClass2allClassIndexes = null;
- Map<@NonNull EClass, @NonNull List<@NonNull Integer>> eClass2allPropertyIndexes = null;
- Map<@NonNull EReference, @NonNull Integer> eReference2propertyIndex = null;
- if ((classId2classIndexes != null) && (classIndex2objects != null)) {
- eClass2allClassIndexes = new HashMap<@NonNull EClass, @NonNull Set<@NonNull Integer>>();
- }
- if (propertyIndex2propertyId != null) {
- eClass2allPropertyIndexes = new HashMap<@NonNull EClass, @NonNull List<@NonNull Integer>>();
- eReference2propertyIndex = new HashMap<@NonNull EReference, @NonNull Integer>();
- }
- for (Object eRootObject : eRootObjects) {
- //
- // Accumulate the root object in the model extent
- //
- rootEObjects2.add(eRootObject);
- //
- // Accumulate the root object and all its child objects in the allInstances() returns
- //
- if ((eClass2allClassIndexes != null) || (eClass2allPropertyIndexes != null)) {
- accumulateEObject(eClass2allClassIndexes, eClass2allPropertyIndexes, eReference2propertyIndex, eRootObject);
- for (TreeIterator<? extends Object> tit = eAllContents(eRootObject); tit.hasNext(); ) {
- Object eObject = tit.next();
- if (eObject != null) {
- accumulateEObject(eClass2allClassIndexes, eClass2allPropertyIndexes, eReference2propertyIndex, eObject);
- }
- }
- }
- }
- }
-
- @Override
- public @NonNull Collection<@NonNull Object> getAllObjects() {
- Set<@NonNull Object> allEObjects2 = allEObjects;
- if (allEObjects2 == null) {
- allEObjects = allEObjects2 = new HashSet<@NonNull Object>();
- if (rootEObjects != null) {
- for (@NonNull Object eRootObject : rootEObjects) {
- allEObjects2.add(eRootObject);
- for (TreeIterator<? extends Object> tit = eAllContents(eRootObject); tit.hasNext(); ) {
- Object eObject = tit.next();
- if (eObject != null) {
- allEObjects2.add(eObject);
- }
- }
- }
- }
- }
- return allEObjects2;
- }
-
- @Override
- public @NonNull Collection<@NonNull Object> getObjectsOfKind(org.eclipse.ocl.pivot.@NonNull Class type) {
- Map<@NonNull ClassId, @NonNull Integer> classId2classIndex2 = classId2classIndex;
- if (classId2classIndex2 != null) {
- TypeId classId = type.getTypeId();
- Integer classIndex = classId2classIndex2.get(classId);
- if (classIndex != null) {
- Set<@NonNull Object>[] classIndex2objects2 = classIndex2objects;
- if (classIndex2objects2 != null) {
- Set<@NonNull Object> objects = classIndex2objects2[classIndex];
- if (objects != null) {
- return objects;
- }
- }
- }
- }
- return EMPTY_EOBJECT_LIST;
- }
-
- @Override
- public @NonNull Collection<@NonNull Object> getObjectsOfType(org.eclipse.ocl.pivot.@NonNull Class type) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return all objects in the modelIndex model that conform to eClass.
- *
- protected @NonNull <T extends EObject> List<T> getObjectsByType(@NonNull EClass eClass) {
- List<T> selectedEObjects = new ArrayList<T>();
- if (rootEObjects != null) {
- for (EObject eRootObject : rootEObjects) {
- if (eClass.isInstance(eRootObject)) {
- @SuppressWarnings("unchecked") T eObject2 = (T)eRootObject;
- selectedEObjects.add(eObject2);
- }
- for (TreeIterator<EObject> tit = eRootObject.eAllContents(); tit.hasNext(); ) {
- @SuppressWarnings("null")@NonNull EObject eObject = tit.next();
- if (eClass.isInstance(eObject)) {
- @SuppressWarnings("unchecked") T eObject2 = (T)eObject;
- selectedEObjects.add(eObject2);
- }
- }
- }
- }
- return selectedEObjects;
- } */
-
- @Override
- public @NonNull Collection<@NonNull Object> getRootObjects() {
- List<@NonNull Object> rootEObjects2 = rootEObjects;
- if (rootEObjects2 == null) {
- rootEObjects = rootEObjects2 = new ArrayList<@NonNull Object>();
- if (allEObjects != null) {
- for (@NonNull Object eObject : allEObjects) {
- if (eContainer(eObject) == null) {
- rootEObjects2.add(eObject);
- }
- }
- }
- }
- return rootEObjects2;
- }
-
- @Override
- public String toString() {
- return name + " " + (rootEObjects != null ? rootEObjects.size() : "null") + "/" + (allEObjects != null ? allEObjects.size() : "null");
- }
-
- @Override
- public @NonNull String getName() {
- return name;
- }
- }
-
- protected final @NonNull Executor executor;
- /** deprecated use executor */
- @Deprecated
- protected final @NonNull Evaluator evaluator;
- protected final IdResolver.@NonNull IdResolverExtension idResolver;
- protected final @NonNull Model @NonNull [] models;
- protected final @NonNull Map<String, Integer> modelIndexes = new HashMap<String, Integer>();
-
- /**
- * Unchanging configured list PropertyId for which unnavigable opposite navigation may occur indexed by the PropertyIndex for that PropertyId.
- */
- private final @NonNull PropertyId @Nullable [] propertyIndex2propertyId;
-
- /**
- * Unchanging configured map from the PropertyId for which unnavigable opposite navigation may occur to the PropertyIndex for that PropertyId.
- */
- private final @Nullable Map<PropertyId, Integer> propertyId2propertyIndex;
-
- /**
- * Unchanging configured map from the PropertyIndex to the EReference for the opposite property navigation.
- */
- private final @Nullable EReference @Nullable[] propertyIndex2eReference;
-
- /**
- * Unchanging maps from an EObject to its opposite using the Property whose PropertyIndex indexes the map.
- */
- private final @NonNull Map<@NonNull Object, @NonNull Object> @Nullable [] object2oppositeObject;
-
- /**
- * Unchanging configured map from the ClassId for which allInstances() may be invoked to the ClassIndex for that ClassId.
- */
- private final @Nullable Map<@NonNull ClassId, @NonNull Integer> classId2classIndex;
-
- /**
- * Evolving map from the ClassId of some model object's class to all the ClassIndexes for which the model object
- * might contribute to an allInstances() return. This is initially populated for the ClassIndexes of the ClassIds
- * for which allInstances() may be invoked. It evolves lazily to include the ClassIds for all objects in the user
- * models.
- */
- private final @Nullable Map<@NonNull ClassId, @NonNull Set<@NonNull Integer>> classId2classIndexes;
-
- /**
- * Map from invocation identity to one or more invocations with that identity. Single map entries use the
- * Invocation directly as the entry. Colliding entries use a List<Invocation> for the collisions.
- * <br>
- * This map is used to inhibit repeated invocations of the invocationId.
- */
- private final @NonNull Map<@NonNull Integer, @NonNull Object> invocationId2invocation = new HashMap<@NonNull Integer, @NonNull Object>();
-
- /**
- * Manager for the blocked and unblocked invocations.
- */
- protected final @NonNull InvocationManager invocationManager = createInvocationManager();
-
- /**
- * Manager for the auxiliary object and property state.
- */
- protected final @NonNull ObjectManager objectManager = createObjectManager();
-
- protected AbstractTransformerInternal(@NonNull Executor executor, @NonNull String @NonNull [] modelNames,
- @NonNull PropertyId @Nullable [] propertyIndex2propertyId, @NonNull ClassId @Nullable [] classIndex2classId, int @Nullable [] @NonNull [] classIndex2allClassIndexes) {
- this.executor = executor;
- this.evaluator = executor;
- this.idResolver = (IdResolver.IdResolverExtension)executor.getIdResolver();
- this.models = new @NonNull Model @NonNull [modelNames.length];
- for (int i = 0; i < modelNames.length; i++) {
- String modelName = modelNames[i];
- models[i] = new Model(modelName, propertyIndex2propertyId, classIndex2classId, classIndex2allClassIndexes);
- modelIndexes.put(modelName, i);
- }
- //
- // Prepare the unnavigable opposite property fields
- //
- if (propertyIndex2propertyId != null) {
- int propertyIds = propertyIndex2propertyId.length;
- this.propertyIndex2propertyId = propertyIndex2propertyId;
- HashMap<PropertyId, Integer> propertyId2propertyIndex2 = new HashMap<PropertyId, Integer>(propertyIds);
- this.propertyId2propertyIndex = propertyId2propertyIndex2;
- this.propertyIndex2eReference = new @Nullable EReference @NonNull [propertyIds];
- for (int propertyIndex = 0; propertyIndex < propertyIds; propertyIndex++) {
- PropertyId propertyId = propertyIndex2propertyId[propertyIndex];
- propertyId2propertyIndex2.put(propertyId, propertyIndex);
- }
- @SuppressWarnings("unchecked")@NonNull Map<@NonNull Object, @NonNull Object> @Nullable [] object2oppositeObject = (@NonNull Map<@NonNull Object, @NonNull Object> @NonNull []) new HashMap<?,?> @NonNull [propertyIds];
- this.object2oppositeObject = object2oppositeObject;
- for (int i = 0; i < propertyIds; i++) {
- object2oppositeObject[i] = new HashMap<@NonNull Object, @NonNull Object>();
- }
- }
- else {
- this.propertyIndex2propertyId = null;
- this.propertyId2propertyIndex = null;
- this.propertyIndex2eReference = null;
- this.object2oppositeObject = null;
- }
- //
- // Prepare the allInstances() fields
- //
- if (classIndex2classId != null) {
- assert classIndex2allClassIndexes != null;
- int classIds = classIndex2classId.length;
- HashMap<@NonNull ClassId, @NonNull Integer> classId2classIndex2 = new HashMap<@NonNull ClassId, @NonNull Integer>(classIds);
- HashMap<@NonNull ClassId, @NonNull Set<@NonNull Integer>> classId2classIndexes2 = new HashMap<@NonNull ClassId, @NonNull Set<@NonNull Integer>>(classIds);
- this.classId2classIndex = classId2classIndex2;
- this.classId2classIndexes = classId2classIndexes2;
- for (int classIndex = 0; classIndex < classIds; classIndex++) {
- ClassId classId = classIndex2classId[classIndex];
- classId2classIndex2.put(classId, classIndex);
- Set<Integer> superClassIndexes = new HashSet<Integer>();
- for (int allClassIndex : classIndex2allClassIndexes[classIndex]) {
- superClassIndexes.add(allClassIndex);
- }
- classId2classIndexes2.put(classId, superClassIndexes);
- }
- }
- else {
- this.classId2classIndex = null;
- this.classId2classIndexes = null;
- }
- }
-
- /**
- * Add eRootObjects to the modelIndex model.
- */
- @Override
- public void addRootObjects(@NonNull String modelName, @NonNull Iterable<@NonNull ? extends Object> eRootObjects) {
- Integer modelIndex = modelIndexes.get(modelName);
- if (modelIndex == null) {
- throw new IllegalStateException("Unknown model name '" + modelName + "'");
- }
- models[modelIndex].addRootObjects(eRootObjects);
- }
-
- /**
- * Create and return the invocation for an invocationClass and boundValues.
- * Returns null if already created.
- * @throws ReflectiveOperationException
- */
- private @Nullable Invocation createFirst(@NonNull Constructor<? extends Invocation> constructor, @NonNull Object... boundValues) throws ReflectiveOperationException {
- Class<? extends Invocation> invocationClass = constructor.getDeclaringClass();
- assert invocationClass != null;
- int hashCode = System.identityHashCode(invocationClass);
- for (@NonNull Object boundValue : boundValues) {
- hashCode = 3 * hashCode + idResolver.oclHashCode(boundValue);
- }
- Object zeroOrMoreInvocations = invocationId2invocation.get(hashCode);
- Invocation oneInvocation = null;
- List<@NonNull Invocation> twoOrMoreInvocations2 = null;
- if (zeroOrMoreInvocations instanceof Invocation) {
- oneInvocation = (Invocation)zeroOrMoreInvocations;
- if ((invocationClass == oneInvocation.getClass()) && oneInvocation.isEqual(idResolver, boundValues)) {
- return oneInvocation;
- }
- }
- else if (zeroOrMoreInvocations instanceof List<?>) {
- @SuppressWarnings("unchecked")@NonNull List<@NonNull Invocation> zeroOrMoreInvocations2 = (List<@NonNull Invocation>)zeroOrMoreInvocations;
- twoOrMoreInvocations2 = zeroOrMoreInvocations2;
- for (@NonNull Invocation anInvocation : twoOrMoreInvocations2) {
- if ((invocationClass == anInvocation.getClass()) && anInvocation.isEqual(idResolver, boundValues)) {
- return anInvocation;
- }
- }
- }
- Invocation theInvocation = constructor.newInstance(this, boundValues);
- if (zeroOrMoreInvocations == null) {
- invocationId2invocation.put(hashCode, theInvocation);
- }
- else {
- if (twoOrMoreInvocations2 == null) {
- twoOrMoreInvocations2 = new ArrayList<@NonNull Invocation>(4);
- assert oneInvocation != null;
- twoOrMoreInvocations2.add(oneInvocation);
- }
- twoOrMoreInvocations2.add(theInvocation);
- invocationId2invocation.put(hashCode, twoOrMoreInvocations2);
- }
- return theInvocation;
- }
-
- /**
- * Create the InvocationManager. Creates a LazyInvocationManager by default.
- */
- protected @NonNull InvocationManager createInvocationManager() {
- return new LazyInvocationManager();
- }
-
- /**
- * Create the ObjectManager. Creates a LazyObjectManager by default.
- */
- protected @NonNull ObjectManager createObjectManager() {
- return new LazyObjectManager((LazyInvocationManager)invocationManager);
- }
-
- @Override
- public @NonNull Set<@NonNull Object> get(org.eclipse.ocl.pivot.@NonNull Class type) {
- return new HashSet<@NonNull Object>(models[0].getObjectsOfKind(type));
- }
-
- /**
- * Return the Set of all ClassIndexes to which an EClass instance contributes to allInstances() returns.
- */
- private @NonNull Set<@NonNull Integer> getClassIndexes(@NonNull EClass eClass) {
- // ClassId classId = IdManager.getClassId(eClass);
- EPackage ePackage = ClassUtil.nonNullEMF(eClass.getEPackage());
- PackageId packageId = IdManager.getPackageId(ePackage);
- String className = ClassUtil.nonNullEMF(eClass.getName()); // FIXME Original name
- ClassId classId = packageId.getClassId(className, eClass.getETypeParameters().size());
- assert classId2classIndexes != null;
- Set<@NonNull Integer> classIndexes = classId2classIndexes.get(classId);
- if (classIndexes == null) {
- classIndexes = new HashSet<@NonNull Integer>();
- for (@NonNull EClass eSuperClass : ClassUtil.nullFree(eClass.getESuperTypes())) {
- Set<@NonNull Integer> partialResult = getClassIndexes(eSuperClass);
- classIndexes.addAll(partialResult);
- }
- assert classId2classIndexes != null;
- classId2classIndexes.put(classId, classIndexes);
- }
- return classIndexes;
- }
-
- /**
- * Return all objects in the modelIndex model that conform to eClass.
- *
- protected @NonNull <T extends EObject> List<T> getObjectsByType(int modelIndex, @NonNull EClass eClass) {
- return models[modelIndex].getObjectsByType(eClass);
- } */
-
- /**
- * Return the List of all PropertyIndexes for which an EClass instance could be the unnavigable opposite.
- * eReference2propertyIndex contains known equivalences and may be updated if more are discovered
- * using -1 as a propertyIndex for which no unnavigable opposite is appropriate.
- */
- private @NonNull List<@NonNull Integer> getOppositePropertyIndexes(@NonNull Map<@NonNull EReference, @NonNull Integer> eReference2propertyIndex, @NonNull EClass eClass) {
- List<@NonNull Integer> propertyIndexes = null;
- for (EStructuralFeature eStructuralFeature : eClass.getEAllStructuralFeatures()) {
- if (eStructuralFeature instanceof EReference) {
- EReference eReference = (EReference)eStructuralFeature;
- Integer propertyIndex = eReference2propertyIndex.get(eReference);
- if (propertyIndex == null) {
- if ((eReference.getEOpposite() == null) && !eReference.isDerived() && !eReference.isTransient() && !eReference.isVolatile()) {
- // PropertyId propertyId = IdManager.getPropertyId(eReference);
- EClass eContainingClass = eReference.getEContainingClass();
- EPackage ePackage = ClassUtil.nonNullEMF(eContainingClass.getEPackage());
- PackageId packageId = IdManager.getPackageId(ePackage);
- String className = ClassUtil.nonNullEMF(eContainingClass.getName()); // FIXME Original name
- ClassId classId = packageId.getClassId(className, eContainingClass.getETypeParameters().size());
- String propertyName = ClassUtil.nonNullEMF(eReference.getName()); // FIXME Original name
- PropertyId propertyId = classId.getPropertyId(propertyName);
- assert propertyId2propertyIndex != null;
- propertyIndex = propertyId2propertyIndex.get(propertyId);
- }
- if (propertyIndex == null) {
- propertyIndex = -1;
- }
- eReference2propertyIndex.put(eReference, propertyIndex);
- }
- if (propertyIndex >= 0) {
- if (propertyIndexes == null) {
- propertyIndexes = new ArrayList<@NonNull Integer>();
- }
- propertyIndexes.add(propertyIndex);
- }
- }
- }
- return propertyIndexes != null ? propertyIndexes : EMPTY_INDEX_LIST;
- }
-
- /**
- * Return all the container-less objects in the modelName model.
- */
- @Override
- public @NonNull Collection<@NonNull EObject> getRootEObjects(@NonNull String modelName) {
- Integer modelIndex = modelIndexes.get(modelName);
- if (modelIndex == null) {
- throw new IllegalStateException("Unknown model name '" + modelName + "'");
- }
- List<@NonNull EObject> rootEObjects = new ArrayList<@NonNull EObject>();
- for (@NonNull Object rootObject : models[modelIndex].getRootObjects()) {
- if (rootObject instanceof EObject) {
- rootEObjects.add((EObject)rootObject);
- }
- }
- return rootEObjects;
- }
-
- /**
- * Return all the container-less objects in the modelName model.
- */
- @Override
- public @NonNull Collection<@NonNull Object> getRootObjects(@NonNull String modelName) {
- Integer modelIndex = modelIndexes.get(modelName);
- if (modelIndex == null) {
- throw new IllegalStateException("Unknown model name '" + modelName + "'");
- }
- return models[modelIndex].getRootObjects();
- }
-
- /**
- * The default handler for an exception during mapping execution rethrows an InvocationFailedException so that the
- * caller may organize a re-exection when the reqired memory access can succeed. All other execptions are just
- * absorbed since they may represent a predicate failure.
- */
- protected boolean handleExecutionFailure(@NonNull String mappingName, @NonNull Throwable e) throws InvocationFailedException {
- if (e instanceof InvocationFailedException) {
- throw (InvocationFailedException)e;
- }
- // Mapping failures are just mappings that never happened.
- if (e instanceof InvalidValueException) { // Multiway branch to facilitate debugger breakpoints.
- AbstractTransformer.EXCEPTIONS.println("Execution failure in " + mappingName + " : " + e);
- }
- else if (e instanceof NullPointerException) {
- AbstractTransformer.EXCEPTIONS.println("Execution failure in " + mappingName + " : " + e);
- }
- else {
- AbstractTransformer.EXCEPTIONS.println("Execution failure in " + mappingName + " : " + e);
- }
- return false;
- }
-
- /**
- * Invoke a mapping with the given constructor with a given set of boundValues once. This shortform of invokeOnce
- * should only be used when it is known that recursive invocation is impossible.
- *
- * @throws ReflectiveOperationException
- */
- public <T extends Invocation> void invoke(@NonNull Constructor<T> constructor, @NonNull Object... boundValues) throws ReflectiveOperationException {
- @NonNull Invocation invocation = constructor.newInstance(this, boundValues);
- AbstractTransformer.INVOCATIONS.println("invoke " + invocation);
- invocationManager.invoke(invocation, true);
- }
-
- /**
- * Invoke a mapping with the given constructor with a given set of boundValues once. Repeated invocation attempts are ignored.
- *
- * @throws ReflectiveOperationException
- */
- public <T extends Invocation> void invokeOnce(@NonNull Constructor<T> constructor, @NonNull Object... boundValues) throws ReflectiveOperationException {
- Invocation invocation = createFirst(constructor, boundValues);
- if (invocation != null) {
- AbstractTransformer.INVOCATIONS.println("invokeOnce " + invocation);
- invocationManager.invoke(invocation, true);
- }
- }
-}
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/evaluation/tx/IncrementalInvocationManager.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/evaluation/tx/IncrementalInvocationManager.java
deleted file mode 100644
index 6c907b5..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/evaluation/tx/IncrementalInvocationManager.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\internal\evaluation\IncrementalInvocationManager.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2013, 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.internal.evaluation.tx;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.ocl.pivot.evaluation.tx.AbstractInvocationManager;
-import org.eclipse.ocl.pivot.evaluation.tx.AbstractTransformer;
-import org.eclipse.ocl.pivot.evaluation.tx.Invocation;
-import org.eclipse.ocl.pivot.evaluation.tx.InvocationFailedException;
-import org.eclipse.ocl.pivot.evaluation.tx.SlotState;
-
-/**
- * InvocationManager supervises and provides thread safety for the lists of blocked and waiting invocations.
- * @since 1.1
- */
-public class IncrementalInvocationManager extends AbstractInvocationManager
-{
- /**
- * Head of doubly linked list of blocked invocations.
- */
- private @Nullable AbstractInvocationInternal blockedInvocations = null;
-
- /**
- * Head of doubly linked list of unblocked invocations waiting for a re-execution attempt.
- */
- private @Nullable AbstractInvocationInternal waitingInvocations = null;
-
- protected final boolean debugTracing = AbstractTransformer.INVOCATIONS.isActive();
-
- private synchronized void block(@NonNull Invocation invocation, @NonNull SlotState slotState) {
- AbstractInvocationInternal castInvocation = (AbstractInvocationInternal) invocation;
- assert castInvocation.debug_blockedBy == null;
- castInvocation.debug_blockedBy = slotState;
- AbstractInvocationInternal blockedInvocations2 = blockedInvocations;
- if (blockedInvocations2 == null) {
- blockedInvocations = castInvocation;
- }
- else {
- castInvocation.insertAfter(blockedInvocations2.prev);
- }
- slotState.block(invocation);
- if (debugTracing) {
- AbstractTransformer.INVOCATIONS.println("block " + invocation + " for " + slotState);
- }
- }
-
- @Override
- public boolean flush() throws ReflectiveOperationException {
- flushInternal();
- AbstractInvocationInternal blockedInvocation = blockedInvocations;
- if (blockedInvocation == null) {
- return true;
- }
- do {
- if (debugTracing) {
- AbstractTransformer.INVOCATIONS.println("still blocked " + blockedInvocation + " by " + blockedInvocation.debug_blockedBy);
- }
- blockedInvocation = blockedInvocation.next;
- }
- while (blockedInvocation != blockedInvocations);
- return false;
- }
-
- private void flushInternal() throws ReflectiveOperationException {
- while (waitingInvocations != null) {
- AbstractInvocationInternal invocation = null;
- synchronized (this) {
- AbstractInvocationInternal waitingInvocations2 = waitingInvocations;
- if (waitingInvocations2 != null) {
- invocation = waitingInvocations2;
- waitingInvocations = waitingInvocations2.next;
- if (waitingInvocations == invocation) {
- waitingInvocations = null;
- }
- invocation.remove();
- }
- }
- if (invocation != null) {
- if (debugTracing) {
- AbstractTransformer.INVOCATIONS.println("re-invoke " + invocation);
- }
- invoke(invocation, false);
- }
- }
- }
-
- @Override
- public void invoke(@NonNull Invocation invocation, boolean doFlush) throws ReflectiveOperationException {
- try {
- invocation.execute();
- if (debugTracing) {
- AbstractTransformer.INVOCATIONS.println("done " + invocation);
- }
- if (doFlush) {
- flushInternal();
- }
- }
- catch (InvocationFailedException e) {
- block(invocation, e.slotState);
- }
- }
-
- @Override
- public synchronized void unblock(@NonNull Invocation invocation) {
- if (debugTracing) {
- AbstractTransformer.INVOCATIONS.println("unblock " + invocation);
- }
- AbstractInvocationInternal castInvocation = (AbstractInvocationInternal) invocation;
- assert castInvocation.debug_blockedBy != null;
- castInvocation.debug_blockedBy = null;
- if (blockedInvocations == castInvocation) {
- blockedInvocations = castInvocation.next;
- if (blockedInvocations == castInvocation) {
- blockedInvocations = null;
- }
- }
- castInvocation.remove();
- AbstractInvocationInternal waitingInvocations2 = waitingInvocations;
- if (waitingInvocations2 == null) {
- waitingInvocations = castInvocation;
- }
- else {
- castInvocation.insertAfter(waitingInvocations2.prev);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/evaluation/tx/IncrementalObjectManager.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/evaluation/tx/IncrementalObjectManager.java
deleted file mode 100644
index 3584b77..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/evaluation/tx/IncrementalObjectManager.java
+++ /dev/null
@@ -1,849 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\internal\evaluation\IncrementalObjectManager.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2013, 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.internal.evaluation.tx;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.ocl.pivot.oclstdlib.OCLstdlibPackage;
-import org.eclipse.ocl.pivot.evaluation.tx.AbstractObjectManager;
-import org.eclipse.ocl.pivot.evaluation.tx.AbstractSlotState;
-import org.eclipse.ocl.pivot.evaluation.tx.AbstractTransformer;
-import org.eclipse.ocl.pivot.evaluation.tx.Invocation;
-import org.eclipse.ocl.pivot.evaluation.tx.InvocationFailedException;
-import org.eclipse.ocl.pivot.evaluation.tx.ObjectManager;
-import org.eclipse.ocl.pivot.evaluation.tx.SlotState;
-
-/**
- * @since 1.1
- */
-public class IncrementalObjectManager extends AbstractObjectManager
-{
- /**
- * Simple SlotState describing a DataType element or 1:1 Object navigation.
- */
- public static abstract class BasicSlotState extends AbstractSlotState.Incremental
- {
- public enum SlotMode {
- ASSIGNABLE, // No assignment has been performed, object reads are blocked (collections reads may be unblocked)
- ASSIGNED // Last assignment has been performed, reads are unblocked
- }
-
- protected final @NonNull Object eObject;
- protected final @NonNull EStructuralFeature eFeature;
- private @Nullable Object value = null;
-
- protected @NonNull SlotMode mode;
- private @Nullable Object blockedInvocations = null;
-
- public BasicSlotState(@NonNull Object eObject, @NonNull EStructuralFeature eFeature) {
- mode = SlotMode.ASSIGNABLE;
- this.eObject = eObject;
- this.eFeature = eFeature;
- }
-
- public BasicSlotState(@NonNull Object eObject, @NonNull EStructuralFeature eFeature, @Nullable Object ecoreValue) {
- mode = SlotMode.ASSIGNED;
- this.eObject = eObject;
- this.eFeature = eFeature;
- this.value = ecoreValue;
- }
-
- public synchronized void assigned(@NonNull IncrementalObjectManager objectManager, @NonNull Object eObject, @NonNull EStructuralFeature eFeature, @Nullable Object ecoreValue) {
- switch (mode) {
- case ASSIGNABLE:
- mode = SlotMode.ASSIGNED;
- unblock(objectManager);
- break;
- case ASSIGNED:
- System.out.println("Re-assignment of " + eFeature.getEContainingClass().getName() + "::" + eFeature.getName() + " for " + eObject + " with " + ecoreValue);
- break;
- }
- this.value = ecoreValue;
- }
-
- @Override
- public synchronized void block(@NonNull Invocation invocation) {
- final Object blockedInvocations2 = blockedInvocations;
- if (blockedInvocations2 == null) {
- blockedInvocations = invocation;
- }
- else if (blockedInvocations2 instanceof Invocation) {
- List<Invocation> blockedInvocationList = new ArrayList<Invocation>();
- blockedInvocationList.add((Invocation) blockedInvocations2);
- blockedInvocationList.add(invocation);
- blockedInvocations = blockedInvocationList;
- }
- else {
- @SuppressWarnings("unchecked")
- List<Invocation> blockedInvocationList = (List<Invocation>)blockedInvocations2;
- blockedInvocationList.add(invocation);
- }
- }
-
- @Override
- public @NonNull EStructuralFeature getEFeature() {
- return eFeature;
- }
-
- @Override
- public SlotState.@NonNull Incremental getPrimarySlotState() {
- return this;
- }
-
- @Override
- public @Nullable Object getValue() {
- return value;
- }
-
- @Override
- public synchronized void getting( @NonNull Object eObject, @NonNull EStructuralFeature eFeature) {
- switch (mode) {
- case ASSIGNABLE:
- throw new InvocationFailedException(this);
- case ASSIGNED:
- break;
- }
- }
-
- protected boolean isAssigned() {
- return mode == SlotMode.ASSIGNED;
- }
-
- @Override
- public String toString() {
- return getClass().getSimpleName() + "@" + Integer.toHexString(System.identityHashCode(this)) + "[" + eFeature.getEContainingClass().getName() + "::" + eFeature.getName() + " for " + eObject + "]";
- }
-
- protected synchronized void unblock(@NonNull ObjectManager objectManager) {
- final Object blockedInvocations2 = blockedInvocations;
- if (blockedInvocations2 instanceof Invocation) {
- objectManager.unblock((Invocation) blockedInvocations2);
- }
- else if (blockedInvocations2 != null) {
- @SuppressWarnings("unchecked")
- List<Invocation> blockedInvocationList = (List<Invocation>)blockedInvocations2;
- for (@SuppressWarnings("null")@NonNull Invocation invocation : blockedInvocationList) {
- objectManager.unblock(invocation);
- }
- }
- blockedInvocations = null;
- }
- }
-
- /**
- * SlotState describing the contained element side of a 1:N Object navigation.
- * A single OneToManyContainedSlotState is shared by each of the possible containing features and also the
- * generic OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER corresponding to eContainer().
- * The eGet() must therefore check not only that the proprty is assigned but also that it is
- * assigned to the containing feature of interest.
- * <br>
- * Lifecycle (read first, write later):
- * Create due to
- * - get of an aggregator => ASSIGNABLE, blocked
- * Unblock
- * - assign of possibly null aggregator for the element, ASSIGNABLE, blocked => ASSIGNED, not blocked
- * - non-null aggregator is notified to unblock
- * Thereafter
- * - get of aggregator ASSIGNED => ASSIGNED
- * <br>
- * Lifecycle (write first):
- * Create due to
- * - assign of a possibly null aggregator => ASSIGNED, unblocked
- * - non-null aggregator is notified to unblock
- * Thereafter
- * - get of aggregator ASSIGNED => ASSIGNED
- *
- private static class ContainedSlotState extends SlotState
- {
- public static @NonNull SlotState create(@NonNull ObjectManager objectManager,
- @NonNull EObject eObject, @NonNull EReference eFeature, @Nullable EReference eOppositeFeature, @Nullable EObject eContainer) {
- if (eOppositeFeature == null) {
- eOppositeFeature = OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER;
- assert eOppositeFeature != null;
- }
- if (eContainer != null) {
- ContainerSlotState aggregatorSlotState = (ContainerSlotState) objectManager.getSlotState(eContainer, eOppositeFeature);
- aggregatorSlotState.assignedElement(objectManager, eContainer, eOppositeFeature, eObject);
- }
- return new ContainedSlotState(eObject, eFeature, eContainer);
- }
-
- public ContainedSlotState(@NonNull EObject eObject, @NonNull EReference eFeature) {
- super(eObject, eFeature);
- assert !eFeature.isMany();
- if (eFeature != OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER) { // FIXME ensure oclContainer() composes
- assert eFeature.isContainment();
- assert eFeature.getEOpposite() != null;
- }
-// assert eFeature.getEOpposite().isMany();
- }
-
- private ContainedSlotState(@NonNull EObject eObject, @NonNull EReference eFeature, @Nullable EObject eContainer) {
- super(eObject, eFeature, eContainer);
- assert !eFeature.isMany();
- if (eFeature != OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER) { // FIXME ensure oclContainer() composes
- assert eFeature.isContainment();
- }
-// assert eFeature.getEOpposite().isMany();
- assert eObject.eContainer() == eContainer;
- }
-
- @Override
- public synchronized void assigned(@NonNull ObjectManager objectManager, @NonNull EObject eObject, @NonNull EStructuralFeature eFeature, @Nullable Object ecoreValue) {
- if (!isAssigned() && (ecoreValue != null)) {
- EObject eOpposite = (EObject) ecoreValue;
- EReference eOppositeReference = ((EReference)eFeature).getEOpposite();
- assert eOppositeReference != null;
- ContainerSlotState aggregatorSlotState = (ContainerSlotState) objectManager.getSlotState(eOpposite, eOppositeReference);
- aggregatorSlotState.assignedElement(objectManager, eOpposite, eOppositeReference, eObject);
- }
- super.assigned(objectManager, eObject, eFeature, ecoreValue);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public synchronized @Nullable <G> G get(@NonNull ObjectManager objectManager, @NonNull EObject eObject, @NonNull EStructuralFeature eFeature) {
- switch (mode) {
- case ASSIGNABLE:
- throw new InvocationFailedException(this);
- case ASSIGNED:
- break;
- }
- if (eFeature != OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER) {
- EStructuralFeature eContainingFeature = eObject.eContainingFeature();
- if (eContainingFeature != eFeature) {
- return null;
- }
- }
- return (G) eObject.eContainer();
- }
- } */
-
- /**
- * SlotState describing the container side of a 1:N Object navigation.
- * <br>
- * Lifecycle:
- * Create due to
- * - get of all elements => ASSIGNABLE, blocked
- * NO: - get of a container => ASSIGNABLE, blocked
- * Create due to
- * - assign of all elements => ASSIGNABLE => ASSIGNED, not blocked
- * - assign of a first element to the container => ASSIGNABLE, not blocked
- * Update due to
- * - assign of a further element to the container => ASSIGNABLE => ASSIGNABLE
- * Unblock due to
- * - get of a container ASSIGNABLE => ASSIGNED
- * - get of all elements ASSIGNABLE => ASSIGNED
- * Thereafter
- * - get of a container ASSIGNED => ASSIGNED
- * - get of all elements ASSIGNED => ASSIGNED
- * <br>
- * Lifecycle 2: read first
- * Create due to
- * - get of elements => ASSIGNABLE, blocked
- * Unblock due to
- * - assign of an element to the container => ASSIGNABLE => ASSIGNED, not blocked
- * Thereafter
- * - get of either end ASSIGNED => ASSIGNED
- * - (assign of either end is an ignored error)
- *
- private static class ContainerSlotState extends SlotState
- {
- public static @NonNull SlotState create(@NonNull ObjectManager objectManager,
- @NonNull EObject eObject, @NonNull EReference eFeature, @NonNull EReference eOppositeFeature, @Nullable EObject eContent) {
- if (eContent != null) {
- ContainedSlotState containedSlotState = (ContainedSlotState) objectManager.getSlotState(eContent, eOppositeFeature);
- containedSlotState.assigned(objectManager, eContent, eOppositeFeature, eObject);
- }
- return new ContainerSlotState(eObject, eFeature, eContent);
- }
-
- public ContainerSlotState(@NonNull EObject eContainer, @NonNull EReference eFeature) {
- super(eContainer, eFeature);
- assert eFeature.isContainer();
-// assert eFeature.isMany();
-// assert eFeature.getEOpposite() != null;
-// assert eFeature.getEOpposite().isMany();
- }
-
- public ContainerSlotState(@NonNull EObject eContainer, @NonNull EReference eFeature, @Nullable Object elements) {
- super(eContainer, eFeature, elements);
- assert eFeature.isContainer();
-// assert eFeature.isMany();
-// assert eFeature.getEOpposite() != null;
-// assert eFeature.getEOpposite().isMany();
- assert eContainer.eGet(eFeature) == eContainer;
- }
-
- @Override
- public synchronized void assigned(@NonNull ObjectManager objectManager, @NonNull EObject eObject, @NonNull EStructuralFeature eFeature, @Nullable Object ecoreValue) {
- assert ecoreValue != null;
- @SuppressWarnings("unchecked")
- List<? extends EObject> ecoreValues = (List<? extends EObject>)ecoreValue;
- EReference eOppositeReference = ((EReference)eFeature).getEOpposite();
- for (EObject element : ecoreValues) {
- if (element != null) {
- Map<EStructuralFeature, SlotState> elementObjectState = objectManager.getObjectState(element);
- elementObjectState.put(eOppositeReference, this);
- }
- }
- super.assigned(objectManager, eObject, eFeature, ecoreValue);
-
- }
-
- public void assignedElement(@NonNull ObjectManager objectManager,
- @NonNull EObject eContainer, @NonNull EReference eReference, EObject eObject) {
- super.assigned(objectManager, eContainer, eReference, eObject);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public synchronized @Nullable <G> G get(@NonNull ObjectManager objectManager, @NonNull EObject eObject, @NonNull EStructuralFeature eFeature) {
- switch (mode) {
- case ASSIGNABLE:
- mode = PropertyMode.ASSIGNED;
- unblock(objectManager);
- break;
- case ASSIGNED:
- break;
- }
- return (G) eObject.eGet(eFeature);
- }
- } */
-
- /**
- * SlotState describing an M:N Object navigation.
- */
- class ManyToManySlotState extends BasicSlotState
- {
- public ManyToManySlotState(@NonNull Object eObject, @NonNull EStructuralFeature eFeature) {
- super(eObject, eFeature);
- throw new UnsupportedOperationException();
- }
-
- @Override
- public synchronized void assigned(@NonNull Object eObject, @NonNull EStructuralFeature eFeature, @Nullable Object ecoreValue) {
- throw new UnsupportedOperationException();
- }
- }
-
- /**
- * SlotState describing the aggregator side of a 1:N Object navigation.
- * <br>
- * Lifecycle:
- * Create due to
- * - get of all elements => ASSIGNABLE, blocked
- * NO: - get of an aggregator => ASSIGNABLE, blocked
- * Create due to
- * - assign of all elements => ASSIGNABLE => ASSIGNED, not blocked
- * - assign of a first element to the aggregator => ASSIGNABLE, not blocked
- * Update due to
- * - assign of a further element to the aggregator => ASSIGNABLE => ASSIGNABLE
- * Unblock due to
- * - get of an aggregator ASSIGNABLE => ASSIGNED
- * - get of all elements ASSIGNABLE => ASSIGNED
- * Thereafter
- * - get of an aggregator ASSIGNED => ASSIGNED
- * - get of all elements ASSIGNED => ASSIGNED
- * <br>
- * Lifecycle 2: read first
- * Create due to
- * - get of elements => ASSIGNABLE, blocked
- * Unblock due to
- * - assign of an element to the aggregator => ASSIGNABLE => ASSIGNED, not blocked
- * Thereafter
- * - get of either end ASSIGNED => ASSIGNED
- * - (assign of either end is an ignored error)
- */
- class OneToManyAggregatorSlotState extends BasicSlotState
- {
-
-// public static @NonNull SlotState create(@NonNull ObjectManager objectManager,
-// EObject eObject, @NonNull EReference eFeature, EReference eOppositeReference, Object ecoreValue) {
-// // TODO Auto-generated method stub
-// return null;
-// }
-
- public OneToManyAggregatorSlotState(@NonNull Object eContainer, @NonNull EStructuralFeature eFeature) {
- super(eContainer, eFeature);
- assert eFeature.isMany();
-// assert eFeature.getEOpposite() != null;
-// assert eFeature.getEOpposite().isMany();
- }
-
- private OneToManyAggregatorSlotState(@NonNull Object eContainer, @NonNull EStructuralFeature eFeature, @Nullable Object eContents) {
- super(eContainer, eFeature, eContents);
- assert eFeature.isMany();
-// assert eFeature.getEOpposite() != null;
-// assert eFeature.getEOpposite().isMany();
- assert ((EObject)eContainer).eGet(eFeature).equals(eContents);
- }
-
- @Override
- public synchronized void assigned(@NonNull Object eObject, @NonNull EStructuralFeature eFeature, @Nullable Object ecoreValue) {
- assert ecoreValue != null;
- @SuppressWarnings("unchecked")
- List<? extends EObject> ecoreValues = (List<? extends EObject>)ecoreValue;
- EReference eOppositeReference = ((EReference)eFeature).getEOpposite();
- for (EObject element : ecoreValues) {
- if (element != null) {
- Map<EStructuralFeature, BasicSlotState> elementObjectState = getObjectState(element);
- elementObjectState.put(eOppositeReference, this);
- }
- }
-// super.assigned(objectManager, eObject, eFeature, ecoreValue);
- assignedElement(eObject, (EReference)eFeature, (EObject)ecoreValue);
- }
-
- public void assignedElement(@NonNull Object eContainer, @NonNull EReference eReference, Object eObject) {
-// super.assigned(objectManager, eContainer, eReference, eObject);
- switch (mode) {
- case ASSIGNABLE:
- mode = SlotMode.ASSIGNED;
- unblock(IncrementalObjectManager.this);
- break;
- case ASSIGNED:
- break;
- }
- }
-
- @Override
- public synchronized void getting(@NonNull Object eObject, @NonNull EStructuralFeature eFeature) {
- switch (mode) {
- case ASSIGNABLE:
- mode = SlotMode.ASSIGNED;
- unblock(IncrementalObjectManager.this);
- break;
- case ASSIGNED:
- break;
- }
- }
- }
-
- /**
- * SlotState describing the element side of a 1:N Object navigation.
- * <br>
- * Lifecycle (read first, write later):
- * Create due to
- * - get of an aggregator => ASSIGNABLE, blocked
- * Unblock
- * - assign of possibly null aggregator for the element, ASSIGNABLE, blocked => ASSIGNED, not blocked
- * - non-null aggregator is notified to unblock
- * Thereafter
- * - get of aggregator ASSIGNED => ASSIGNED
- * <br>
- * Lifecycle (write first):
- * Create due to
- * - assign of a possibly null aggregator => ASSIGNED, unblocked
- * - non-null aggregator is notified to unblock
- * Thereafter
- * - get of aggregator ASSIGNED => ASSIGNED
- */
- class OneToManyElementSlotState extends BasicSlotState
- {
- public OneToManyElementSlotState(@NonNull Object eObject, @NonNull EReference eFeature) {
- super(eObject, eFeature);
- assert !eFeature.isMany();
- if (eFeature == OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER) {
- assert eFeature.getEOpposite() == null;
- }
- else {
- assert eFeature.getEOpposite() != null;
- assert eFeature.getEOpposite().isMany();
- }
- }
-
- public OneToManyElementSlotState(@NonNull Object eObject, @NonNull EReference eFeature, @NonNull Object eAggregator) {
- super(eObject, eFeature, eAggregator);
- assert !eFeature.isMany();
- assert eFeature.getEOpposite() != null;
- assert eFeature.getEOpposite().isMany();
- if (eFeature == OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER) {
- assert ((EObject)eObject).eContainer() == eAggregator;
- }
- else {
- assert ((EObject)eObject).eGet(eFeature) == eAggregator;
- }
- }
-
- @Override
- public synchronized void assigned(@NonNull Object eObject, @NonNull EStructuralFeature eFeature, @Nullable Object ecoreValue) {
- if (!isAssigned() && (ecoreValue != null)) {
- EObject eOpposite = (EObject) ecoreValue;
- EReference eOppositeReference = ((EReference)eFeature).getEOpposite();
- if (eFeature == OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER) {
- eOppositeReference = ((EObject)eObject).eContainmentFeature();
- assert eOppositeReference != null;
- SlotState aggregatorSlotState = getSlotState(eOpposite, eOppositeReference);
- aggregatorSlotState.assigned(eOpposite, eOppositeReference, eObject);
- }
- else {
- assert eOppositeReference != null;
- OneToManyAggregatorSlotState aggregatorSlotState = (OneToManyAggregatorSlotState) getSlotState(eOpposite, eOppositeReference);
- aggregatorSlotState.assignedElement(eOpposite, eOppositeReference, eObject);
- }
- }
- assigned(eObject, eFeature, ecoreValue);
- }
-
- @Override
- public SlotState.@NonNull Incremental getPrimarySlotState() {
- EObject eOpposite = (EObject) getValue();
- assert eOpposite != null;
- EReference eOppositeReference = ((EReference)eFeature).getEOpposite();
- if (eFeature == OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER) {
- eOppositeReference = ((EObject)eObject).eContainmentFeature();
- assert eOppositeReference != null;
- return getSlotState(eOpposite, eOppositeReference);
- }
- else {
- assert eOppositeReference != null;
- return getSlotState(eOpposite, eOppositeReference);
- }
- }
- }
-
- /**
- * SlotState describing a 1:1 Object navigation. Both ends are assigned exactly once. The remote assignment
- * may be null.
- * <br>
- * Lifecycle 1: write first
- * Create due to
- * - assign of possibly null eOpposite => ASSIGNED
- * Thereafter
- * - get of either end ASSIGNED => ASSIGNED
- * - (assign of either end is an ignored error)
- * <br>
- * Lifecycle 2: read first
- * Create due to
- * - get of other end => ASSIGNABLE_BLOCKED
- * Unblock due to
- * - assign of a further element to the aggregator => ASSIGNABLE_BLOCKED => ASSIGNED
- * Thereafter
- * - get of either end ASSIGNED => ASSIGNED
- * - (assign of either end is an ignored error)
- */
- class OneToOneSlotState extends BasicSlotState
- {
-/* public static @NonNull <G,S> SlotState createContainer(@NonNull ObjectManager objectManager,
- @NonNull EObject eObject, @NonNull EReference eFeature, @Nullable EReference eOppositeFeature, @Nullable EObject eOpposite) {
- Map<EStructuralFeature, SlotState> oppositeObjectState = null;
- if (eOpposite != null) {
- oppositeObjectState = objectManager.getObjectState(eObject);
- SlotState slotState = oppositeObjectState.get(eOppositeFeature);
- if (slotState != null) {
- return slotState;
- }
- }
- SlotState slotState = new OneToOneSlotState(eObject, eFeature, eOpposite);
- if (oppositeObjectState != null) {
- oppositeObjectState.put(eOppositeFeature, slotState);
- }
- return slotState;
- } */
-
- public OneToOneSlotState(@NonNull Object eObject, @NonNull EReference eFeature) {
- super(eObject, eFeature);
- assert !eFeature.isMany();
- if (eFeature.isContainer()) {
-// assert eObject.eContainer() == eOpposite;
- }
- else if (eFeature.isContainment()) {
-// assert eOpposite != null;
-// assert eObject == eOpposite.eContainer();
- }
- else if (eFeature == OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER) {
-// slotState = new OneToOneSlotState(eObject, eReference);
- }
- else {
- assert eFeature.getEOpposite() != null;
- assert !eFeature.getEOpposite().isMany();
- }
- }
-
- private OneToOneSlotState(@NonNull Object eObject, @NonNull EReference eFeature, @Nullable Object eOpposite) {
- super(eObject, eFeature, eOpposite);
- assert !eFeature.isMany();
- if (eFeature.isContainer()) {
- assert ((EObject)eObject).eContainer() == eOpposite;
- }
- else if (eFeature.isContainment()) {
- assert eOpposite != null;
- assert eObject == ((EObject)eOpposite).eContainer();
- }
- else {
- assert eFeature.getEOpposite() != null;
- assert !eFeature.getEOpposite().isMany();
- assert ((EObject)eObject).eGet(eFeature) == eOpposite;
- }
- }
-
- @Override
- public void assigned(@NonNull Object eObject, @NonNull EStructuralFeature eFeature, @Nullable Object ecoreValue) {
- assigned(IncrementalObjectManager.this, eObject, eFeature, ecoreValue);
- }
- }
-
- /**
- * Simple SlotState describing a DataType element or 1:1 Object navigation.
- */
- class SimpleSlotState extends BasicSlotState
- {
- public SimpleSlotState(@NonNull Object eObject, @NonNull EStructuralFeature eFeature) {
- super(eObject, eFeature);
- }
-
- public SimpleSlotState(@NonNull Object eObject, @NonNull EStructuralFeature eFeature, @Nullable Object ecoreValue) {
- super(eObject, eFeature, ecoreValue);
- }
-
- @Override
- public void assigned(@NonNull Object eObject, @NonNull EStructuralFeature eFeature, @Nullable Object ecoreValue) {
- assigned(IncrementalObjectManager.this, eObject, eFeature, ecoreValue);
- }
- }
-
- protected final boolean debugTracing = AbstractTransformer.INVOCATIONS.isActive();
-
- /**
- * This unpleasant Map of Maps is a pathfinder before embarking on slotted objects that merge user and overhead
- * in a single object. The first map is then a null lookup and the nested map is an index within the object.
- */
- private Map<@NonNull Object, @NonNull Map<@NonNull EStructuralFeature, @NonNull BasicSlotState>> object2feature2slotState = new HashMap<@NonNull Object, @NonNull Map<@NonNull EStructuralFeature, @NonNull BasicSlotState>>();
-
- public IncrementalObjectManager(@NonNull IncrementalInvocationManager invocationManager) {
- super(invocationManager);
- }
-
- @Override
- public synchronized void assigned(@NonNull Object eObject, /*@NonNull*/ EStructuralFeature eFeature, @Nullable Object ecoreValue, @Nullable Object childKey) {
- assert eFeature != null;
- if (debugTracing) {
- AbstractTransformer.INVOCATIONS.println("assigned " + eFeature.getEContainingClass().getName() + "::" + eFeature.getName() + " for " + eObject + " = " + ecoreValue);
- }
- Map<EStructuralFeature, BasicSlotState> objectState = getObjectState(eObject);
- BasicSlotState slotState = objectState.get(eFeature);
- if (slotState != null) {
- slotState.assigned(eObject, eFeature, ecoreValue);
- }
- else {
- if (eFeature instanceof EAttribute) {
- slotState = new SimpleSlotState(eObject, eFeature, ecoreValue);
- }
- else {
- EReference eReference = (EReference)eFeature;
- EReference eOppositeReference = eReference.getEOpposite();
- if (eOppositeReference != null) {
-// if (ecoreValue != null) {
-// Map<EStructuralFeature, SlotState> oppositeObjectState = getObjectState((EObject) ecoreValue);
-// SlotState oppositeSlotState = oppositeObjectState.get(eOppositeReference);
-// }
- if (eReference.isMany()) {
- assert ecoreValue != null;
- if (eOppositeReference.isMany()) {
- slotState = createManyToManySlotState(eObject, eReference, eOppositeReference);
- }
- else {
- slotState = createOneToManyAggregatorSlotState(eObject, eReference, eOppositeReference, ecoreValue);
- }
- }
- else if (ecoreValue != null) {
- if (eOppositeReference.isMany()) {
- slotState = createOneToManyElementSlotState(eObject, eReference, eOppositeReference, ecoreValue);
- }
-// else if (isIncremental) {
-// slotState = AbstractTransformerInternal.OneToOneSlotState.create(this, eObject, eReference, eOppositeReference, ecoreValue);
-// }
- }
- }
- else if (eReference.isContainment()) {
- assert ecoreValue != null;
- eOppositeReference = OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER;
- assert eOppositeReference != null;
- if (eReference.isMany()) {
- slotState = createOneToManyAggregatorSlotState(eObject, eReference, eOppositeReference, ecoreValue);
- }
- else {
- Map<EStructuralFeature, BasicSlotState> oppositeObjectState = getObjectState(ecoreValue);
- slotState = oppositeObjectState.get(eOppositeReference);
- if (slotState != null) {
- slotState.assigned(ecoreValue, eOppositeReference, eObject);
- }
- else {
- slotState = createOneToOneSlotState(eObject, eReference, eOppositeReference, ecoreValue);
- }
- }
- }
-// else if (eReference == OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER) {
-// slotState = OneToOneSlotState.create(this, eObject, eReference, eOppositeReference, ecoreValue);
-// }
- else { // Unidirectional non-containment EReference
- slotState = new SimpleSlotState(eObject, eFeature, ecoreValue);
- }
- }
- objectState.put(eFeature, slotState);
- }
- }
-
- @Override
- public void assigned(Invocation.@NonNull Incremental invocation, @NonNull Object eObject, EStructuralFeature eFeature, @Nullable Object ecoreValue, @Nullable Object childKey) {
- assigned(eObject, eFeature, ecoreValue, childKey);
- assert eFeature != null;
- BasicSlotState slotState = getSlotState(eObject, eFeature);
- invocation.addWriteSlot(slotState);
- }
-
- @NonNull BasicSlotState createManyToManySlotState(
- @NonNull Object eObject, @NonNull EReference eFeature, @NonNull EReference eOppositeFeature) {
- throw new UnsupportedOperationException();
- }
-
- @NonNull BasicSlotState createOneToManyAggregatorSlotState(
- @NonNull Object eObject, @NonNull EReference eFeature, @NonNull EReference eOppositeFeature, @Nullable Object eContents) {
- if (eContents != null) {
-// SlotState containedSlotState = objectManager.getSlotState(eContent, eOppositeFeature);
-// containedSlotState.assigned(objectManager, eContent, eOppositeFeature, eObject);
- }
- return new OneToManyAggregatorSlotState(eObject, eFeature, eContents);
- }
-
- @NonNull BasicSlotState createOneToManyElementSlotState(
- @NonNull Object eObject, @NonNull EReference eFeature, @NonNull EReference eOppositeFeature, @NonNull Object eAggregator) {
- OneToManyAggregatorSlotState aggregatorSlotState = (OneToManyAggregatorSlotState) getSlotState(eAggregator, eOppositeFeature);
- aggregatorSlotState.assignedElement(eAggregator, eOppositeFeature, eObject);
- return new OneToManyElementSlotState(eObject, eFeature, eAggregator);
- }
-
- @NonNull <G,S> BasicSlotState createOneToOneSlotState(
- @NonNull Object eObject, @NonNull EReference eFeature, @NonNull EReference eOppositeFeature, @Nullable Object eOpposite) {
- Map<EStructuralFeature, BasicSlotState> oppositeObjectState = null;
- if (eOpposite != null) {
- oppositeObjectState = getObjectState(eOpposite);
- BasicSlotState slotState = oppositeObjectState.get(eOppositeFeature);
- if (slotState != null) {
- return slotState;
- }
- }
- BasicSlotState slotState = new OneToOneSlotState(eObject, eFeature, eOpposite);
- if (oppositeObjectState != null) {
- oppositeObjectState.put(eOppositeFeature, slotState);
- }
- return slotState;
- }
-
- @Override
- public void created(Invocation.@NonNull Incremental invocation, @NonNull Object eObject) {
- invocation.addCreatedObject(eObject);
- }
-
- public @NonNull Map<EStructuralFeature, BasicSlotState> getObjectState(@NonNull Object eObject) {
- Map<@NonNull EStructuralFeature, @NonNull BasicSlotState> feature2state = object2feature2slotState.get(eObject);
- if (feature2state == null) {
- feature2state = new HashMap<@NonNull EStructuralFeature, @NonNull BasicSlotState>();
- object2feature2slotState.put(eObject, feature2state);
- }
- return feature2state;
- }
-
- @Override
- public @NonNull Iterable<@NonNull ? extends Object> getObjects() {
- return object2feature2slotState.keySet();
- }
-
- public synchronized @NonNull BasicSlotState getSlotState(@NonNull Object eObject, @NonNull EStructuralFeature eFeature) {
- assert eFeature != null;
- Map<EStructuralFeature, BasicSlotState> objectState = getObjectState(eObject);
- BasicSlotState slotState = objectState.get(eFeature);
- if (slotState == null) {
- if (eFeature instanceof EAttribute) {
- slotState = new SimpleSlotState(eObject, eFeature);
- }
- else {
- EReference eReference = (EReference)eFeature;
- EReference eOppositeReference = eReference.getEOpposite(); // FIXME there is always a Pivot opposite
- if (eOppositeReference != null) {
- if (eReference.isMany()) {
- if (eOppositeReference.isMany()) {
- slotState = new ManyToManySlotState(eObject, eReference);
- }
- else {
- slotState = new OneToManyAggregatorSlotState(eObject, eReference);
- }
- }
- else {
- if (eOppositeReference.isMany()) {
- slotState = new OneToManyElementSlotState(eObject, eReference);
- }
- else {
- slotState = new OneToOneSlotState(eObject, eReference);
- }
- }
- }
- else if (eReference.isContainment()) {
- if (eReference.isMany()) {
- slotState = new OneToManyAggregatorSlotState(eObject, eReference);
- }
- else {
- slotState = new OneToOneSlotState(eObject, eReference);
- }
- }
- else if (eReference == OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER) {
- slotState = new OneToManyElementSlotState(eObject, eReference); //FIXME may be many
- }
- else { // Unidirectional non-containment EReference
- slotState = new SimpleSlotState(eObject, eFeature);
- }
- }
- objectState.put(eFeature, slotState);
- }
- return slotState;
- }
-
- @Override
- public @NonNull Iterable<@NonNull ? extends SlotState> getSlotStates(@NonNull Object object) {
- Map<@NonNull EStructuralFeature, @NonNull BasicSlotState> feature2slotState = object2feature2slotState.get(object);;
- return feature2slotState != null ? feature2slotState.values() : EMPTY_SLOT_STATE_LIST;
- }
-
- @Override
- public synchronized void getting(@NonNull Object eObject, /*@NonNull*/ EStructuralFeature eFeature, boolean isOpposite) {
- assert eFeature != null;
- if (debugTracing) {
- AbstractTransformer.INVOCATIONS.println("getting " + eFeature.getEContainingClass().getName() + "::" + eFeature.getName() + " for " + eObject);
- }
- SlotState slotState = getSlotState(eObject, eFeature);
- slotState.getting(eObject, eFeature);
- }
-
- @Override
- public void got(Invocation.@NonNull Incremental invocation, @NonNull Object eObject, /*@NonNull*/ EStructuralFeature eFeature, @Nullable Object ecoreValue) {
- assert eFeature != null;
- BasicSlotState slotState = getSlotState(eObject, eFeature);
- invocation.addReadSlot(slotState);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/evaluation/tx/LazyInvocationManager.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/evaluation/tx/LazyInvocationManager.java
deleted file mode 100644
index adf7233..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/evaluation/tx/LazyInvocationManager.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\internal\evaluation\LazyInvocationManager.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2013, 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.internal.evaluation.tx;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.ocl.pivot.evaluation.tx.AbstractInvocationManager;
-import org.eclipse.ocl.pivot.evaluation.tx.AbstractTransformer;
-import org.eclipse.ocl.pivot.evaluation.tx.Invocation;
-import org.eclipse.ocl.pivot.evaluation.tx.InvocationFailedException;
-import org.eclipse.ocl.pivot.evaluation.tx.SlotState;
-
-/**
- * InvocationManager supervises and provides thread safety for the lists of blocked and waiting invocations.
- * @since 1.1
- */
-public class LazyInvocationManager extends AbstractInvocationManager
-{
- /**
- * Head of doubly linked list of blocked invocations.
- */
- private @Nullable AbstractInvocationInternal blockedInvocations = null;
-
- /**
- * Head of doubly linked list of unblocked invocations waiting for a re-execution attempt.
- */
- private @Nullable AbstractInvocationInternal waitingInvocations = null;
-
- protected final boolean debugTracing = AbstractTransformer.INVOCATIONS.isActive();
-
- private synchronized void block(@NonNull Invocation invocation, @NonNull SlotState slotState) {
- AbstractInvocationInternal castInvocation = (AbstractInvocationInternal) invocation;
- assert castInvocation.debug_blockedBy == null;
- castInvocation.debug_blockedBy = slotState;
- AbstractInvocationInternal blockedInvocations2 = blockedInvocations;
- if (blockedInvocations2 == null) {
- blockedInvocations = castInvocation;
- }
- else {
- castInvocation.insertAfter(blockedInvocations2.prev);
- }
- slotState.block(invocation);
- if (debugTracing) {
- AbstractTransformer.INVOCATIONS.println("block " + invocation + " for " + slotState);
- }
- }
-
- @Override
- public boolean flush() throws ReflectiveOperationException {
- flushInternal();
- AbstractInvocationInternal blockedInvocation = blockedInvocations;
- if (blockedInvocation == null) {
- return true;
- }
- do {
- if (debugTracing) {
- AbstractTransformer.INVOCATIONS.println("still blocked " + blockedInvocation + " by " + blockedInvocation.debug_blockedBy);
- }
- blockedInvocation = blockedInvocation.next;
- }
- while (blockedInvocation != blockedInvocations);
- return false;
- }
-
- private void flushInternal() throws ReflectiveOperationException {
- while (waitingInvocations != null) {
- AbstractInvocationInternal invocation = null;
- synchronized (this) {
- AbstractInvocationInternal waitingInvocations2 = waitingInvocations;
- if (waitingInvocations2 != null) {
- invocation = waitingInvocations2;
- waitingInvocations = waitingInvocations2.next;
- if (waitingInvocations == invocation) {
- waitingInvocations = null;
- }
- invocation.remove();
- }
- }
- if (invocation != null) {
- if (debugTracing) {
- AbstractTransformer.INVOCATIONS.println("re-invoke " + invocation);
- }
- invoke(invocation, false);
- }
- }
- }
-
- @Override
- public void invoke(@NonNull Invocation invocation, boolean doFlush) throws ReflectiveOperationException {
- try {
- invocation.execute();
- if (debugTracing) {
- AbstractTransformer.INVOCATIONS.println("done " + invocation);
- }
- if (doFlush) {
- flushInternal();
- }
- }
- catch (InvocationFailedException e) {
- block(invocation, e.slotState);
- }
- }
-
- @Override
- public synchronized void unblock(@NonNull Invocation invocation) {
- if (debugTracing) {
- AbstractTransformer.INVOCATIONS.println("unblock " + invocation);
- }
- AbstractInvocationInternal castInvocation = (AbstractInvocationInternal) invocation;
- assert castInvocation.debug_blockedBy != null;
- castInvocation.debug_blockedBy = null;
- if (blockedInvocations == castInvocation) {
- blockedInvocations = castInvocation.next;
- if (blockedInvocations == castInvocation) {
- blockedInvocations = null;
- }
- }
- castInvocation.remove();
- AbstractInvocationInternal waitingInvocations2 = waitingInvocations;
- if (waitingInvocations2 == null) {
- waitingInvocations = castInvocation;
- }
- else {
- castInvocation.insertAfter(waitingInvocations2.prev);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/evaluation/tx/LazyObjectManager.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/evaluation/tx/LazyObjectManager.java
deleted file mode 100644
index 3656d51..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/evaluation/tx/LazyObjectManager.java
+++ /dev/null
@@ -1,985 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\internal\evaluation\LazyObjectManager.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2013, 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.internal.evaluation.tx;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EGenericType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.EReferenceImpl;
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.ocl.pivot.oclstdlib.OCLstdlibPackage;
-import org.eclipse.ocl.pivot.evaluation.tx.AbstractObjectManager;
-import org.eclipse.ocl.pivot.evaluation.tx.AbstractSlotState;
-import org.eclipse.ocl.pivot.evaluation.tx.AbstractTransformer;
-import org.eclipse.ocl.pivot.evaluation.tx.Invocation;
-import org.eclipse.ocl.pivot.evaluation.tx.InvocationFailedException;
-import org.eclipse.ocl.pivot.evaluation.tx.ObjectManager;
-import org.eclipse.ocl.pivot.evaluation.tx.SlotState;
-
-/**
- * @since 1.1
- */
-public class LazyObjectManager extends AbstractObjectManager
-{
- /**
- * EOppositeReferenceImpl is used internally to reify the missing EReference.eOpposite. The instances should not be used
- * externally since they violate many WFRs. Only getEOpposite() is useful.
- */
- protected static class EOppositeReferenceImpl extends EReferenceImpl
- {
- public EOppositeReferenceImpl(@NonNull EReference eReference) {
- assert eReference.getEOpposite() == null;
- setEOpposite(eReference);
- }
-
- @Override
- public EClass basicGetEReferenceType() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public EClassifier basicGetEType() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public EClass getEContainingClass() {
- return getEOpposite().getEReferenceType();
- }
-
- @Override
- public EGenericType getEGenericType() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public EClass getEReferenceType() {
- return getEOpposite().getEContainingClass();
- }
-
- @Override
- public EClassifier getEType() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public int getLowerBound() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String getName() {
- return "«opposite»" + getEOpposite().getName();
- }
-
- @Override
- public String getNameGen() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public int getUpperBound() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean isChangeable() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean isContainer() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean isContainment() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean isDerived() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean isOrdered() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean isTransient() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean isUnique() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean isVolatile() {
- throw new UnsupportedOperationException();
- }
- }
-
- /**
- * Simple SlotState describing a DataType element or 1:1 Object navigation.
- */
- public static abstract class BasicSlotState extends AbstractSlotState
- {
- public enum SlotMode {
- ASSIGNABLE, // No assignment has been performed, object reads are blocked (collections reads may be unblocked)
- ASSIGNED // Last assignment has been performed, reads are unblocked
- }
-
- protected final @NonNull Object debug_eObject;
- protected final @NonNull EStructuralFeature debug_eFeature;
- protected @NonNull SlotMode mode;
- private @Nullable Object blockedInvocations = null;
-
- protected BasicSlotState(@NonNull Object eObject, @NonNull EStructuralFeature eFeature) {
- mode = SlotMode.ASSIGNABLE;
- this.debug_eObject = eObject;
- this.debug_eFeature = eFeature;
- }
-
- protected BasicSlotState(@NonNull Object eObject, @NonNull EStructuralFeature eFeature, @Nullable Object ecoreValue) {
- mode = SlotMode.ASSIGNED;
- this.debug_eObject = eObject;
- this.debug_eFeature = eFeature;
- assert !(eFeature instanceof EOppositeReferenceImpl);
- }
-
- public synchronized void assigned(@NonNull LazyObjectManager objectManager, @NonNull Object eObject, @NonNull EStructuralFeature eFeature, @Nullable Object ecoreValue) {
- switch (mode) {
- case ASSIGNABLE:
- mode = SlotMode.ASSIGNED;
- unblock(objectManager);
- break;
- case ASSIGNED:
- System.out.println("Re-assignment of " + eFeature.getEContainingClass().getName() + "::" + eFeature.getName() + " for " + eObject + " with " + ecoreValue);
- break;
- }
- }
-
- @Override
- public synchronized void block(@NonNull Invocation invocation) {
- final Object blockedInvocations2 = blockedInvocations;
- if (blockedInvocations2 == null) {
- blockedInvocations = invocation;
- }
- else if (blockedInvocations2 instanceof Invocation) {
- List<Invocation> blockedInvocationList = new ArrayList<Invocation>();
- blockedInvocationList.add((Invocation) blockedInvocations2);
- blockedInvocationList.add(invocation);
- blockedInvocations = blockedInvocationList;
- }
- else {
- @SuppressWarnings("unchecked")
- List<Invocation> blockedInvocationList = (List<Invocation>)blockedInvocations2;
- blockedInvocationList.add(invocation);
- }
- }
-
- @Override
- public synchronized void getting(@NonNull Object eObject, @NonNull EStructuralFeature eFeature) {
- switch (mode) {
- case ASSIGNABLE:
- throw new InvocationFailedException(this);
- case ASSIGNED:
- break;
- }
- }
-
- protected boolean isAssigned() {
- return mode == SlotMode.ASSIGNED;
- }
-
- @Override
- public String toString() {
- StringBuilder s = new StringBuilder();
- s.append(getClass().getSimpleName());
- s.append("@");
- s.append(Integer.toHexString(System.identityHashCode(this)));
- s.append("[");
- s.append(debug_eFeature.getEContainingClass().getName());
- s.append("::");
- s.append(debug_eFeature.getName());
- s.append(" for ");
- s.append(debug_eObject);
- s.append("]");
- return s.toString();
- }
-
- protected synchronized void unblock(@NonNull ObjectManager objectManager) {
- final Object blockedInvocations2 = blockedInvocations;
- if (blockedInvocations2 instanceof Invocation) {
- objectManager.unblock((Invocation) blockedInvocations2);
- }
- else if (blockedInvocations2 != null) {
- @SuppressWarnings("unchecked")
- List<Invocation> blockedInvocationList = (List<Invocation>)blockedInvocations2;
- for (@SuppressWarnings("null")@NonNull Invocation invocation : blockedInvocationList) {
- objectManager.unblock(invocation);
- }
- }
- blockedInvocations = null;
- }
- }
-
- /**
- * SlotState describing the contained element side of a 1:N Object navigation.
- * A single OneToManyContainedSlotState is shared by each of the possible containing features and also the
- * generic OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER corresponding to eContainer().
- * The eGet() must therefore check not only that the proprty is assigned but also that it is
- * assigned to the containing feature of interest.
- * <br>
- * Lifecycle (read first, write later):
- * Create due to
- * - get of an aggregator => ASSIGNABLE, blocked
- * Unblock
- * - assign of possibly null aggregator for the element, ASSIGNABLE, blocked => ASSIGNED, not blocked
- * - non-null aggregator is notified to unblock
- * Thereafter
- * - get of aggregator ASSIGNED => ASSIGNED
- * <br>
- * Lifecycle (write first):
- * Create due to
- * - assign of a possibly null aggregator => ASSIGNED, unblocked
- * - non-null aggregator is notified to unblock
- * Thereafter
- * - get of aggregator ASSIGNED => ASSIGNED
- *
- private static class ContainedSlotState extends SlotState
- {
- public static @NonNull SlotState create(@NonNull ObjectManager objectManager,
- @NonNull EObject eObject, @NonNull EReference eFeature, @Nullable EReference eOppositeFeature, @Nullable EObject eContainer) {
- if (eOppositeFeature == null) {
- eOppositeFeature = OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER;
- assert eOppositeFeature != null;
- }
- if (eContainer != null) {
- ContainerSlotState aggregatorSlotState = (ContainerSlotState) objectManager.getSlotState(eContainer, eOppositeFeature);
- aggregatorSlotState.assignedElement(objectManager, eContainer, eOppositeFeature, eObject);
- }
- return new ContainedSlotState(eObject, eFeature, eContainer);
- }
-
- public ContainedSlotState(@NonNull EObject eObject, @NonNull EReference eFeature) {
- super(eObject, eFeature);
- assert !eFeature.isMany();
- if (eFeature != OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER) { // FIXME ensure oclContainer() composes
- assert eFeature.isContainment();
- assert eFeature.getEOpposite() != null;
- }
-// assert eFeature.getEOpposite().isMany();
- }
-
- private ContainedSlotState(@NonNull EObject eObject, @NonNull EReference eFeature, @Nullable EObject eContainer) {
- super(eObject, eFeature, eContainer);
- assert !eFeature.isMany();
- if (eFeature != OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER) { // FIXME ensure oclContainer() composes
- assert eFeature.isContainment();
- }
-// assert eFeature.getEOpposite().isMany();
- assert eObject.eContainer() == eContainer;
- }
-
- @Override
- public synchronized void assigned(@NonNull ObjectManager objectManager, @NonNull EObject eObject, @NonNull EStructuralFeature eFeature, @Nullable Object ecoreValue) {
- if (!isAssigned() && (ecoreValue != null)) {
- EObject eOpposite = (EObject) ecoreValue;
- EReference eOppositeReference = ((EReference)eFeature).getEOpposite();
- assert eOppositeReference != null;
- ContainerSlotState aggregatorSlotState = (ContainerSlotState) objectManager.getSlotState(eOpposite, eOppositeReference);
- aggregatorSlotState.assignedElement(objectManager, eOpposite, eOppositeReference, eObject);
- }
- super.assigned(objectManager, eObject, eFeature, ecoreValue);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public synchronized @Nullable <G> G get(@NonNull ObjectManager objectManager, @NonNull EObject eObject, @NonNull EStructuralFeature eFeature) {
- switch (mode) {
- case ASSIGNABLE:
- throw new InvocationFailedException(this);
- case ASSIGNED:
- break;
- }
- if (eFeature != OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER) {
- EStructuralFeature eContainingFeature = eObject.eContainingFeature();
- if (eContainingFeature != eFeature) {
- return null;
- }
- }
- return (G) eObject.eContainer();
- }
- } */
-
- /**
- * SlotState describing the container side of a 1:N Object navigation.
- * <br>
- * Lifecycle:
- * Create due to
- * - get of all elements => ASSIGNABLE, blocked
- * NO: - get of a container => ASSIGNABLE, blocked
- * Create due to
- * - assign of all elements => ASSIGNABLE => ASSIGNED, not blocked
- * - assign of a first element to the container => ASSIGNABLE, not blocked
- * Update due to
- * - assign of a further element to the container => ASSIGNABLE => ASSIGNABLE
- * Unblock due to
- * - get of a container ASSIGNABLE => ASSIGNED
- * - get of all elements ASSIGNABLE => ASSIGNED
- * Thereafter
- * - get of a container ASSIGNED => ASSIGNED
- * - get of all elements ASSIGNED => ASSIGNED
- * <br>
- * Lifecycle 2: read first
- * Create due to
- * - get of elements => ASSIGNABLE, blocked
- * Unblock due to
- * - assign of an element to the container => ASSIGNABLE => ASSIGNED, not blocked
- * Thereafter
- * - get of either end ASSIGNED => ASSIGNED
- * - (assign of either end is an ignored error)
- *
- private static class ContainerSlotState extends SlotState
- {
- public static @NonNull SlotState create(@NonNull ObjectManager objectManager,
- @NonNull EObject eObject, @NonNull EReference eFeature, @NonNull EReference eOppositeFeature, @Nullable EObject eContent) {
- if (eContent != null) {
- ContainedSlotState containedSlotState = (ContainedSlotState) objectManager.getSlotState(eContent, eOppositeFeature);
- containedSlotState.assigned(objectManager, eContent, eOppositeFeature, eObject);
- }
- return new ContainerSlotState(eObject, eFeature, eContent);
- }
-
- public ContainerSlotState(@NonNull EObject eContainer, @NonNull EReference eFeature) {
- super(eContainer, eFeature);
- assert eFeature.isContainer();
-// assert eFeature.isMany();
-// assert eFeature.getEOpposite() != null;
-// assert eFeature.getEOpposite().isMany();
- }
-
- public ContainerSlotState(@NonNull EObject eContainer, @NonNull EReference eFeature, @Nullable Object elements) {
- super(eContainer, eFeature, elements);
- assert eFeature.isContainer();
-// assert eFeature.isMany();
-// assert eFeature.getEOpposite() != null;
-// assert eFeature.getEOpposite().isMany();
- assert eContainer.eGet(eFeature) == eContainer;
- }
-
- @Override
- public synchronized void assigned(@NonNull ObjectManager objectManager, @NonNull EObject eObject, @NonNull EStructuralFeature eFeature, @Nullable Object ecoreValue) {
- assert ecoreValue != null;
- @SuppressWarnings("unchecked")
- List<? extends EObject> ecoreValues = (List<? extends EObject>)ecoreValue;
- EReference eOppositeReference = ((EReference)eFeature).getEOpposite();
- for (EObject element : ecoreValues) {
- if (element != null) {
- Map<EStructuralFeature, SlotState> elementObjectState = objectManager.getObjectState(element);
- elementObjectState.put(eOppositeReference, this);
- }
- }
- super.assigned(objectManager, eObject, eFeature, ecoreValue);
-
- }
-
- public void assignedElement(@NonNull ObjectManager objectManager,
- @NonNull EObject eContainer, @NonNull EReference eReference, EObject eObject) {
- super.assigned(objectManager, eContainer, eReference, eObject);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public synchronized @Nullable <G> G get(@NonNull ObjectManager objectManager, @NonNull EObject eObject, @NonNull EStructuralFeature eFeature) {
- switch (mode) {
- case ASSIGNABLE:
- mode = PropertyMode.ASSIGNED;
- unblock(objectManager);
- break;
- case ASSIGNED:
- break;
- }
- return (G) eObject.eGet(eFeature);
- }
- } */
-
- /**
- * SlotState describing an M:N Object navigation.
- */
- class ManyToManySlotState extends BasicSlotState
- {
- public ManyToManySlotState(@NonNull Object eObject, @NonNull EStructuralFeature eFeature) {
- super(eObject, eFeature);
- throw new UnsupportedOperationException();
- }
-
- @Override
- public synchronized void assigned(@NonNull Object eObject, @NonNull EStructuralFeature eFeature, @Nullable Object ecoreValue) {
- throw new UnsupportedOperationException();
- }
- }
-
- /**
- * SlotState describing the aggregator side of a 1:N Object navigation.
- * <br>
- * Lifecycle:
- * Create due to
- * - get of all elements => ASSIGNABLE, blocked
- * NO: - get of an aggregator => ASSIGNABLE, blocked
- * Create due to
- * - assign of all elements => ASSIGNABLE => ASSIGNED, not blocked
- * - assign of a first element to the aggregator => ASSIGNABLE, not blocked
- * Update due to
- * - assign of a further element to the aggregator => ASSIGNABLE => ASSIGNABLE
- * Unblock due to
- * - get of an aggregator ASSIGNABLE => ASSIGNED
- * - get of all elements ASSIGNABLE => ASSIGNED
- * Thereafter
- * - get of an aggregator ASSIGNED => ASSIGNED
- * - get of all elements ASSIGNED => ASSIGNED
- * <br>
- * Lifecycle 2: read first
- * Create due to
- * - get of elements => ASSIGNABLE, blocked
- * Unblock due to
- * - assign of an element to the aggregator => ASSIGNABLE => ASSIGNED, not blocked
- * Thereafter
- * - get of either end ASSIGNED => ASSIGNED
- * - (assign of either end is an ignored error)
- */
- class OneToManyAggregatorSlotState extends BasicSlotState
- {
-
-// public static @NonNull SlotState create(@NonNull ObjectManager objectManager,
-// EObject eObject, @NonNull EReference eFeature, EReference eOppositeReference, Object ecoreValue) {
-// // TODO Auto-generated method stub
-// return null;
-// }
-
- public OneToManyAggregatorSlotState(@NonNull Object eContainer, @NonNull EStructuralFeature eFeature) {
- super(eContainer, eFeature);
- assert eFeature.isMany();
-// assert eFeature.getEOpposite() != null;
-// assert eFeature.getEOpposite().isMany();
- }
-
- private OneToManyAggregatorSlotState(@NonNull Object eContainer, @NonNull EStructuralFeature eFeature, @Nullable Object eContents) {
- super(eContainer, eFeature, eContents);
- assert eFeature.isMany();
-// assert eFeature.getEOpposite() != null;
-// assert eFeature.getEOpposite().isMany();
- assert ((EObject)eContainer).eGet(eFeature).equals(eContents);
- }
-
- @Override
- public synchronized void assigned(@NonNull Object eObject, @NonNull EStructuralFeature eFeature, @Nullable Object ecoreValue) {
- assert ecoreValue != null;
- @SuppressWarnings("unchecked")
- List<? extends EObject> ecoreValues = (List<? extends EObject>)ecoreValue;
- EReference eOppositeReference = ((EReference)eFeature).getEOpposite();
- for (EObject element : ecoreValues) {
- if (element != null) {
- Map<EStructuralFeature, SlotState> elementObjectState = getObjectState(element);
- elementObjectState.put(eOppositeReference, this);
- }
- }
-// super.assigned(objectManager, eObject, eFeature, ecoreValue);
- assignedElement(eObject, (EReference)eFeature, (EObject)ecoreValue);
- }
-
- public void assignedElement(@NonNull Object eContainer, @NonNull EReference eReference, Object eObject) {
-// super.assigned(objectManager, eContainer, eReference, eObject);
- switch (mode) {
- case ASSIGNABLE:
- mode = SlotMode.ASSIGNED;
- unblock(LazyObjectManager.this);
- break;
- case ASSIGNED:
- break;
- }
- }
-
- @Override
- public synchronized void getting(@NonNull Object eObject, @NonNull EStructuralFeature eFeature) {
- switch (mode) {
- case ASSIGNABLE:
- mode = SlotMode.ASSIGNED;
- unblock(LazyObjectManager.this);
- break;
- case ASSIGNED:
- break;
- }
- }
- }
-
- /**
- * SlotState describing the element side of a 1:N Object navigation.
- * <br>
- * Lifecycle (read first, write later):
- * Create due to
- * - get of an aggregator => ASSIGNABLE, blocked
- * Unblock
- * - assign of possibly null aggregator for the element, ASSIGNABLE, blocked => ASSIGNED, not blocked
- * - non-null aggregator is notified to unblock
- * Thereafter
- * - get of aggregator ASSIGNED => ASSIGNED
- * <br>
- * Lifecycle (write first):
- * Create due to
- * - assign of a possibly null aggregator => ASSIGNED, unblocked
- * - non-null aggregator is notified to unblock
- * Thereafter
- * - get of aggregator ASSIGNED => ASSIGNED
- */
- class OneToManyElementSlotState extends BasicSlotState
- {
- public OneToManyElementSlotState(@NonNull Object eObject, @NonNull EReference eFeature) {
- super(eObject, eFeature);
- assert !eFeature.isMany();
- if (eFeature == OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER) {
- assert eFeature.getEOpposite() == null;
- }
- else {
- assert eFeature.getEOpposite() != null;
- assert eFeature.getEOpposite().isMany();
- }
- }
-
- public OneToManyElementSlotState(@NonNull Object eObject, @NonNull EReference eFeature, @NonNull Object eAggregator) {
- super(eObject, eFeature, eAggregator);
- assert !eFeature.isMany();
- assert eFeature.getEOpposite() != null;
- assert eFeature.getEOpposite().isMany();
- if (eFeature == OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER) {
- assert ((EObject)eObject).eContainer() == eAggregator;
- }
- else {
- assert ((EObject)eObject).eGet(eFeature) == eAggregator;
- }
- }
-
- @Override
- public synchronized void assigned(@NonNull Object eObject, @NonNull EStructuralFeature eFeature, @Nullable Object ecoreValue) {
- if (!isAssigned() && (ecoreValue != null)) {
- EObject eOpposite = (EObject) ecoreValue;
- EReference eOppositeReference = ((EReference)eFeature).getEOpposite();
- if (eFeature == OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER) {
- eOppositeReference = ((EObject)eObject).eContainmentFeature();
- assert eOppositeReference != null;
- SlotState aggregatorSlotState = getSlotState(eOpposite, eOppositeReference);
- aggregatorSlotState.assigned(eOpposite, eOppositeReference, eObject);
- }
- else {
- assert eOppositeReference != null;
- OneToManyAggregatorSlotState aggregatorSlotState = (OneToManyAggregatorSlotState) getSlotState(eOpposite, eOppositeReference);
- aggregatorSlotState.assignedElement(eOpposite, eOppositeReference, eObject);
- }
- }
- assigned(LazyObjectManager.this, eObject, eFeature, ecoreValue);
- }
- }
-
- /**
- * SlotState describing a 1:1 Object navigation. Both ends are assigned exactly once. The remote assignment
- * may be null.
- * <br>
- * Lifecycle 1: write first
- * Create due to
- * - assign of possibly null eOpposite => ASSIGNED
- * Thereafter
- * - get of either end ASSIGNED => ASSIGNED
- * - (assign of either end is an ignored error)
- * <br>
- * Lifecycle 2: read first
- * Create due to
- * - get of other end => ASSIGNABLE_BLOCKED
- * Unblock due to
- * - assign of a further element to the aggregator => ASSIGNABLE_BLOCKED => ASSIGNED
- * Thereafter
- * - get of either end ASSIGNED => ASSIGNED
- * - (assign of either end is an ignored error)
- */
- class OneToOneSlotState extends BasicSlotState
- {
-/* public static @NonNull <G,S> SlotState createContainer(@NonNull ObjectManager objectManager,
- @NonNull EObject eObject, @NonNull EReference eFeature, @Nullable EReference eOppositeFeature, @Nullable EObject eOpposite) {
- Map<EStructuralFeature, SlotState> oppositeObjectState = null;
- if (eOpposite != null) {
- oppositeObjectState = objectManager.getObjectState(eObject);
- SlotState slotState = oppositeObjectState.get(eOppositeFeature);
- if (slotState != null) {
- return slotState;
- }
- }
- SlotState slotState = new OneToOneSlotState(eObject, eFeature, eOpposite);
- if (oppositeObjectState != null) {
- oppositeObjectState.put(eOppositeFeature, slotState);
- }
- return slotState;
- } */
-
- public OneToOneSlotState(@NonNull Object eObject, @NonNull EReference eFeature) {
- super(eObject, eFeature);
- if (eFeature instanceof EOppositeReferenceImpl) {
- assert !(((EOppositeReferenceImpl)eFeature).getEOpposite().isMany());
- }
- else {
- assert !eFeature.isMany();
- if (eFeature.isContainer()) {
- // assert eObject.eContainer() == eOpposite;
- }
- else if (eFeature.isContainment()) {
- // assert eOpposite != null;
- // assert eObject == eOpposite.eContainer();
- }
- else if (eFeature == OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER) {
- // slotState = new OneToOneSlotState(eObject, eReference);
- }
- else {
- assert eFeature.getEOpposite() != null;
- assert !eFeature.getEOpposite().isMany();
- }
- }
- }
-
- private OneToOneSlotState(@NonNull Object eObject, @NonNull EReference eFeature, @Nullable Object eOpposite) {
- super(eObject, eFeature, eOpposite);
- assert !eFeature.isMany();
- if (eFeature.isContainer()) {
- assert ((EObject)eObject).eContainer() == eOpposite;
- }
- else if (eFeature.isContainment()) {
- assert eOpposite != null;
- assert eObject == ((EObject)eOpposite).eContainer();
- }
- else {
- assert eFeature.getEOpposite() != null;
- assert !eFeature.getEOpposite().isMany();
- assert ((EObject)eObject).eGet(eFeature) == eOpposite;
- }
- }
-
- @Override
- public void assigned(@NonNull Object eObject, @NonNull EStructuralFeature eFeature, @Nullable Object ecoreValue) {
- assigned(LazyObjectManager.this, eObject, eFeature, ecoreValue);
- }
- }
-
- /**
- * Simple SlotState describing a DataType element or 1:1 Object navigation.
- */
- class SimpleSlotState extends BasicSlotState
- {
- public SimpleSlotState(@NonNull Object eObject, @NonNull EStructuralFeature eFeature) {
- super(eObject, eFeature);
- }
-
- public SimpleSlotState(@NonNull Object eObject, @NonNull EStructuralFeature eFeature, @Nullable Object ecoreValue) {
- super(eObject, eFeature, ecoreValue);
- }
-
- @Override
- public void assigned(@NonNull Object eObject, @NonNull EStructuralFeature eFeature, @Nullable Object ecoreValue) {
- assigned(LazyObjectManager.this, eObject, eFeature, ecoreValue);
- }
- }
-
- protected final boolean debugTracing = AbstractTransformer.INVOCATIONS.isActive();
-
- /**
- * This unpleasant Map of Maps is a pathfinder before embarking on slotted objects that merge user and overhead
- * in a single object. The first map is then a null lookup and the nested map is an index within the object.
- */
- private @NonNull Map<@NonNull Object, @NonNull Map<@NonNull EStructuralFeature, @NonNull SlotState>> object2feature2slotState = new HashMap<@NonNull Object, @NonNull Map<@NonNull EStructuralFeature, @NonNull SlotState>>();
-
- /**
- * Map of helper objects to reify missing EReference::eOpposites. Only used as a semantically inverse handle on the available EReference.
- */
- private @NonNull Map<@NonNull EReference, @NonNull EOppositeReferenceImpl> eReference2eOppositeReference = new HashMap<@NonNull EReference, @NonNull EOppositeReferenceImpl>();
-
- public LazyObjectManager(@NonNull LazyInvocationManager invocationManager) {
- super(invocationManager);
- }
-
- @Override
- public synchronized void assigned(@NonNull Object eObject, /*@NonNull*/ EStructuralFeature eFeature, @Nullable Object ecoreValue, @Nullable Object childKey) {
- assert eFeature != null;
- if (debugTracing) {
- AbstractTransformer.INVOCATIONS.println("assigned " + eFeature.getEContainingClass().getName() + "::" + eFeature.getName() + " for " + eObject + " = " + ecoreValue);
- }
- Map<EStructuralFeature, SlotState> objectState = getObjectState(eObject);
- SlotState slotState = objectState.get(eFeature);
- if (slotState != null) {
- slotState.assigned(eObject, eFeature, ecoreValue);
- }
- else {
- if (eFeature instanceof EAttribute) {
- slotState = new SimpleSlotState(eObject, eFeature, ecoreValue);
- }
- else {
- EReference eReference = (EReference)eFeature;
- EReference eOppositeReference = eReference.getEOpposite();
- if (eOppositeReference != null) {
-// if (ecoreValue != null) {
-// Map<EStructuralFeature, SlotState> oppositeObjectState = getObjectState((EObject) ecoreValue);
-// SlotState oppositeSlotState = oppositeObjectState.get(eOppositeReference);
-// }
- if (eReference.isMany()) {
- assert ecoreValue != null;
- if (eOppositeReference.isMany()) {
- slotState = createManyToManySlotState(eObject, eReference, eOppositeReference);
- }
- else {
- slotState = createOneToManyAggregatorSlotState(eObject, eReference, eOppositeReference, ecoreValue);
- }
- }
- else if (ecoreValue != null) {
- if (eOppositeReference.isMany()) {
- slotState = createOneToManyElementSlotState(eObject, eReference, eOppositeReference, ecoreValue);
- }
-// else if (isIncremental) {
-// slotState = OneToOneSlotState.create(this, eObject, eReference, eOppositeReference, ecoreValue);
-// }
- }
- }
- else if (eReference.isContainment()) {
- assert ecoreValue != null;
- eOppositeReference = OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER;
- assert eOppositeReference != null;
- if (eReference.isMany()) {
- slotState = createOneToManyAggregatorSlotState(eObject, eReference, eOppositeReference, ecoreValue);
- }
- else {
- Map<@NonNull EStructuralFeature, @NonNull SlotState> oppositeObjectState = getObjectState(ecoreValue);
- slotState = oppositeObjectState.get(eOppositeReference);
- if (slotState != null) {
- slotState.assigned(ecoreValue, eOppositeReference, eObject);
- }
- else {
- slotState = createOneToOneSlotState(eObject, eReference, eOppositeReference, (EObject)ecoreValue);
- }
- }
- }
-// else if (eReference == OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER) {
-// slotState = OneToOneSlotState.create(this, eObject, eReference, eOppositeReference, (EObject)ecoreValue);
-// }
- else { // Unidirectional non-containment EReference
- if (ecoreValue != null) {
- eOppositeReference = getEOppositeReference(eReference);
- Map<EStructuralFeature, SlotState> oppositeObjectState = getObjectState(ecoreValue);
- slotState = oppositeObjectState.get(eOppositeReference);
- if (slotState == null) {
- slotState = new SimpleSlotState(eObject, eFeature, ecoreValue);
- oppositeObjectState.put(eOppositeReference, slotState);
- }
- else {
- slotState.assigned(ecoreValue, eOppositeReference, eObject);
- }
- }
- else {
- slotState = new SimpleSlotState(eObject, eFeature, ecoreValue);
-
- }
- }
- }
- objectState.put(eFeature, slotState);
- }
- }
-
- @Override
- public void assigned(Invocation.@NonNull Incremental invocation, @NonNull Object eObject, EStructuralFeature eFeature, @Nullable Object ecoreValue, @Nullable Object childKey) {
- assigned(eObject, eFeature, ecoreValue, childKey); // Delegate incremental API to non-incremental API
- }
-
- @NonNull SlotState createManyToManySlotState(
- @NonNull Object eObject, @NonNull EReference eFeature, @NonNull EReference eOppositeFeature) {
- throw new UnsupportedOperationException();
- }
-
- @NonNull SlotState createOneToManyAggregatorSlotState(
- @NonNull Object eObject, @NonNull EReference eFeature, @NonNull EReference eOppositeFeature, @Nullable Object eContents) {
- if (eContents != null) {
-// SlotState containedSlotState = objectManager.getSlotState(eContent, eOppositeFeature);
-// containedSlotState.assigned(objectManager, eContent, eOppositeFeature, eObject);
- }
- return new OneToManyAggregatorSlotState(eObject, eFeature, eContents);
- }
-
- @NonNull SlotState createOneToManyElementSlotState(
- @NonNull Object eObject, @NonNull EReference eFeature, @NonNull EReference eOppositeFeature, @NonNull Object eAggregator) {
- OneToManyAggregatorSlotState aggregatorSlotState = (OneToManyAggregatorSlotState) getSlotState(eAggregator, eOppositeFeature);
- aggregatorSlotState.assignedElement(eAggregator, eOppositeFeature, eObject);
- return new OneToManyElementSlotState(eObject, eFeature, eAggregator);
- }
-
- @NonNull <G,S> SlotState createOneToOneSlotState(
- @NonNull Object eObject, @NonNull EReference eFeature, @NonNull EReference eOppositeFeature, @Nullable Object eOpposite) {
- Map<EStructuralFeature, SlotState> oppositeObjectState = null;
- if (eOpposite != null) {
- oppositeObjectState = getObjectState(eOpposite);
- SlotState slotState = oppositeObjectState.get(eOppositeFeature);
- if (slotState != null) {
- return slotState;
- }
- }
- SlotState slotState = new OneToOneSlotState(eObject, eFeature, eOpposite);
- if (oppositeObjectState != null) {
- oppositeObjectState.put(eOppositeFeature, slotState);
- }
- return slotState;
- }
-
- @Override
- public void created(Invocation.@NonNull Incremental invocation, @NonNull Object eObject) {
- // Ignore incremental API
- }
-
- protected @NonNull EReference getEOppositeReference(@NonNull EReference eReference) {
- EReference eOppositeReference = eReference.getEOpposite();
- if (eOppositeReference == null) {
- EOppositeReferenceImpl eOppositeReference2 = eReference2eOppositeReference.get(eReference);
- if (eOppositeReference2 == null) {
- eOppositeReference2 = new EOppositeReferenceImpl(eReference);
- eReference2eOppositeReference.put(eReference, eOppositeReference2);
- }
- eOppositeReference = eOppositeReference2;
- }
- return eOppositeReference;
- }
-
- public @NonNull Map<@NonNull EStructuralFeature, @NonNull SlotState> getObjectState(@NonNull Object eObject) {
- Map<@NonNull EStructuralFeature, @NonNull SlotState> feature2state = object2feature2slotState.get(eObject);
- if (feature2state == null) {
- feature2state = new HashMap<@NonNull EStructuralFeature, @NonNull SlotState>();
- object2feature2slotState.put(eObject, feature2state);
- }
- return feature2state;
- }
-
- @Override
- public @NonNull Iterable<@NonNull ? extends Object> getObjects() {
- @NonNull Set<@NonNull Object> keySet = object2feature2slotState.keySet();
- return keySet;
- }
-
- public synchronized @NonNull SlotState getSlotState(@NonNull Object eObject, @NonNull EStructuralFeature eFeature) {
- assert eFeature != null;
- Map<@NonNull EStructuralFeature, @NonNull SlotState> objectState = getObjectState(eObject);
- SlotState slotState = objectState.get(eFeature);
- if (slotState == null) {
- if (eFeature instanceof EAttribute) {
- slotState = new SimpleSlotState(eObject, eFeature);
- }
- else {
- EReference eReference = (EReference)eFeature;
- EReference eOppositeReference = eReference.getEOpposite(); // FIXME there is always a Pivot opposite
- if (eReference instanceof EOppositeReferenceImpl) {
- if (eOppositeReference.isMany()) {
- slotState = new OneToManyElementSlotState(eObject, eReference);
- }
- else {
- slotState = new OneToOneSlotState(eObject, eReference);
- }
- }
- else if (eOppositeReference != null) {
- if (eReference.isMany()) {
- if (eOppositeReference.isMany()) {
- slotState = new ManyToManySlotState(eObject, eReference);
- }
- else {
- slotState = new OneToManyAggregatorSlotState(eObject, eReference);
- }
- }
- else {
- if (eOppositeReference.isMany()) {
- slotState = new OneToManyElementSlotState(eObject, eReference);
- }
- else {
- slotState = new OneToOneSlotState(eObject, eReference);
- }
- }
- }
- else if (eReference.isContainment()) {
- if (eReference.isMany()) {
- slotState = new OneToManyAggregatorSlotState(eObject, eReference);
- }
- else {
- slotState = new OneToOneSlotState(eObject, eReference);
- }
- }
- else if (eReference == OCLstdlibPackage.Literals.OCL_ELEMENT__OCL_CONTAINER) {
- slotState = new OneToManyElementSlotState(eObject, eReference); //FIXME may be many
- }
- else { // Unidirectional non-containment EReference
- slotState = new SimpleSlotState(eObject, eFeature);
- }
- }
- objectState.put(eFeature, slotState);
- }
- return slotState;
- }
-
- @Override
- public @NonNull Iterable<@NonNull SlotState> getSlotStates(@NonNull Object object) {
- Map<@NonNull EStructuralFeature, @NonNull SlotState> feature2slotState = object2feature2slotState.get(object);
- if (feature2slotState != null) {
- @NonNull Collection<@NonNull SlotState> values = feature2slotState.values();
- return values;
- }
- else {
- return EMPTY_SLOT_STATE_LIST;
- }
- }
-
- @Override
- public synchronized void getting(@NonNull Object eObject, /*@NonNull*/ EStructuralFeature eFeature, boolean isOpposite) {
- assert eFeature != null;
- if (debugTracing) {
- AbstractTransformer.INVOCATIONS.println("getting " + eFeature.getEContainingClass().getName() + "::" + eFeature.getName() + (isOpposite ? "<opposite> " : "") + " for " + eObject);
- }
- if (isOpposite) {
- eFeature = getEOppositeReference((EReference) eFeature);
- }
- SlotState slotState = getSlotState(eObject, eFeature);
- slotState.getting(eObject, eFeature);
- }
-
- @Override
- public void got(Invocation.@NonNull Incremental invocation, @NonNull Object eObject, EStructuralFeature eFeature, @Nullable Object ecoreValue) {
- // Ignore incremental API
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/labels/LabelGeneratorRegistry.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/labels/LabelGeneratorRegistry.java
deleted file mode 100644
index a4afa75..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/labels/LabelGeneratorRegistry.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\labels\LabelGeneratorRegistry.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2010, 2014 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.internal.labels;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.ocl.pivot.labels.ILabelGenerator;
-
-/**
- * DebugString supports generation of debug identification of objects, determining a name usuing
- * the following alternatives.
- * <br>The null object is identified as <null-Object>
- * <br>Implementers of IDebugString are identified by IDebugString.toDebugString();
- * <br>MethodCall registrations in DebugUtils are identified by MethodCall.invoke().
- * <br>Other objects are identified as <unknown-'class-name' 'object.toString()'>
- * <p>
- * MethodCall registrations may be made via registerInstanceMethod or registerStaticMethod.
- * <p>
- * A debug string may be obtained via DebugString.toDebug(object).
- * <p>
- * DebugString providers string formatters for simple classes such as String, Number, Boolean
- * and Ecore components such as EObject, Resource and ResourceSet.
- * <p>
- * User extensions should be registered prior to use. Beware that late registration can
- * give misleading results since in the absence of an exact MethodCall registration the
- * class hierarchy is search first for base classes then for instances for which there
- * is an exact MethodCall match. This result is then cached and so may occlude a late
- * registration.
- */
-public class LabelGeneratorRegistry
-{
- public static void initialize(ILabelGenerator.@NonNull Registry registry) {
- TransformationInstanceLabelGenerator.initialize(registry);
- TypedModelInstanceLabelGenerator.initialize(registry);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/labels/TransformationInstanceLabelGenerator.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/labels/TransformationInstanceLabelGenerator.java
deleted file mode 100644
index 739b98d..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/labels/TransformationInstanceLabelGenerator.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\labels\TransformationInstanceLabelGenerator.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.internal.labels;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.ocl.pivot.labels.AbstractLabelGenerator;
-import org.eclipse.ocl.pivot.evaluation.tx.TransformationInstance;
-
-/**
- * @since 1.1
- */
-public final class TransformationInstanceLabelGenerator extends AbstractLabelGenerator<TransformationInstance>
-{
- public static void initialize(Registry registry) {
- registry.install(TransformationInstance.class, new TransformationInstanceLabelGenerator());
- }
-
- public TransformationInstanceLabelGenerator() {
- super(TransformationInstance.class);
- }
-
- @Override
- public void buildLabelFor(@NonNull Builder labelBuilder, @NonNull TransformationInstance element) {
- labelBuilder.appendString(element.getName());
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/labels/TypedModelInstanceLabelGenerator.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/labels/TypedModelInstanceLabelGenerator.java
deleted file mode 100644
index caee9f3..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/internal/labels/TypedModelInstanceLabelGenerator.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\labels\TypedModelInstanceLabelGenerator.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.internal.labels;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.ocl.pivot.labels.AbstractLabelGenerator;
-import org.eclipse.ocl.pivot.evaluation.tx.TypedModelInstance;
-
-/**
- * @since 1.1
- */
-public final class TypedModelInstanceLabelGenerator extends AbstractLabelGenerator<TypedModelInstance>
-{
- public static void initialize(Registry registry) {
- registry.install(TypedModelInstance.class, new TypedModelInstanceLabelGenerator());
- }
-
- public TypedModelInstanceLabelGenerator() {
- super(TypedModelInstance.class);
- }
-
- @Override
- public void buildLabelFor(@NonNull Builder labelBuilder, @NonNull TypedModelInstance element) {
- labelBuilder.appendString(element.getName());
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/library/model/AllObjectsOperation.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/library/model/AllObjectsOperation.java
deleted file mode 100644
index af31633..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/library/model/AllObjectsOperation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\library\model\AllObjectsOperation.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.library.model;
-
-import java.util.Collection;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.ocl.pivot.evaluation.Executor;
-import org.eclipse.ocl.pivot.ids.CollectionTypeId;
-import org.eclipse.ocl.pivot.ids.TypeId;
-import org.eclipse.ocl.pivot.library.AbstractUnaryOperation;
-import org.eclipse.ocl.pivot.messages.PivotMessages;
-import org.eclipse.ocl.pivot.values.InvalidValueException;
-import org.eclipse.ocl.pivot.values.SetValue;
-import org.eclipse.ocl.pivot.evaluation.tx.TypedModelInstance;
-
-/**
- * AllObjectsOperation realises the Model::allObjects() library operation.
- * @since 1.1
- */
-public class AllObjectsOperation extends AbstractUnaryOperation
-{
- public static final @NonNull AllObjectsOperation INSTANCE = new AllObjectsOperation();
-
- @Override
- public @NonNull SetValue evaluate(@NonNull Executor executor, @NonNull TypeId returnTypeId, @Nullable Object sourceVal) {
- if (!(sourceVal instanceof TypedModelInstance)) {
- throw new InvalidValueException(PivotMessages.TypedValueRequired, "TypedModelInstance", getTypeName(sourceVal));
- }
- TypedModelInstance typedModelInstance = (TypedModelInstance)sourceVal;
- Collection<@NonNull ? extends Object> results = typedModelInstance.getAllObjects();
- return createSetValue((CollectionTypeId)returnTypeId, results);
- }
-}
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/library/model/ModelObjectsOfKindOperation.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/library/model/ModelObjectsOfKindOperation.java
deleted file mode 100644
index 34e06f3..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/library/model/ModelObjectsOfKindOperation.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\library\model\ModelObjectsOfKindOperation.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.library.model;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.ocl.pivot.evaluation.Executor;
-import org.eclipse.ocl.pivot.ids.CollectionTypeId;
-import org.eclipse.ocl.pivot.ids.TypeId;
-import org.eclipse.ocl.pivot.library.AbstractBinaryOperation;
-import org.eclipse.ocl.pivot.messages.PivotMessages;
-import org.eclipse.ocl.pivot.values.InvalidValueException;
-import org.eclipse.ocl.pivot.values.SetValue;
-import org.eclipse.ocl.pivot.evaluation.tx.TypedModelInstance;
-
-/**
- * ModelObjectsOfKindOperation realises the Model::objectsOfKind() library operation.
- * @since 1.1
- */
-public class ModelObjectsOfKindOperation extends AbstractBinaryOperation
-{
- public static final @NonNull ModelObjectsOfKindOperation INSTANCE = new ModelObjectsOfKindOperation();
-
- @Override
- public @NonNull SetValue evaluate(@NonNull Executor executor, @NonNull TypeId returnTypeId, @Nullable Object sourceVal, @Nullable Object typeVal) {
- org.eclipse.ocl.pivot.Class type = asClass(typeVal);
- if (!(sourceVal instanceof TypedModelInstance)) {
- throw new InvalidValueException(PivotMessages.TypedValueRequired, "TypedModelInstance", getTypeName(sourceVal));
- }
- TypedModelInstance typedModelInstance = (TypedModelInstance)sourceVal;
- Collection<@NonNull ? extends Object> results = typedModelInstance.getObjectsOfKind(type);
- return createSetValue((CollectionTypeId)returnTypeId, new ArrayList<@NonNull Object>(results));
- }
-}
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/library/model/ModelObjectsOfTypeOperation.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/library/model/ModelObjectsOfTypeOperation.java
deleted file mode 100644
index 4ce1766..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/library/model/ModelObjectsOfTypeOperation.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\library\model\ModelObjectsOfTypeOperation.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.library.model;
-
-import java.util.Collection;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.ocl.pivot.evaluation.Executor;
-import org.eclipse.ocl.pivot.ids.CollectionTypeId;
-import org.eclipse.ocl.pivot.ids.TypeId;
-import org.eclipse.ocl.pivot.library.AbstractBinaryOperation;
-import org.eclipse.ocl.pivot.messages.PivotMessages;
-import org.eclipse.ocl.pivot.values.InvalidValueException;
-import org.eclipse.ocl.pivot.values.SetValue;
-import org.eclipse.ocl.pivot.evaluation.tx.TypedModelInstance;
-
-/**
- * ModelObjectsOfTypeOperation realises the Model::objectsOfType() library operation.
- * @since 1.1
- */
-public class ModelObjectsOfTypeOperation extends AbstractBinaryOperation
-{
- public static final @NonNull ModelObjectsOfTypeOperation INSTANCE = new ModelObjectsOfTypeOperation();
-
- @Override
- public @NonNull SetValue evaluate(@NonNull Executor executor, @NonNull TypeId returnTypeId, @Nullable Object sourceVal, @Nullable Object typeVal) {
- org.eclipse.ocl.pivot.Class type = asClass(typeVal);
- if (!(sourceVal instanceof TypedModelInstance)) {
- throw new InvalidValueException(PivotMessages.TypedValueRequired, "TypedModelInstance", getTypeName(sourceVal));
- }
- TypedModelInstance typedModelInstance = (TypedModelInstance)sourceVal;
- Collection<@NonNull ? extends Object> results = typedModelInstance.getObjectsOfType(type);
- return createSetValue((CollectionTypeId)returnTypeId, results);
- }
-}
diff --git a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/library/model/RootObjectsOperation.java b/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/library/model/RootObjectsOperation.java
deleted file mode 100644
index ab8e07e..0000000
--- a/plugins/org.eclipse.ocl.pivot/src-gen/org/eclipse/ocl/pivot/library/model/RootObjectsOperation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\library\model\RootObjectsOperation.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.pivot.library.model;
-
-import java.util.Collection;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.ocl.pivot.evaluation.Executor;
-import org.eclipse.ocl.pivot.ids.CollectionTypeId;
-import org.eclipse.ocl.pivot.ids.TypeId;
-import org.eclipse.ocl.pivot.library.AbstractUnaryOperation;
-import org.eclipse.ocl.pivot.messages.PivotMessages;
-import org.eclipse.ocl.pivot.values.InvalidValueException;
-import org.eclipse.ocl.pivot.values.SetValue;
-import org.eclipse.ocl.pivot.evaluation.tx.TypedModelInstance;
-
-/**
- * RootObjectsOperation realises the Model::rootObjects() library operation.
- * @since 1.1
- */
-public class RootObjectsOperation extends AbstractUnaryOperation
-{
- public static final @NonNull RootObjectsOperation INSTANCE = new RootObjectsOperation();
-
- @Override
- public @NonNull SetValue evaluate(@NonNull Executor executor, @NonNull TypeId returnTypeId, @Nullable Object sourceVal) {
- if (!(sourceVal instanceof TypedModelInstance)) {
- throw new InvalidValueException(PivotMessages.TypedValueRequired, "TypedModelInstance", getTypeName(sourceVal));
- }
- TypedModelInstance typedModelInstance = (TypedModelInstance)sourceVal;
- Collection<@NonNull ? extends Object> results = typedModelInstance.getRootObjects();
- return createSetValue((CollectionTypeId)returnTypeId, results);
- }
-}
diff --git a/plugins/org.eclipse.ocl.xtext.base/META-INF/MANIFEST.MF b/plugins/org.eclipse.ocl.xtext.base/META-INF/MANIFEST.MF
index 6269059..196bc04 100644
--- a/plugins/org.eclipse.ocl.xtext.base/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.ocl.xtext.base/META-INF/MANIFEST.MF
@@ -12,11 +12,6 @@
org.eclipse.ocl.xtext.base.as2cs,
org.eclipse.ocl.xtext.base.attributes,
org.eclipse.ocl.xtext.base.cs2as,
- org.eclipse.ocl.xtext.base.cs2as.tx;
- x-friends:="org.eclipse.ocl.xtext.completeocl,
- org.eclipse.ocl.xtext.essentialocl,
- org.eclipse.ocl.xtext.oclinecore,
- org.eclipse.ocl.xtext.oclstdlib",
org.eclipse.ocl.xtext.base.formatting,
org.eclipse.ocl.xtext.base.parser.antlr,
org.eclipse.ocl.xtext.base.parser.antlr.internal;x-friends:="org.eclipse.ocl.xtext.base.ui",
diff --git a/plugins/org.eclipse.ocl.xtext.base/src-gen/org/eclipse/ocl/xtext/base/cs2as/tx/AbstractCS2ASTransformer.java b/plugins/org.eclipse.ocl.xtext.base/src-gen/org/eclipse/ocl/xtext/base/cs2as/tx/AbstractCS2ASTransformer.java
deleted file mode 100644
index 794461a..0000000
--- a/plugins/org.eclipse.ocl.xtext.base/src-gen/org/eclipse/ocl/xtext/base/cs2as/tx/AbstractCS2ASTransformer.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\internal\cs2as\AbstractCS2ASTransformer.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.xtext.base.cs2as.tx;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.ocl.pivot.evaluation.Executor;
-import org.eclipse.ocl.pivot.ids.ClassId;
-import org.eclipse.ocl.pivot.ids.PropertyId;
-import org.eclipse.ocl.pivot.evaluation.tx.AbstractTransformer;
-
-
-public abstract class AbstractCS2ASTransformer extends AbstractTransformer
- implements CS2ASTransformer
-{
-
- private final List<CS2ASDiagnostic> txErrors = new ArrayList<CS2ASDiagnostic>();
-
- protected AbstractCS2ASTransformer(@NonNull Executor executor, @NonNull String @NonNull [] modelNames,
- @NonNull PropertyId @Nullable [] propertyIndex2propertyId, @NonNull ClassId @Nullable [] classIndex2classId, int @Nullable [] @NonNull [] classIndex2allClassIndexes) {
- super(executor, modelNames, propertyIndex2propertyId, classIndex2classId, classIndex2allClassIndexes);
- }
-
- protected @NonNull RuntimeException throwNull(@NonNull EObject csObject, @NonNull String message) {
- throw new CS2ASException(csObject, message);
- }
-
- protected void handleLookupError(EObject sourceObject, String lookupHint) {
- handleError(sourceObject, "''" + lookupHint +"'' not found");
- }
-
- protected void handleLookupError(EObject sourceObject, EObject lookupHint) {
- handleError(sourceObject, "''" + lookupHint.toString() +"'' not found");
- }
-
- protected void handleLookupError(List<? extends EObject> sourceObjects, EObject lookupHint) {
- int hintPos = sourceObjects.indexOf(lookupHint);
- switch (hintPos) {
- case -1:
- case 0:
- hintPos = 0; // For safety, the default will be the first one
- break;
- default:
- // We assume the element from which we report is the previous one of the lookupHint
- hintPos = hintPos -1;
- }
-
- handleError(sourceObjects.get(hintPos), "''" + lookupHint.toString() +"'' not found");
- }
-
- protected void handleError(EObject sourceObject, String errorMessage) {
- txErrors.add(new CS2ASDiagnostic(sourceObject, errorMessage));
- }
-
- @Override
- public List<CS2ASDiagnostic> getErrors() {
- return txErrors;
- }
-}
diff --git a/plugins/org.eclipse.ocl.xtext.base/src-gen/org/eclipse/ocl/xtext/base/cs2as/tx/CS2ASDiagnostic.java b/plugins/org.eclipse.ocl.xtext.base/src-gen/org/eclipse/ocl/xtext/base/cs2as/tx/CS2ASDiagnostic.java
deleted file mode 100644
index 02b3879..0000000
--- a/plugins/org.eclipse.ocl.xtext.base/src-gen/org/eclipse/ocl/xtext/base/cs2as/tx/CS2ASDiagnostic.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\internal\cs2as\CS2ASDiagnostic.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2015 Willink Transformations Ltd, University of York and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Adolfo Sanchez-Barbudo Herrera (UoY) - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.xtext.base.cs2as.tx;
-
-import org.eclipse.emf.common.util.BasicDiagnostic;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.emf.ecore.EObject;
-
-public class CS2ASDiagnostic extends BasicDiagnostic {
-
- private EObject csObject;
-
- public CS2ASDiagnostic(EObject csObject, int severity, String source, int code, String message) {
- super(severity, source, code, message, null);
- this.csObject = csObject;
- }
-
- /**
- * A simple (no source, code) CS2AS error diagnostic
- * @param csObject the source CSObject
- * @param message the erroneus situation
- */
- public CS2ASDiagnostic(EObject csObject, String message) {
- this(csObject, Diagnostic.ERROR, null, 0, message);
- }
-
- public EObject getCSObject() {
- return csObject;
- }
-}
diff --git a/plugins/org.eclipse.ocl.xtext.base/src-gen/org/eclipse/ocl/xtext/base/cs2as/tx/CS2ASException.java b/plugins/org.eclipse.ocl.xtext.base/src-gen/org/eclipse/ocl/xtext/base/cs2as/tx/CS2ASException.java
deleted file mode 100644
index 9de74d1..0000000
--- a/plugins/org.eclipse.ocl.xtext.base/src-gen/org/eclipse/ocl/xtext/base/cs2as/tx/CS2ASException.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\internal\cs2as\CS2ASException.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2015 Willink Transformations Ltd, University of York and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Adolfo Sanchez-Barbudo Herrera (UoY) - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.xtext.base.cs2as.tx;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.ocl.pivot.values.InvalidValueException;
-
-public class CS2ASException extends InvalidValueException
-{
- private static final long serialVersionUID = 1L;
-
- protected final @NonNull EObject csObject;
-
- public CS2ASException(@NonNull EObject csObject, @NonNull String message) {
- super(message);
- this.csObject = csObject;
- }
-
- public @NonNull EObject getCSObject() {
- return csObject;
- }
-}
diff --git a/plugins/org.eclipse.ocl.xtext.base/src-gen/org/eclipse/ocl/xtext/base/cs2as/tx/CS2ASTransformationExecutor.java b/plugins/org.eclipse.ocl.xtext.base/src-gen/org/eclipse/ocl/xtext/base/cs2as/tx/CS2ASTransformationExecutor.java
deleted file mode 100644
index 128fcc1..0000000
--- a/plugins/org.eclipse.ocl.xtext.base/src-gen/org/eclipse/ocl/xtext/base/cs2as/tx/CS2ASTransformationExecutor.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\internal\cs2as\CS2ASTransformationExecutor.java
- *
- * Do not edit this file.
- */
-package org.eclipse.ocl.xtext.base.cs2as.tx;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.ocl.pivot.utilities.EnvironmentFactory;
-import org.eclipse.ocl.pivot.evaluation.tx.AbstractTransformationExecutor;
-
-public class CS2ASTransformationExecutor extends AbstractTransformationExecutor {
-
- public CS2ASTransformationExecutor(@NonNull EnvironmentFactory environmentFactory,
- @NonNull Class<? extends CS2ASTransformer> txClass)
- throws ReflectiveOperationException {
- super(environmentFactory, txClass);
- }
-
- @Override
- public @NonNull CS2ASTransformer getTransformer() {
- return (CS2ASTransformer) super.getTransformer();
- }
-}
diff --git a/plugins/org.eclipse.ocl.xtext.base/src-gen/org/eclipse/ocl/xtext/base/cs2as/tx/CS2ASTransformer.java b/plugins/org.eclipse.ocl.xtext.base/src-gen/org/eclipse/ocl/xtext/base/cs2as/tx/CS2ASTransformer.java
deleted file mode 100644
index 0dcc448..0000000
--- a/plugins/org.eclipse.ocl.xtext.base/src-gen/org/eclipse/ocl/xtext/base/cs2as/tx/CS2ASTransformer.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * This file was copied and re-packaged automatically by
- * org.eclipse.ocl.examples.build.GenerateAutoCSModels.mwe2
- * from
- * ..\..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\internal\cs2as\CS2ASTransformer.java
- *
- * Do not edit this file.
- */
-/*******************************************************************************
- * Copyright (c) 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ocl.xtext.base.cs2as.tx;
-
-import java.util.List;
-
-import org.eclipse.ocl.pivot.evaluation.tx.Transformer;
-
-public interface CS2ASTransformer extends Transformer {
-
- public List<CS2ASDiagnostic> getErrors();
-}