Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.metamodel/src/org/eclipse/papyrus/emf/facet/query/ocl/metamodel/oclquery/util')
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.metamodel/src/org/eclipse/papyrus/emf/facet/query/ocl/metamodel/oclquery/util/OclQueryAdapterFactory.java151
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.metamodel/src/org/eclipse/papyrus/emf/facet/query/ocl/metamodel/oclquery/util/OclQuerySwitch.java155
2 files changed, 306 insertions, 0 deletions
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.metamodel/src/org/eclipse/papyrus/emf/facet/query/ocl/metamodel/oclquery/util/OclQueryAdapterFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.metamodel/src/org/eclipse/papyrus/emf/facet/query/ocl/metamodel/oclquery/util/OclQueryAdapterFactory.java
new file mode 100644
index 00000000000..b38e1e2509c
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.metamodel/src/org/eclipse/papyrus/emf/facet/query/ocl/metamodel/oclquery/util/OclQueryAdapterFactory.java
@@ -0,0 +1,151 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * 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:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ *
+ *
+ */
+package org.eclipse.emf.facet.query.ocl.metamodel.oclquery.util;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+
+import org.eclipse.emf.facet.query.ocl.metamodel.oclquery.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.facet.query.ocl.metamodel.oclquery.OclQueryPackage
+ * @generated
+ */
+public class OclQueryAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static OclQueryPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public OclQueryAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = OclQueryPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected OclQuerySwitch<Adapter> modelSwitch =
+ new OclQuerySwitch<Adapter>() {
+ @Override
+ public Adapter caseOclQuery(OclQuery object) {
+ return createOclQueryAdapter();
+ }
+ @Override
+ public Adapter caseQuery(Query object) {
+ return createQueryAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.facet.query.ocl.metamodel.oclquery.OclQuery <em>Ocl Query</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.emf.facet.query.ocl.metamodel.oclquery.OclQuery
+ * @generated
+ */
+ public Adapter createOclQueryAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query <em>Query</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query
+ * @generated
+ */
+ public Adapter createQueryAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //OclQueryAdapterFactory
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.metamodel/src/org/eclipse/papyrus/emf/facet/query/ocl/metamodel/oclquery/util/OclQuerySwitch.java b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.metamodel/src/org/eclipse/papyrus/emf/facet/query/ocl/metamodel/oclquery/util/OclQuerySwitch.java
new file mode 100644
index 00000000000..2067afbf397
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.ocl.metamodel/src/org/eclipse/papyrus/emf/facet/query/ocl/metamodel/oclquery/util/OclQuerySwitch.java
@@ -0,0 +1,155 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * 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:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ *
+ *
+ */
+package org.eclipse.emf.facet.query.ocl.metamodel.oclquery.util;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+
+import org.eclipse.emf.facet.query.ocl.metamodel.oclquery.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.facet.query.ocl.metamodel.oclquery.OclQueryPackage
+ * @generated
+ */
+public class OclQuerySwitch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static OclQueryPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public OclQuerySwitch() {
+ if (modelPackage == null) {
+ modelPackage = OclQueryPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ public T doSwitch(EObject theEObject) {
+ return doSwitch(theEObject.eClass(), theEObject);
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ protected T doSwitch(EClass theEClass, EObject theEObject) {
+ if (theEClass.eContainer() == modelPackage) {
+ return doSwitch(theEClass.getClassifierID(), theEObject);
+ }
+ else {
+ List<EClass> eSuperTypes = theEClass.getESuperTypes();
+ return
+ eSuperTypes.isEmpty() ?
+ defaultCase(theEObject) :
+ doSwitch(eSuperTypes.get(0), theEObject);
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case OclQueryPackage.OCL_QUERY: {
+ OclQuery oclQuery = (OclQuery)theEObject;
+ T result = caseOclQuery(oclQuery);
+ if (result == null) result = caseQuery(oclQuery);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Ocl Query</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Ocl Query</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseOclQuery(OclQuery object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Query</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Query</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseQuery(Query object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} //OclQuerySwitch

Back to the top