From 0d0de7d8baeb0be4c9c4c7304dbc55c23b58d095 Mon Sep 17 00:00:00 2001 From: Martin Fluegge Date: Fri, 8 Jan 2010 19:45:45 +0000 Subject: [247226] Transparently support legacy models (CDOLegacyAdapter) https://bugs.eclipse.org/bugs/show_bug.cgi?id=247226 --- .../META-INF/MANIFEST.MF | 3 +- .../model/model2.legacy-genmodel | 2 +- .../emf/cdo/tests/legacy/model2/Model2Factory.java | 103 ++ .../emf/cdo/tests/legacy/model2/Model2Package.java | 1342 ++++++++++++++++++++ .../legacy/model2/impl/Model2FactoryImpl.java | 199 +++ .../legacy/model2/impl/Model2PackageImpl.java | 804 ++++++++++++ .../model2/impl/PersistentContainmentImpl.java | 323 +++++ .../model2/impl/SpecialPurchaseOrderImpl.java | 284 +++++ .../legacy/model2/impl/TaskContainerImpl.java | 189 +++ .../emf/cdo/tests/legacy/model2/impl/TaskImpl.java | 354 ++++++ .../legacy/model2/impl/TransientContainerImpl.java | 359 ++++++ .../tests/legacy/model2/impl/Unsettable1Impl.java | 1192 +++++++++++++++++ .../model2/impl/Unsettable2WithDefaultImpl.java | 1205 ++++++++++++++++++ .../legacy/model2/util/Model2AdapterFactory.java | 306 +++++ .../cdo/tests/legacy/model2/util/Model2Switch.java | 324 +++++ 15 files changed, 6987 insertions(+), 2 deletions(-) create mode 100644 plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/Model2Factory.java create mode 100644 plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/Model2Package.java create mode 100644 plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/Model2FactoryImpl.java create mode 100644 plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/Model2PackageImpl.java create mode 100644 plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/PersistentContainmentImpl.java create mode 100644 plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/SpecialPurchaseOrderImpl.java create mode 100644 plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/TaskContainerImpl.java create mode 100644 plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/TaskImpl.java create mode 100644 plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/TransientContainerImpl.java create mode 100644 plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/Unsettable1Impl.java create mode 100644 plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/Unsettable2WithDefaultImpl.java create mode 100644 plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/util/Model2AdapterFactory.java create mode 100644 plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/util/Model2Switch.java (limited to 'plugins/org.eclipse.emf.cdo.tests.model2') diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.tests.model2/META-INF/MANIFEST.MF index 0dec48648d..d81dd303da 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model2/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.emf.cdo.tests.model2/META-INF/MANIFEST.MF @@ -11,6 +11,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)", org.eclipse.emf.ecore;bundle-version="[2.4.0,3.0.0)";visibility:=reexport, org.eclipse.emf.cdo;bundle-version="[3.0.0,4.0.0)";visibility:=reexport, org.eclipse.emf.cdo.tests.model1;bundle-version="[3.0.0,4.0.0)";visibility:=reexport -Export-Package: org.eclipse.emf.cdo.tests.model2;version="3.0.0", +Export-Package: org.eclipse.emf.cdo.tests.legacy.model2, + org.eclipse.emf.cdo.tests.model2;version="3.0.0", org.eclipse.emf.cdo.tests.model2.impl;version="3.0.0", org.eclipse.emf.cdo.tests.model2.util;version="3.0.0" diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.legacy-genmodel b/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.legacy-genmodel index 5024097e3c..d2563f2e75 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.legacy-genmodel +++ b/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.legacy-genmodel @@ -5,7 +5,7 @@ modelDirectory="/org.eclipse.emf.cdo.tests.model2/src" editDirectory="" editorDirectory="" modelPluginID="org.eclipse.emf.cdo.tests.model2" modelName="Model2" updateClasspath="false" codeFormatting="true" testsDirectory="" importerID="org.eclipse.emf.importer.cdo" - complianceLevel="5.0" copyrightFields="false" usedGenPackages="../../org.eclipse.emf.cdo.tests.model1/model/model1.legacy.genmodel#//model1"> + complianceLevel="5.0" copyrightFields="false" usedGenPackages="../../org.eclipse.emf.cdo.tests.model1/model/model1.legacy-genmodel#//model1"> model2.ecore CDO=org.eclipse.emf.cdo The Factory for the model. It provides a create method for each non-abstract class of + * the model. + * + * @see org.eclipse.emf.cdo.tests.legacy.model2.Model2Package + * @generated + */ +public interface Model2Factory extends org.eclipse.emf.cdo.tests.model2.Model2Factory +{ + /** + * The singleton instance of the factory. + * + * @generated + */ + Model2Factory eINSTANCE = org.eclipse.emf.cdo.tests.legacy.model2.impl.Model2FactoryImpl.init(); + + /** + * Returns a new object of class 'Special Purchase Order'. + * + * @return a new object of class 'Special Purchase Order'. + * @generated + */ + SpecialPurchaseOrder createSpecialPurchaseOrder(); + + /** + * Returns a new object of class 'Task Container'. + * + * @return a new object of class 'Task Container'. + * @generated + */ + TaskContainer createTaskContainer(); + + /** + * Returns a new object of class 'Task'. + * + * @return a new object of class 'Task'. + * @generated + */ + Task createTask(); + + /** + * Returns a new object of class 'Unsettable1'. + * + * @return a new object of class 'Unsettable1'. + * @generated + */ + Unsettable1 createUnsettable1(); + + /** + * Returns a new object of class 'Unsettable2 With Default'. + * + * @return a new object of class 'Unsettable2 With Default'. + * @generated + */ + Unsettable2WithDefault createUnsettable2WithDefault(); + + /** + * Returns a new object of class 'Persistent Containment'. + * + * @return a new object of class 'Persistent Containment'. + * @generated + */ + PersistentContainment createPersistentContainment(); + + /** + * Returns a new object of class 'Transient Container'. + * + * @return a new object of class 'Transient Container'. + * @generated + */ + TransientContainer createTransientContainer(); + + /** + * Returns the package supported by this factory. + * + * @return the package supported by this factory. + * @generated + */ + Model2Package getModel2Package(); + +} // Model2Factory diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/Model2Package.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/Model2Package.java new file mode 100644 index 0000000000..46bb9250dd --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/Model2Package.java @@ -0,0 +1,1342 @@ +/** + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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: + * Eike Stepper - initial API and implementation + * + * $Id: Model2Package.java,v 1.4 2010-01-08 19:43:26 mfluegge Exp $ + */ +package org.eclipse.emf.cdo.tests.legacy.model2; + +import org.eclipse.emf.cdo.tests.legacy.model1.Model1Package; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EReference; + +/** + * The Package for the model. It contains accessors for the meta objects to represent + * + * + * + * @see org.eclipse.emf.cdo.tests.legacy.model2.Model2Factory + * @model kind="package" + * @generated + */ +public interface Model2Package extends org.eclipse.emf.cdo.tests.model2.Model2Package +{ + /** + * The package name. + * + * @generated + */ + String eNAME = "model2"; + + /** + * The package namespace URI. + * + * @generated NOT + */ + String eNS_URI = "http://www.eclipse.org/emf/CDO/tests/legacy/model2/1.0.0"; + + /** + * The package namespace name. + * + * @generated + */ + String eNS_PREFIX = "model2"; + + /** + * The singleton instance of the package. + * + * @generated + */ + Model2Package eINSTANCE = org.eclipse.emf.cdo.tests.legacy.model2.impl.Model2PackageImpl.init(); + + /** + * The meta object id for the '{@link org.eclipse.emf.cdo.tests.legacy.model2.impl.SpecialPurchaseOrderImpl + * Special Purchase Order}' class. + * + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.SpecialPurchaseOrderImpl + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.Model2PackageImpl#getSpecialPurchaseOrder() + * @generated + */ + int SPECIAL_PURCHASE_ORDER = 0; + + /** + * The feature id for the 'Order Details' containment reference list. + * + * @generated + * @ordered + */ + int SPECIAL_PURCHASE_ORDER__ORDER_DETAILS = Model1Package.PURCHASE_ORDER__ORDER_DETAILS; + + /** + * The feature id for the 'Date' attribute. + * + * @generated + * @ordered + */ + int SPECIAL_PURCHASE_ORDER__DATE = Model1Package.PURCHASE_ORDER__DATE; + + /** + * The feature id for the 'Supplier' reference. + * + * @generated + * @ordered + */ + int SPECIAL_PURCHASE_ORDER__SUPPLIER = Model1Package.PURCHASE_ORDER__SUPPLIER; + + /** + * The feature id for the 'Discount Code' attribute. + * + * @generated + * @ordered + */ + int SPECIAL_PURCHASE_ORDER__DISCOUNT_CODE = Model1Package.PURCHASE_ORDER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Shipping Address' containment reference. + * + * @generated + * @ordered + */ + int SPECIAL_PURCHASE_ORDER__SHIPPING_ADDRESS = Model1Package.PURCHASE_ORDER_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Special Purchase Order' class. + * + * @generated + * @ordered + */ + int SPECIAL_PURCHASE_ORDER_FEATURE_COUNT = Model1Package.PURCHASE_ORDER_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.emf.cdo.tests.legacy.model2.impl.TaskContainerImpl + * Task Container}' class. + * + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.TaskContainerImpl + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.Model2PackageImpl#getTaskContainer() + * @generated + */ + int TASK_CONTAINER = 1; + + /** + * The feature id for the 'Tasks' containment reference list. + * + * @generated + * @ordered + */ + int TASK_CONTAINER__TASKS = 0; + + /** + * The number of structural features of the 'Task Container' class. + * + * @generated + * @ordered + */ + int TASK_CONTAINER_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link org.eclipse.emf.cdo.tests.legacy.model2.impl.TaskImpl Task}' class. + * + * + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.TaskImpl + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.Model2PackageImpl#getTask() + * @generated + */ + int TASK = 2; + + /** + * The feature id for the 'Task Container' container reference. + * + * @generated + * @ordered + */ + int TASK__TASK_CONTAINER = 0; + + /** + * The feature id for the 'Description' attribute. + * + * @generated + * @ordered + */ + int TASK__DESCRIPTION = 1; + + /** + * The feature id for the 'Done' attribute. + * + * @generated + * @ordered + */ + int TASK__DONE = 2; + + /** + * The number of structural features of the 'Task' class. + * + * @generated + * @ordered + */ + int TASK_FEATURE_COUNT = 3; + + /** + * The meta object id for the '{@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable1Impl + * Unsettable1}' class. + * + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable1Impl + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.Model2PackageImpl#getUnsettable1() + * @generated + */ + int UNSETTABLE1 = 3; + + /** + * The feature id for the 'Unsettable Boolean' attribute. + * + * @generated + * @ordered + */ + int UNSETTABLE1__UNSETTABLE_BOOLEAN = 0; + + /** + * The feature id for the 'Unsettable Byte' attribute. + * + * @generated + * @ordered + */ + int UNSETTABLE1__UNSETTABLE_BYTE = 1; + + /** + * The feature id for the 'Unsettable Char' attribute. + * + * @generated + * @ordered + */ + int UNSETTABLE1__UNSETTABLE_CHAR = 2; + + /** + * The feature id for the 'Unsettable Date' attribute. + * + * @generated + * @ordered + */ + int UNSETTABLE1__UNSETTABLE_DATE = 3; + + /** + * The feature id for the 'Unsettable Double' attribute. + * + * @generated + * @ordered + */ + int UNSETTABLE1__UNSETTABLE_DOUBLE = 4; + + /** + * The feature id for the 'Unsettable Float' attribute. + * + * @generated + * @ordered + */ + int UNSETTABLE1__UNSETTABLE_FLOAT = 5; + + /** + * The feature id for the 'Unsettable Int' attribute. + * + * @generated + * @ordered + */ + int UNSETTABLE1__UNSETTABLE_INT = 6; + + /** + * The feature id for the 'Unsettable Long' attribute. + * + * @generated + * @ordered + */ + int UNSETTABLE1__UNSETTABLE_LONG = 7; + + /** + * The feature id for the 'Unsettable Short' attribute. + * + * @generated + * @ordered + */ + int UNSETTABLE1__UNSETTABLE_SHORT = 8; + + /** + * The feature id for the 'Unsettable String' attribute. + * + * @generated + * @ordered + */ + int UNSETTABLE1__UNSETTABLE_STRING = 9; + + /** + * The feature id for the 'Unsettable VAT' attribute. + * + * @generated + * @ordered + */ + int UNSETTABLE1__UNSETTABLE_VAT = 10; + + /** + * The number of structural features of the 'Unsettable1' class. + * + * @generated + * @ordered + */ + int UNSETTABLE1_FEATURE_COUNT = 11; + + /** + * The meta object id for the '{@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable2WithDefaultImpl + * Unsettable2 With Default}' class. + * + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable2WithDefaultImpl + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.Model2PackageImpl#getUnsettable2WithDefault() + * @generated + */ + int UNSETTABLE2_WITH_DEFAULT = 4; + + /** + * The feature id for the 'Unsettable Boolean' attribute. + * + * @generated + * @ordered + */ + int UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_BOOLEAN = 0; + + /** + * The feature id for the 'Unsettable Byte' attribute. + * + * @generated + * @ordered + */ + int UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_BYTE = 1; + + /** + * The feature id for the 'Unsettable Char' attribute. + * + * @generated + * @ordered + */ + int UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_CHAR = 2; + + /** + * The feature id for the 'Unsettable Date' attribute. + * + * @generated + * @ordered + */ + int UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_DATE = 3; + + /** + * The feature id for the 'Unsettable Double' attribute. + * + * @generated + * @ordered + */ + int UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_DOUBLE = 4; + + /** + * The feature id for the 'Unsettable Float' attribute. + * + * @generated + * @ordered + */ + int UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_FLOAT = 5; + + /** + * The feature id for the 'Unsettable Int' attribute. + * + * @generated + * @ordered + */ + int UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_INT = 6; + + /** + * The feature id for the 'Unsettable Long' attribute. + * + * @generated + * @ordered + */ + int UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_LONG = 7; + + /** + * The feature id for the 'Unsettable Short' attribute. + * + * @generated + * @ordered + */ + int UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_SHORT = 8; + + /** + * The feature id for the 'Unsettable String' attribute. + * + * @generated + * @ordered + */ + int UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_STRING = 9; + + /** + * The feature id for the 'Unsettable VAT' attribute. + * + * @generated + * @ordered + */ + int UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_VAT = 10; + + /** + * The number of structural features of the 'Unsettable2 With Default' class. + * + * @generated + * @ordered + */ + int UNSETTABLE2_WITH_DEFAULT_FEATURE_COUNT = 11; + + /** + * The meta object id for the '{@link org.eclipse.emf.cdo.tests.legacy.model2.impl.PersistentContainmentImpl + * Persistent Containment}' class. + * + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.PersistentContainmentImpl + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.Model2PackageImpl#getPersistentContainment() + * @generated + */ + int PERSISTENT_CONTAINMENT = 5; + + /** + * The feature id for the 'Attr Before' attribute. + * + * @generated + * @ordered + */ + int PERSISTENT_CONTAINMENT__ATTR_BEFORE = 0; + + /** + * The feature id for the 'Children' containment reference list. + * + * @generated + * @ordered + */ + int PERSISTENT_CONTAINMENT__CHILDREN = 1; + + /** + * The feature id for the 'Attr After' attribute. + * + * @generated + * @ordered + */ + int PERSISTENT_CONTAINMENT__ATTR_AFTER = 2; + + /** + * The number of structural features of the 'Persistent Containment' class. + * + * @generated + * @ordered + */ + int PERSISTENT_CONTAINMENT_FEATURE_COUNT = 3; + + /** + * The meta object id for the '{@link org.eclipse.emf.cdo.tests.legacy.model2.impl.TransientContainerImpl + * Transient Container}' class. + * + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.TransientContainerImpl + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.Model2PackageImpl#getTransientContainer() + * @generated + */ + int TRANSIENT_CONTAINER = 6; + + /** + * The feature id for the 'Attr Before' attribute. + * + * @generated + * @ordered + */ + int TRANSIENT_CONTAINER__ATTR_BEFORE = 0; + + /** + * The feature id for the 'Parent' container reference. + * + * @generated + * @ordered + */ + int TRANSIENT_CONTAINER__PARENT = 1; + + /** + * The feature id for the 'Attr After' attribute. + * + * @generated + * @ordered + */ + int TRANSIENT_CONTAINER__ATTR_AFTER = 2; + + /** + * The number of structural features of the 'Transient Container' class. + * + * @generated + * @ordered + */ + int TRANSIENT_CONTAINER_FEATURE_COUNT = 3; + + /** + * Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.legacy.model2.SpecialPurchaseOrder + * Special Purchase Order}'. + * + * @return the meta object for class 'Special Purchase Order'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.SpecialPurchaseOrder + * @generated + */ + EClass getSpecialPurchaseOrder(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.SpecialPurchaseOrder#getDiscountCode Discount Code}'. + * + * @return the meta object for the attribute 'Discount Code'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.SpecialPurchaseOrder#getDiscountCode() + * @see #getSpecialPurchaseOrder() + * @generated + */ + EAttribute getSpecialPurchaseOrder_DiscountCode(); + + /** + * Returns the meta object for the containment reference ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.SpecialPurchaseOrder#getShippingAddress Shipping Address}'. + * + * + * @return the meta object for the containment reference 'Shipping Address'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.SpecialPurchaseOrder#getShippingAddress() + * @see #getSpecialPurchaseOrder() + * @generated + */ + EReference getSpecialPurchaseOrder_ShippingAddress(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.legacy.model2.TaskContainer + * Task Container}'. + * + * @return the meta object for class 'Task Container'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.TaskContainer + * @generated + */ + EClass getTaskContainer(); + + /** + * Returns the meta object for the containment reference list ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.TaskContainer#getTasks Tasks}'. + * + * + * @return the meta object for the containment reference list 'Tasks'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.TaskContainer#getTasks() + * @see #getTaskContainer() + * @generated + */ + EReference getTaskContainer_Tasks(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.legacy.model2.Task Task}'. + * + * @return the meta object for class 'Task'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Task + * @generated + */ + EClass getTask(); + + /** + * Returns the meta object for the container reference ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Task#getTaskContainer Task Container}'. + * + * @return the meta object for the container reference 'Task Container'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Task#getTaskContainer() + * @see #getTask() + * @generated + */ + EReference getTask_TaskContainer(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.tests.legacy.model2.Task#getDescription + * Description}'. + * + * @return the meta object for the attribute 'Description'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Task#getDescription() + * @see #getTask() + * @generated + */ + EAttribute getTask_Description(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.tests.legacy.model2.Task#isDone + * Done}'. + * + * @return the meta object for the attribute 'Done'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Task#isDone() + * @see #getTask() + * @generated + */ + EAttribute getTask_Done(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1 Unsettable1} + * '. + * + * @return the meta object for class 'Unsettable1'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1 + * @generated + */ + EClass getUnsettable1(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1#isUnsettableBoolean Unsettable Boolean}'. + * + * @return the meta object for the attribute 'Unsettable Boolean'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1#isUnsettableBoolean() + * @see #getUnsettable1() + * @generated + */ + EAttribute getUnsettable1_UnsettableBoolean(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1#getUnsettableByte Unsettable Byte}'. + * + * @return the meta object for the attribute 'Unsettable Byte'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1#getUnsettableByte() + * @see #getUnsettable1() + * @generated + */ + EAttribute getUnsettable1_UnsettableByte(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1#getUnsettableChar Unsettable Char}'. + * + * @return the meta object for the attribute 'Unsettable Char'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1#getUnsettableChar() + * @see #getUnsettable1() + * @generated + */ + EAttribute getUnsettable1_UnsettableChar(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1#getUnsettableDate Unsettable Date}'. + * + * @return the meta object for the attribute 'Unsettable Date'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1#getUnsettableDate() + * @see #getUnsettable1() + * @generated + */ + EAttribute getUnsettable1_UnsettableDate(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1#getUnsettableDouble Unsettable Double}'. + * + * @return the meta object for the attribute 'Unsettable Double'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1#getUnsettableDouble() + * @see #getUnsettable1() + * @generated + */ + EAttribute getUnsettable1_UnsettableDouble(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1#getUnsettableFloat Unsettable Float}'. + * + * @return the meta object for the attribute 'Unsettable Float'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1#getUnsettableFloat() + * @see #getUnsettable1() + * @generated + */ + EAttribute getUnsettable1_UnsettableFloat(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1#getUnsettableInt Unsettable Int}'. + * + * @return the meta object for the attribute 'Unsettable Int'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1#getUnsettableInt() + * @see #getUnsettable1() + * @generated + */ + EAttribute getUnsettable1_UnsettableInt(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1#getUnsettableLong Unsettable Long}'. + * + * @return the meta object for the attribute 'Unsettable Long'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1#getUnsettableLong() + * @see #getUnsettable1() + * @generated + */ + EAttribute getUnsettable1_UnsettableLong(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1#getUnsettableShort Unsettable Short}'. + * + * @return the meta object for the attribute 'Unsettable Short'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1#getUnsettableShort() + * @see #getUnsettable1() + * @generated + */ + EAttribute getUnsettable1_UnsettableShort(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1#getUnsettableString Unsettable String}'. + * + * @return the meta object for the attribute 'Unsettable String'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1#getUnsettableString() + * @see #getUnsettable1() + * @generated + */ + EAttribute getUnsettable1_UnsettableString(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1#getUnsettableVAT Unsettable VAT}'. + * + * @return the meta object for the attribute 'Unsettable VAT'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1#getUnsettableVAT() + * @see #getUnsettable1() + * @generated + */ + EAttribute getUnsettable1_UnsettableVAT(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault + * Unsettable2 With Default}'. + * + * @return the meta object for class 'Unsettable2 With Default'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault + * @generated + */ + EClass getUnsettable2WithDefault(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault#isUnsettableBoolean + * Unsettable Boolean}'. + * + * @return the meta object for the attribute 'Unsettable Boolean'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault#isUnsettableBoolean() + * @see #getUnsettable2WithDefault() + * @generated + */ + EAttribute getUnsettable2WithDefault_UnsettableBoolean(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault#getUnsettableByte Unsettable Byte}'. + * + * + * @return the meta object for the attribute 'Unsettable Byte'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault#getUnsettableByte() + * @see #getUnsettable2WithDefault() + * @generated + */ + EAttribute getUnsettable2WithDefault_UnsettableByte(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault#getUnsettableChar Unsettable Char}'. + * + * + * @return the meta object for the attribute 'Unsettable Char'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault#getUnsettableChar() + * @see #getUnsettable2WithDefault() + * @generated + */ + EAttribute getUnsettable2WithDefault_UnsettableChar(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault#getUnsettableDate Unsettable Date}'. + * + * + * @return the meta object for the attribute 'Unsettable Date'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault#getUnsettableDate() + * @see #getUnsettable2WithDefault() + * @generated + */ + EAttribute getUnsettable2WithDefault_UnsettableDate(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault#getUnsettableDouble + * Unsettable Double}'. + * + * @return the meta object for the attribute 'Unsettable Double'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault#getUnsettableDouble() + * @see #getUnsettable2WithDefault() + * @generated + */ + EAttribute getUnsettable2WithDefault_UnsettableDouble(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault#getUnsettableFloat Unsettable Float} + * '. + * + * @return the meta object for the attribute 'Unsettable Float'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault#getUnsettableFloat() + * @see #getUnsettable2WithDefault() + * @generated + */ + EAttribute getUnsettable2WithDefault_UnsettableFloat(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault#getUnsettableInt Unsettable Int}'. + * + * + * @return the meta object for the attribute 'Unsettable Int'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault#getUnsettableInt() + * @see #getUnsettable2WithDefault() + * @generated + */ + EAttribute getUnsettable2WithDefault_UnsettableInt(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault#getUnsettableLong Unsettable Long}'. + * + * + * @return the meta object for the attribute 'Unsettable Long'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault#getUnsettableLong() + * @see #getUnsettable2WithDefault() + * @generated + */ + EAttribute getUnsettable2WithDefault_UnsettableLong(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault#getUnsettableShort Unsettable Short} + * '. + * + * @return the meta object for the attribute 'Unsettable Short'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault#getUnsettableShort() + * @see #getUnsettable2WithDefault() + * @generated + */ + EAttribute getUnsettable2WithDefault_UnsettableShort(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault#getUnsettableString + * Unsettable String}'. + * + * @return the meta object for the attribute 'Unsettable String'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault#getUnsettableString() + * @see #getUnsettable2WithDefault() + * @generated + */ + EAttribute getUnsettable2WithDefault_UnsettableString(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault#getUnsettableVAT Unsettable VAT}'. + * + * + * @return the meta object for the attribute 'Unsettable VAT'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault#getUnsettableVAT() + * @see #getUnsettable2WithDefault() + * @generated + */ + EAttribute getUnsettable2WithDefault_UnsettableVAT(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.legacy.model2.PersistentContainment + * Persistent Containment}'. + * + * @return the meta object for class 'Persistent Containment'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.PersistentContainment + * @generated + */ + EClass getPersistentContainment(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.PersistentContainment#getAttrBefore Attr Before}'. + * + * @return the meta object for the attribute 'Attr Before'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.PersistentContainment#getAttrBefore() + * @see #getPersistentContainment() + * @generated + */ + EAttribute getPersistentContainment_AttrBefore(); + + /** + * Returns the meta object for the containment reference list ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.PersistentContainment#getChildren Children}'. + * + * @return the meta object for the containment reference list 'Children'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.PersistentContainment#getChildren() + * @see #getPersistentContainment() + * @generated + */ + EReference getPersistentContainment_Children(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.PersistentContainment#getAttrAfter Attr After}'. + * + * @return the meta object for the attribute 'Attr After'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.PersistentContainment#getAttrAfter() + * @see #getPersistentContainment() + * @generated + */ + EAttribute getPersistentContainment_AttrAfter(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.legacy.model2.TransientContainer + * Transient Container}'. + * + * @return the meta object for class 'Transient Container'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.TransientContainer + * @generated + */ + EClass getTransientContainer(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.TransientContainer#getAttrBefore Attr Before}'. + * + * @return the meta object for the attribute 'Attr Before'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.TransientContainer#getAttrBefore() + * @see #getTransientContainer() + * @generated + */ + EAttribute getTransientContainer_AttrBefore(); + + /** + * Returns the meta object for the container reference ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.TransientContainer#getParent Parent}'. + * + * @return the meta object for the container reference 'Parent'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.TransientContainer#getParent() + * @see #getTransientContainer() + * @generated + */ + EReference getTransientContainer_Parent(); + + /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.TransientContainer#getAttrAfter Attr After}'. + * + * @return the meta object for the attribute 'Attr After'. + * @see org.eclipse.emf.cdo.tests.legacy.model2.TransientContainer#getAttrAfter() + * @see #getTransientContainer() + * @generated + */ + EAttribute getTransientContainer_AttrAfter(); + + /** + * Returns the factory that creates the instances of the model. + * + * @return the factory that creates the instances of the model. + * @generated + */ + Model2Factory getModel2Factory(); + + /** + * Defines literals for the meta objects that represent + * + * + * + * @generated + */ + interface Literals + { + /** + * The meta object literal for the '{@link org.eclipse.emf.cdo.tests.legacy.model2.impl.SpecialPurchaseOrderImpl + * Special Purchase Order}' class. + * + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.SpecialPurchaseOrderImpl + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.Model2PackageImpl#getSpecialPurchaseOrder() + * @generated + */ + EClass SPECIAL_PURCHASE_ORDER = eINSTANCE.getSpecialPurchaseOrder(); + + /** + * The meta object literal for the 'Discount Code' attribute feature. + * + * @generated + */ + EAttribute SPECIAL_PURCHASE_ORDER__DISCOUNT_CODE = eINSTANCE.getSpecialPurchaseOrder_DiscountCode(); + + /** + * The meta object literal for the 'Shipping Address' containment reference feature. + * + * @generated + */ + EReference SPECIAL_PURCHASE_ORDER__SHIPPING_ADDRESS = eINSTANCE.getSpecialPurchaseOrder_ShippingAddress(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.cdo.tests.legacy.model2.impl.TaskContainerImpl + * Task Container}' class. + * + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.TaskContainerImpl + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.Model2PackageImpl#getTaskContainer() + * @generated + */ + EClass TASK_CONTAINER = eINSTANCE.getTaskContainer(); + + /** + * The meta object literal for the 'Tasks' containment reference list feature. + * + * @generated + */ + EReference TASK_CONTAINER__TASKS = eINSTANCE.getTaskContainer_Tasks(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.cdo.tests.legacy.model2.impl.TaskImpl Task}' + * class. + * + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.TaskImpl + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.Model2PackageImpl#getTask() + * @generated + */ + EClass TASK = eINSTANCE.getTask(); + + /** + * The meta object literal for the 'Task Container' container reference feature. + * + * @generated + */ + EReference TASK__TASK_CONTAINER = eINSTANCE.getTask_TaskContainer(); + + /** + * The meta object literal for the 'Description' attribute feature. + * + * @generated + */ + EAttribute TASK__DESCRIPTION = eINSTANCE.getTask_Description(); + + /** + * The meta object literal for the 'Done' attribute feature. + * + * @generated + */ + EAttribute TASK__DONE = eINSTANCE.getTask_Done(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable1Impl + * Unsettable1}' class. + * + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable1Impl + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.Model2PackageImpl#getUnsettable1() + * @generated + */ + EClass UNSETTABLE1 = eINSTANCE.getUnsettable1(); + + /** + * The meta object literal for the 'Unsettable Boolean' attribute feature. + * + * + * @generated + */ + EAttribute UNSETTABLE1__UNSETTABLE_BOOLEAN = eINSTANCE.getUnsettable1_UnsettableBoolean(); + + /** + * The meta object literal for the 'Unsettable Byte' attribute feature. + * + * @generated + */ + EAttribute UNSETTABLE1__UNSETTABLE_BYTE = eINSTANCE.getUnsettable1_UnsettableByte(); + + /** + * The meta object literal for the 'Unsettable Char' attribute feature. + * + * @generated + */ + EAttribute UNSETTABLE1__UNSETTABLE_CHAR = eINSTANCE.getUnsettable1_UnsettableChar(); + + /** + * The meta object literal for the 'Unsettable Date' attribute feature. + * + * @generated + */ + EAttribute UNSETTABLE1__UNSETTABLE_DATE = eINSTANCE.getUnsettable1_UnsettableDate(); + + /** + * The meta object literal for the 'Unsettable Double' attribute feature. + * + * + * @generated + */ + EAttribute UNSETTABLE1__UNSETTABLE_DOUBLE = eINSTANCE.getUnsettable1_UnsettableDouble(); + + /** + * The meta object literal for the 'Unsettable Float' attribute feature. + * + * + * @generated + */ + EAttribute UNSETTABLE1__UNSETTABLE_FLOAT = eINSTANCE.getUnsettable1_UnsettableFloat(); + + /** + * The meta object literal for the 'Unsettable Int' attribute feature. + * + * @generated + */ + EAttribute UNSETTABLE1__UNSETTABLE_INT = eINSTANCE.getUnsettable1_UnsettableInt(); + + /** + * The meta object literal for the 'Unsettable Long' attribute feature. + * + * @generated + */ + EAttribute UNSETTABLE1__UNSETTABLE_LONG = eINSTANCE.getUnsettable1_UnsettableLong(); + + /** + * The meta object literal for the 'Unsettable Short' attribute feature. + * + * + * @generated + */ + EAttribute UNSETTABLE1__UNSETTABLE_SHORT = eINSTANCE.getUnsettable1_UnsettableShort(); + + /** + * The meta object literal for the 'Unsettable String' attribute feature. + * + * + * @generated + */ + EAttribute UNSETTABLE1__UNSETTABLE_STRING = eINSTANCE.getUnsettable1_UnsettableString(); + + /** + * The meta object literal for the 'Unsettable VAT' attribute feature. + * + * @generated + */ + EAttribute UNSETTABLE1__UNSETTABLE_VAT = eINSTANCE.getUnsettable1_UnsettableVAT(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable2WithDefaultImpl + * Unsettable2 With Default}' class. + * + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable2WithDefaultImpl + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.Model2PackageImpl#getUnsettable2WithDefault() + * @generated + */ + EClass UNSETTABLE2_WITH_DEFAULT = eINSTANCE.getUnsettable2WithDefault(); + + /** + * The meta object literal for the 'Unsettable Boolean' attribute feature. + * + * + * @generated + */ + EAttribute UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_BOOLEAN = eINSTANCE.getUnsettable2WithDefault_UnsettableBoolean(); + + /** + * The meta object literal for the 'Unsettable Byte' attribute feature. + * + * @generated + */ + EAttribute UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_BYTE = eINSTANCE.getUnsettable2WithDefault_UnsettableByte(); + + /** + * The meta object literal for the 'Unsettable Char' attribute feature. + * + * @generated + */ + EAttribute UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_CHAR = eINSTANCE.getUnsettable2WithDefault_UnsettableChar(); + + /** + * The meta object literal for the 'Unsettable Date' attribute feature. + * + * @generated + */ + EAttribute UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_DATE = eINSTANCE.getUnsettable2WithDefault_UnsettableDate(); + + /** + * The meta object literal for the 'Unsettable Double' attribute feature. + * + * + * @generated + */ + EAttribute UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_DOUBLE = eINSTANCE.getUnsettable2WithDefault_UnsettableDouble(); + + /** + * The meta object literal for the 'Unsettable Float' attribute feature. + * + * + * @generated + */ + EAttribute UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_FLOAT = eINSTANCE.getUnsettable2WithDefault_UnsettableFloat(); + + /** + * The meta object literal for the 'Unsettable Int' attribute feature. + * + * @generated + */ + EAttribute UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_INT = eINSTANCE.getUnsettable2WithDefault_UnsettableInt(); + + /** + * The meta object literal for the 'Unsettable Long' attribute feature. + * + * @generated + */ + EAttribute UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_LONG = eINSTANCE.getUnsettable2WithDefault_UnsettableLong(); + + /** + * The meta object literal for the 'Unsettable Short' attribute feature. + * + * + * @generated + */ + EAttribute UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_SHORT = eINSTANCE.getUnsettable2WithDefault_UnsettableShort(); + + /** + * The meta object literal for the 'Unsettable String' attribute feature. + * + * + * @generated + */ + EAttribute UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_STRING = eINSTANCE.getUnsettable2WithDefault_UnsettableString(); + + /** + * The meta object literal for the 'Unsettable VAT' attribute feature. + * + * @generated + */ + EAttribute UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_VAT = eINSTANCE.getUnsettable2WithDefault_UnsettableVAT(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.cdo.tests.legacy.model2.impl.PersistentContainmentImpl + * Persistent Containment}' class. + * + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.PersistentContainmentImpl + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.Model2PackageImpl#getPersistentContainment() + * @generated + */ + EClass PERSISTENT_CONTAINMENT = eINSTANCE.getPersistentContainment(); + + /** + * The meta object literal for the 'Attr Before' attribute feature. + * + * @generated + */ + EAttribute PERSISTENT_CONTAINMENT__ATTR_BEFORE = eINSTANCE.getPersistentContainment_AttrBefore(); + + /** + * The meta object literal for the 'Children' containment reference list feature. + * + * @generated + */ + EReference PERSISTENT_CONTAINMENT__CHILDREN = eINSTANCE.getPersistentContainment_Children(); + + /** + * The meta object literal for the 'Attr After' attribute feature. + * + * @generated + */ + EAttribute PERSISTENT_CONTAINMENT__ATTR_AFTER = eINSTANCE.getPersistentContainment_AttrAfter(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.cdo.tests.legacy.model2.impl.TransientContainerImpl + * Transient Container}' class. + * + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.TransientContainerImpl + * @see org.eclipse.emf.cdo.tests.legacy.model2.impl.Model2PackageImpl#getTransientContainer() + * @generated + */ + EClass TRANSIENT_CONTAINER = eINSTANCE.getTransientContainer(); + + /** + * The meta object literal for the 'Attr Before' attribute feature. + * + * @generated + */ + EAttribute TRANSIENT_CONTAINER__ATTR_BEFORE = eINSTANCE.getTransientContainer_AttrBefore(); + + /** + * The meta object literal for the 'Parent' container reference feature. + * + * + * @generated + */ + EReference TRANSIENT_CONTAINER__PARENT = eINSTANCE.getTransientContainer_Parent(); + + /** + * The meta object literal for the 'Attr After' attribute feature. + * + * @generated + */ + EAttribute TRANSIENT_CONTAINER__ATTR_AFTER = eINSTANCE.getTransientContainer_AttrAfter(); + + } + +} // Model2Package diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/Model2FactoryImpl.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/Model2FactoryImpl.java new file mode 100644 index 0000000000..de9744dae9 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/Model2FactoryImpl.java @@ -0,0 +1,199 @@ +/** + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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: + * Eike Stepper - initial API and implementation + * + * $Id: Model2FactoryImpl.java,v 1.4 2010-01-08 19:43:28 mfluegge Exp $ + */ +package org.eclipse.emf.cdo.tests.legacy.model2.impl; + +import org.eclipse.emf.cdo.tests.legacy.model2.Model2Factory; +import org.eclipse.emf.cdo.tests.legacy.model2.Model2Package; +import org.eclipse.emf.cdo.tests.model2.PersistentContainment; +import org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder; +import org.eclipse.emf.cdo.tests.model2.Task; +import org.eclipse.emf.cdo.tests.model2.TaskContainer; +import org.eclipse.emf.cdo.tests.model2.TransientContainer; +import org.eclipse.emf.cdo.tests.model2.Unsettable1; +import org.eclipse.emf.cdo.tests.model2.Unsettable2WithDefault; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.impl.EFactoryImpl; +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +/** + * An implementation of the model Factory. + * + * @generated + */ +public class Model2FactoryImpl extends EFactoryImpl implements Model2Factory +{ + /** + * Creates the default factory implementation. + * + * @generated NOT + */ + public static Model2Factory init() + { + try + { + Model2Factory theModel2Factory = (Model2Factory)EPackage.Registry.INSTANCE + .getEFactory("http://www.eclipse.org/emf/CDO/tests/legacy/model2/1.0.0"); + if (theModel2Factory != null) + { + return theModel2Factory; + } + } + catch (Exception exception) + { + EcorePlugin.INSTANCE.log(exception); + } + return new Model2FactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * @generated + */ + public Model2FactoryImpl() + { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) + { + switch (eClass.getClassifierID()) + { + case Model2Package.SPECIAL_PURCHASE_ORDER: + return createSpecialPurchaseOrder(); + case Model2Package.TASK_CONTAINER: + return createTaskContainer(); + case Model2Package.TASK: + return createTask(); + case Model2Package.UNSETTABLE1: + return createUnsettable1(); + case Model2Package.UNSETTABLE2_WITH_DEFAULT: + return createUnsettable2WithDefault(); + case Model2Package.PERSISTENT_CONTAINMENT: + return createPersistentContainment(); + case Model2Package.TRANSIENT_CONTAINER: + return createTransientContainer(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + public SpecialPurchaseOrder createSpecialPurchaseOrder() + { + SpecialPurchaseOrderImpl specialPurchaseOrder = new SpecialPurchaseOrderImpl(); + return specialPurchaseOrder; + } + + /** + * + * + * @generated + */ + public TaskContainer createTaskContainer() + { + TaskContainerImpl taskContainer = new TaskContainerImpl(); + return taskContainer; + } + + /** + * + * + * @generated + */ + public Task createTask() + { + TaskImpl task = new TaskImpl(); + return task; + } + + /** + * + * + * @generated + */ + public Unsettable1 createUnsettable1() + { + Unsettable1Impl unsettable1 = new Unsettable1Impl(); + return unsettable1; + } + + /** + * + * + * @generated + */ + public Unsettable2WithDefault createUnsettable2WithDefault() + { + Unsettable2WithDefaultImpl unsettable2WithDefault = new Unsettable2WithDefaultImpl(); + return unsettable2WithDefault; + } + + /** + * + * + * @generated + */ + public PersistentContainment createPersistentContainment() + { + PersistentContainmentImpl persistentContainment = new PersistentContainmentImpl(); + return persistentContainment; + } + + /** + * + * + * @generated + */ + public TransientContainer createTransientContainer() + { + TransientContainerImpl transientContainer = new TransientContainerImpl(); + return transientContainer; + } + + /** + * + * + * @generated + */ + public Model2Package getModel2Package() + { + return (Model2Package)getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static Model2Package getPackage() + { + return Model2Package.eINSTANCE; + } + +} // Model2FactoryImpl diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/Model2PackageImpl.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/Model2PackageImpl.java new file mode 100644 index 0000000000..e4d352a191 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/Model2PackageImpl.java @@ -0,0 +1,804 @@ +/** + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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: + * Eike Stepper - initial API and implementation + * + * $Id: Model2PackageImpl.java,v 1.4 2010-01-08 19:43:27 mfluegge Exp $ + */ +package org.eclipse.emf.cdo.tests.legacy.model2.impl; + +import org.eclipse.emf.cdo.tests.legacy.model1.Model1Package; +import org.eclipse.emf.cdo.tests.legacy.model2.Model2Factory; +import org.eclipse.emf.cdo.tests.legacy.model2.Model2Package; +import org.eclipse.emf.cdo.tests.model2.PersistentContainment; +import org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder; +import org.eclipse.emf.cdo.tests.model2.Task; +import org.eclipse.emf.cdo.tests.model2.TaskContainer; +import org.eclipse.emf.cdo.tests.model2.TransientContainer; +import org.eclipse.emf.cdo.tests.model2.Unsettable1; +import org.eclipse.emf.cdo.tests.model2.Unsettable2WithDefault; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.impl.EPackageImpl; + +/** + * An implementation of the model Package. + * + * @generated + */ +public class Model2PackageImpl extends EPackageImpl implements Model2Package +{ + /** + * + * + * @generated + */ + private EClass specialPurchaseOrderEClass = null; + + /** + * + * + * @generated + */ + private EClass taskContainerEClass = null; + + /** + * + * + * @generated + */ + private EClass taskEClass = null; + + /** + * + * + * @generated + */ + private EClass unsettable1EClass = null; + + /** + * + * + * @generated + */ + private EClass unsettable2WithDefaultEClass = null; + + /** + * + * + * @generated + */ + private EClass persistentContainmentEClass = null; + + /** + * + * + * @generated + */ + private EClass transientContainerEClass = null; + + /** + * Creates an instance of the model Package, registered with {@link org.eclipse.emf.ecore.EPackage.Registry + * EPackage.Registry} by the package package URI value. + *

+ * Note: the correct way to create the package is via the static factory method {@link #init init()}, which also + * performs initialization of the package, or returns the registered package, if one already exists. + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.eclipse.emf.cdo.tests.legacy.model2.Model2Package#eNS_URI + * @see #init() + * @generated + */ + private Model2PackageImpl() + { + super(eNS_URI, Model2Factory.eINSTANCE); + } + + /** + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + *

+ * This method is used to initialize {@link Model2Package#eINSTANCE} when that field is accessed. Clients should not + * invoke it directly. Instead, they should simply access that field to obtain the package. + * + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static Model2Package init() + { + if (isInited) + return (Model2Package)EPackage.Registry.INSTANCE.getEPackage(Model2Package.eNS_URI); + + // Obtain or create and register package + Model2PackageImpl theModel2Package = (Model2PackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof Model2PackageImpl ? EPackage.Registry.INSTANCE + .get(eNS_URI) + : new Model2PackageImpl()); + + isInited = true; + + // Initialize simple dependencies + Model1Package.eINSTANCE.eClass(); + + // Create package meta-data objects + theModel2Package.createPackageContents(); + + // Initialize created meta-data + theModel2Package.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theModel2Package.freeze(); + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(Model2Package.eNS_URI, theModel2Package); + return theModel2Package; + } + + /** + * + * + * @generated + */ + public EClass getSpecialPurchaseOrder() + { + return specialPurchaseOrderEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getSpecialPurchaseOrder_DiscountCode() + { + return (EAttribute)specialPurchaseOrderEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getSpecialPurchaseOrder_ShippingAddress() + { + return (EReference)specialPurchaseOrderEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EClass getTaskContainer() + { + return taskContainerEClass; + } + + /** + * + * + * @generated + */ + public EReference getTaskContainer_Tasks() + { + return (EReference)taskContainerEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getTask() + { + return taskEClass; + } + + /** + * + * + * @generated + */ + public EReference getTask_TaskContainer() + { + return (EReference)taskEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EAttribute getTask_Description() + { + return (EAttribute)taskEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EAttribute getTask_Done() + { + return (EAttribute)taskEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EClass getUnsettable1() + { + return unsettable1EClass; + } + + /** + * + * + * @generated + */ + public EAttribute getUnsettable1_UnsettableBoolean() + { + return (EAttribute)unsettable1EClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EAttribute getUnsettable1_UnsettableByte() + { + return (EAttribute)unsettable1EClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EAttribute getUnsettable1_UnsettableChar() + { + return (EAttribute)unsettable1EClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EAttribute getUnsettable1_UnsettableDate() + { + return (EAttribute)unsettable1EClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + public EAttribute getUnsettable1_UnsettableDouble() + { + return (EAttribute)unsettable1EClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + public EAttribute getUnsettable1_UnsettableFloat() + { + return (EAttribute)unsettable1EClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + public EAttribute getUnsettable1_UnsettableInt() + { + return (EAttribute)unsettable1EClass.getEStructuralFeatures().get(6); + } + + /** + * + * + * @generated + */ + public EAttribute getUnsettable1_UnsettableLong() + { + return (EAttribute)unsettable1EClass.getEStructuralFeatures().get(7); + } + + /** + * + * + * @generated + */ + public EAttribute getUnsettable1_UnsettableShort() + { + return (EAttribute)unsettable1EClass.getEStructuralFeatures().get(8); + } + + /** + * + * + * @generated + */ + public EAttribute getUnsettable1_UnsettableString() + { + return (EAttribute)unsettable1EClass.getEStructuralFeatures().get(9); + } + + /** + * + * + * @generated + */ + public EAttribute getUnsettable1_UnsettableVAT() + { + return (EAttribute)unsettable1EClass.getEStructuralFeatures().get(10); + } + + /** + * + * + * @generated + */ + public EClass getUnsettable2WithDefault() + { + return unsettable2WithDefaultEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getUnsettable2WithDefault_UnsettableBoolean() + { + return (EAttribute)unsettable2WithDefaultEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EAttribute getUnsettable2WithDefault_UnsettableByte() + { + return (EAttribute)unsettable2WithDefaultEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EAttribute getUnsettable2WithDefault_UnsettableChar() + { + return (EAttribute)unsettable2WithDefaultEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EAttribute getUnsettable2WithDefault_UnsettableDate() + { + return (EAttribute)unsettable2WithDefaultEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + public EAttribute getUnsettable2WithDefault_UnsettableDouble() + { + return (EAttribute)unsettable2WithDefaultEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + public EAttribute getUnsettable2WithDefault_UnsettableFloat() + { + return (EAttribute)unsettable2WithDefaultEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + public EAttribute getUnsettable2WithDefault_UnsettableInt() + { + return (EAttribute)unsettable2WithDefaultEClass.getEStructuralFeatures().get(6); + } + + /** + * + * + * @generated + */ + public EAttribute getUnsettable2WithDefault_UnsettableLong() + { + return (EAttribute)unsettable2WithDefaultEClass.getEStructuralFeatures().get(7); + } + + /** + * + * + * @generated + */ + public EAttribute getUnsettable2WithDefault_UnsettableShort() + { + return (EAttribute)unsettable2WithDefaultEClass.getEStructuralFeatures().get(8); + } + + /** + * + * + * @generated + */ + public EAttribute getUnsettable2WithDefault_UnsettableString() + { + return (EAttribute)unsettable2WithDefaultEClass.getEStructuralFeatures().get(9); + } + + /** + * + * + * @generated + */ + public EAttribute getUnsettable2WithDefault_UnsettableVAT() + { + return (EAttribute)unsettable2WithDefaultEClass.getEStructuralFeatures().get(10); + } + + /** + * + * + * @generated + */ + public EClass getPersistentContainment() + { + return persistentContainmentEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getPersistentContainment_AttrBefore() + { + return (EAttribute)persistentContainmentEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getPersistentContainment_Children() + { + return (EReference)persistentContainmentEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EAttribute getPersistentContainment_AttrAfter() + { + return (EAttribute)persistentContainmentEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EClass getTransientContainer() + { + return transientContainerEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getTransientContainer_AttrBefore() + { + return (EAttribute)transientContainerEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getTransientContainer_Parent() + { + return (EReference)transientContainerEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EAttribute getTransientContainer_AttrAfter() + { + return (EAttribute)transientContainerEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public Model2Factory getModel2Factory() + { + return (Model2Factory)getEFactoryInstance(); + } + + /** + * + * + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is guarded to have no affect on any invocation but its + * first. + * + * @generated + */ + public void createPackageContents() + { + if (isCreated) + return; + isCreated = true; + + // Create classes and their features + specialPurchaseOrderEClass = createEClass(SPECIAL_PURCHASE_ORDER); + createEAttribute(specialPurchaseOrderEClass, SPECIAL_PURCHASE_ORDER__DISCOUNT_CODE); + createEReference(specialPurchaseOrderEClass, SPECIAL_PURCHASE_ORDER__SHIPPING_ADDRESS); + + taskContainerEClass = createEClass(TASK_CONTAINER); + createEReference(taskContainerEClass, TASK_CONTAINER__TASKS); + + taskEClass = createEClass(TASK); + createEReference(taskEClass, TASK__TASK_CONTAINER); + createEAttribute(taskEClass, TASK__DESCRIPTION); + createEAttribute(taskEClass, TASK__DONE); + + unsettable1EClass = createEClass(UNSETTABLE1); + createEAttribute(unsettable1EClass, UNSETTABLE1__UNSETTABLE_BOOLEAN); + createEAttribute(unsettable1EClass, UNSETTABLE1__UNSETTABLE_BYTE); + createEAttribute(unsettable1EClass, UNSETTABLE1__UNSETTABLE_CHAR); + createEAttribute(unsettable1EClass, UNSETTABLE1__UNSETTABLE_DATE); + createEAttribute(unsettable1EClass, UNSETTABLE1__UNSETTABLE_DOUBLE); + createEAttribute(unsettable1EClass, UNSETTABLE1__UNSETTABLE_FLOAT); + createEAttribute(unsettable1EClass, UNSETTABLE1__UNSETTABLE_INT); + createEAttribute(unsettable1EClass, UNSETTABLE1__UNSETTABLE_LONG); + createEAttribute(unsettable1EClass, UNSETTABLE1__UNSETTABLE_SHORT); + createEAttribute(unsettable1EClass, UNSETTABLE1__UNSETTABLE_STRING); + createEAttribute(unsettable1EClass, UNSETTABLE1__UNSETTABLE_VAT); + + unsettable2WithDefaultEClass = createEClass(UNSETTABLE2_WITH_DEFAULT); + createEAttribute(unsettable2WithDefaultEClass, UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_BOOLEAN); + createEAttribute(unsettable2WithDefaultEClass, UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_BYTE); + createEAttribute(unsettable2WithDefaultEClass, UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_CHAR); + createEAttribute(unsettable2WithDefaultEClass, UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_DATE); + createEAttribute(unsettable2WithDefaultEClass, UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_DOUBLE); + createEAttribute(unsettable2WithDefaultEClass, UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_FLOAT); + createEAttribute(unsettable2WithDefaultEClass, UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_INT); + createEAttribute(unsettable2WithDefaultEClass, UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_LONG); + createEAttribute(unsettable2WithDefaultEClass, UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_SHORT); + createEAttribute(unsettable2WithDefaultEClass, UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_STRING); + createEAttribute(unsettable2WithDefaultEClass, UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_VAT); + + persistentContainmentEClass = createEClass(PERSISTENT_CONTAINMENT); + createEAttribute(persistentContainmentEClass, PERSISTENT_CONTAINMENT__ATTR_BEFORE); + createEReference(persistentContainmentEClass, PERSISTENT_CONTAINMENT__CHILDREN); + createEAttribute(persistentContainmentEClass, PERSISTENT_CONTAINMENT__ATTR_AFTER); + + transientContainerEClass = createEClass(TRANSIENT_CONTAINER); + createEAttribute(transientContainerEClass, TRANSIENT_CONTAINER__ATTR_BEFORE); + createEReference(transientContainerEClass, TRANSIENT_CONTAINER__PARENT); + createEAttribute(transientContainerEClass, TRANSIENT_CONTAINER__ATTR_AFTER); + } + + /** + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This method is guarded to have no affect on any + * invocation but its first. + * + * @generated + */ + public void initializePackageContents() + { + if (isInitialized) + return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Obtain other dependent packages + Model1Package theModel1Package = (Model1Package)EPackage.Registry.INSTANCE.getEPackage(Model1Package.eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + specialPurchaseOrderEClass.getESuperTypes().add(theModel1Package.getPurchaseOrder()); + + // Initialize classes and features; add operations and parameters + initEClass(specialPurchaseOrderEClass, SpecialPurchaseOrder.class, "SpecialPurchaseOrder", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getSpecialPurchaseOrder_DiscountCode(), ecorePackage.getEString(), "discountCode", null, 0, 1, + SpecialPurchaseOrder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + initEReference(getSpecialPurchaseOrder_ShippingAddress(), theModel1Package.getAddress(), null, "shippingAddress", + null, 0, 1, SpecialPurchaseOrder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(taskContainerEClass, TaskContainer.class, "TaskContainer", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getTaskContainer_Tasks(), this.getTask(), this.getTask_TaskContainer(), "tasks", null, 0, -1, + TaskContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(taskEClass, Task.class, "Task", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getTask_TaskContainer(), this.getTaskContainer(), this.getTaskContainer_Tasks(), "taskContainer", + null, 0, 1, Task.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getTask_Description(), ecorePackage.getEString(), "description", null, 0, 1, Task.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getTask_Done(), ecorePackage.getEBoolean(), "done", null, 0, 1, Task.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(unsettable1EClass, Unsettable1.class, "Unsettable1", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getUnsettable1_UnsettableBoolean(), ecorePackage.getEBoolean(), "unsettableBoolean", null, 0, 1, + Unsettable1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + IS_ORDERED); + initEAttribute(getUnsettable1_UnsettableByte(), ecorePackage.getEByte(), "unsettableByte", null, 0, 1, + Unsettable1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + IS_ORDERED); + initEAttribute(getUnsettable1_UnsettableChar(), ecorePackage.getEChar(), "unsettableChar", null, 0, 1, + Unsettable1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + IS_ORDERED); + initEAttribute(getUnsettable1_UnsettableDate(), ecorePackage.getEDate(), "unsettableDate", null, 0, 1, + Unsettable1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + IS_ORDERED); + initEAttribute(getUnsettable1_UnsettableDouble(), ecorePackage.getEDouble(), "unsettableDouble", null, 0, 1, + Unsettable1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + IS_ORDERED); + initEAttribute(getUnsettable1_UnsettableFloat(), ecorePackage.getEFloat(), "unsettableFloat", null, 0, 1, + Unsettable1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + IS_ORDERED); + initEAttribute(getUnsettable1_UnsettableInt(), ecorePackage.getEInt(), "unsettableInt", null, 0, 1, + Unsettable1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + IS_ORDERED); + initEAttribute(getUnsettable1_UnsettableLong(), ecorePackage.getELong(), "unsettableLong", null, 0, 1, + Unsettable1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + IS_ORDERED); + initEAttribute(getUnsettable1_UnsettableShort(), ecorePackage.getEShort(), "unsettableShort", null, 0, 1, + Unsettable1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + IS_ORDERED); + initEAttribute(getUnsettable1_UnsettableString(), ecorePackage.getEString(), "unsettableString", null, 0, 1, + Unsettable1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + IS_ORDERED); + initEAttribute(getUnsettable1_UnsettableVAT(), theModel1Package.getVAT(), "unsettableVAT", null, 0, 1, + Unsettable1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + IS_ORDERED); + + initEClass(unsettable2WithDefaultEClass, Unsettable2WithDefault.class, "Unsettable2WithDefault", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getUnsettable2WithDefault_UnsettableBoolean(), ecorePackage.getEBoolean(), "unsettableBoolean", + "true", 0, 1, Unsettable2WithDefault.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getUnsettable2WithDefault_UnsettableByte(), ecorePackage.getEByte(), "unsettableByte", "3", 0, 1, + Unsettable2WithDefault.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + initEAttribute(getUnsettable2WithDefault_UnsettableChar(), ecorePackage.getEChar(), "unsettableChar", "\'x\'", 0, + 1, Unsettable2WithDefault.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + initEAttribute(getUnsettable2WithDefault_UnsettableDate(), ecorePackage.getEDate(), "unsettableDate", + "2009-12-21T15:12:59", 0, 1, Unsettable2WithDefault.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getUnsettable2WithDefault_UnsettableDouble(), ecorePackage.getEDouble(), "unsettableDouble", "3.3", + 0, 1, Unsettable2WithDefault.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getUnsettable2WithDefault_UnsettableFloat(), ecorePackage.getEFloat(), "unsettableFloat", "4.4", 0, + 1, Unsettable2WithDefault.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + initEAttribute(getUnsettable2WithDefault_UnsettableInt(), ecorePackage.getEInt(), "unsettableInt", "5", 0, 1, + Unsettable2WithDefault.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + initEAttribute(getUnsettable2WithDefault_UnsettableLong(), ecorePackage.getELong(), "unsettableLong", "6", 0, 1, + Unsettable2WithDefault.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + initEAttribute(getUnsettable2WithDefault_UnsettableShort(), ecorePackage.getEShort(), "unsettableShort", "7", 0, 1, + Unsettable2WithDefault.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + initEAttribute(getUnsettable2WithDefault_UnsettableString(), ecorePackage.getEString(), "unsettableString", + "\"eike\"", 0, 1, Unsettable2WithDefault.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, + !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getUnsettable2WithDefault_UnsettableVAT(), theModel1Package.getVAT(), "unsettableVAT", "VAT15", 0, + 1, Unsettable2WithDefault.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + + initEClass(persistentContainmentEClass, PersistentContainment.class, "PersistentContainment", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getPersistentContainment_AttrBefore(), ecorePackage.getEString(), "attrBefore", null, 0, 1, + PersistentContainment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + initEReference(getPersistentContainment_Children(), this.getTransientContainer(), this + .getTransientContainer_Parent(), "children", null, 0, -1, PersistentContainment.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEAttribute(getPersistentContainment_AttrAfter(), ecorePackage.getEString(), "attrAfter", null, 0, 1, + PersistentContainment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + + initEClass(transientContainerEClass, TransientContainer.class, "TransientContainer", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getTransientContainer_AttrBefore(), ecorePackage.getEString(), "attrBefore", null, 0, 1, + TransientContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + initEReference(getTransientContainer_Parent(), this.getPersistentContainment(), this + .getPersistentContainment_Children(), "parent", null, 0, 1, TransientContainer.class, IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, + IS_ORDERED); + initEAttribute(getTransientContainer_AttrAfter(), ecorePackage.getEString(), "attrAfter", null, 0, 1, + TransientContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + + // Create resource + createResource(eNS_URI); + } + +} // Model2PackageImpl diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/PersistentContainmentImpl.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/PersistentContainmentImpl.java new file mode 100644 index 0000000000..744719771a --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/PersistentContainmentImpl.java @@ -0,0 +1,323 @@ +/** + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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: + * Eike Stepper - initial API and implementation + * + * $Id: PersistentContainmentImpl.java,v 1.1 2010-01-08 19:43:27 mfluegge Exp $ + */ +package org.eclipse.emf.cdo.tests.legacy.model2.impl; + +import org.eclipse.emf.cdo.tests.model2.Model2Package; +import org.eclipse.emf.cdo.tests.model2.PersistentContainment; +import org.eclipse.emf.cdo.tests.model2.TransientContainer; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import java.util.Collection; + +/** + * An implementation of the model object 'Persistent Containment'. + *

+ * The following features are implemented: + *

+ *

+ * + * @generated + */ +public class PersistentContainmentImpl extends EObjectImpl implements PersistentContainment +{ + /** + * The default value of the '{@link #getAttrBefore() Attr Before}' attribute. + * + * @see #getAttrBefore() + * @generated + * @ordered + */ + protected static final String ATTR_BEFORE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getAttrBefore() Attr Before}' attribute. + * + * @see #getAttrBefore() + * @generated + * @ordered + */ + protected String attrBefore = ATTR_BEFORE_EDEFAULT; + + /** + * The cached value of the '{@link #getChildren() Children}' containment reference list. + * + * @see #getChildren() + * @generated + * @ordered + */ + protected EList children; + + /** + * The default value of the '{@link #getAttrAfter() Attr After}' attribute. + * + * @see #getAttrAfter() + * @generated + * @ordered + */ + protected static final String ATTR_AFTER_EDEFAULT = null; + + /** + * The cached value of the '{@link #getAttrAfter() Attr After}' attribute. + * + * @see #getAttrAfter() + * @generated + * @ordered + */ + protected String attrAfter = ATTR_AFTER_EDEFAULT; + + /** + * + * + * @generated + */ + protected PersistentContainmentImpl() + { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() + { + return Model2Package.Literals.PERSISTENT_CONTAINMENT; + } + + /** + * + * + * @generated + */ + public String getAttrBefore() + { + return attrBefore; + } + + /** + * + * + * @generated + */ + public void setAttrBefore(String newAttrBefore) + { + String oldAttrBefore = attrBefore; + attrBefore = newAttrBefore; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.PERSISTENT_CONTAINMENT__ATTR_BEFORE, + oldAttrBefore, attrBefore)); + } + + /** + * + * + * @generated + */ + public EList getChildren() + { + if (children == null) + { + children = new EObjectContainmentWithInverseEList(TransientContainer.class, this, + Model2Package.PERSISTENT_CONTAINMENT__CHILDREN, Model2Package.TRANSIENT_CONTAINER__PARENT); + } + return children; + } + + /** + * + * + * @generated + */ + public String getAttrAfter() + { + return attrAfter; + } + + /** + * + * + * @generated + */ + public void setAttrAfter(String newAttrAfter) + { + String oldAttrAfter = attrAfter; + attrAfter = newAttrAfter; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.PERSISTENT_CONTAINMENT__ATTR_AFTER, + oldAttrAfter, attrAfter)); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case Model2Package.PERSISTENT_CONTAINMENT__CHILDREN: + return ((InternalEList)(InternalEList)getChildren()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case Model2Package.PERSISTENT_CONTAINMENT__CHILDREN: + return ((InternalEList)getChildren()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case Model2Package.PERSISTENT_CONTAINMENT__ATTR_BEFORE: + return getAttrBefore(); + case Model2Package.PERSISTENT_CONTAINMENT__CHILDREN: + return getChildren(); + case Model2Package.PERSISTENT_CONTAINMENT__ATTR_AFTER: + return getAttrAfter(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case Model2Package.PERSISTENT_CONTAINMENT__ATTR_BEFORE: + setAttrBefore((String)newValue); + return; + case Model2Package.PERSISTENT_CONTAINMENT__CHILDREN: + getChildren().clear(); + getChildren().addAll((Collection)newValue); + return; + case Model2Package.PERSISTENT_CONTAINMENT__ATTR_AFTER: + setAttrAfter((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case Model2Package.PERSISTENT_CONTAINMENT__ATTR_BEFORE: + setAttrBefore(ATTR_BEFORE_EDEFAULT); + return; + case Model2Package.PERSISTENT_CONTAINMENT__CHILDREN: + getChildren().clear(); + return; + case Model2Package.PERSISTENT_CONTAINMENT__ATTR_AFTER: + setAttrAfter(ATTR_AFTER_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case Model2Package.PERSISTENT_CONTAINMENT__ATTR_BEFORE: + return ATTR_BEFORE_EDEFAULT == null ? attrBefore != null : !ATTR_BEFORE_EDEFAULT.equals(attrBefore); + case Model2Package.PERSISTENT_CONTAINMENT__CHILDREN: + return children != null && !children.isEmpty(); + case Model2Package.PERSISTENT_CONTAINMENT__ATTR_AFTER: + return ATTR_AFTER_EDEFAULT == null ? attrAfter != null : !ATTR_AFTER_EDEFAULT.equals(attrAfter); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() + { + if (eIsProxy()) + return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (attrBefore: "); + result.append(attrBefore); + result.append(", attrAfter: "); + result.append(attrAfter); + result.append(')'); + return result.toString(); + } + +} // PersistentContainmentImpl diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/SpecialPurchaseOrderImpl.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/SpecialPurchaseOrderImpl.java new file mode 100644 index 0000000000..1d996e131b --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/SpecialPurchaseOrderImpl.java @@ -0,0 +1,284 @@ +/** + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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: + * Eike Stepper - initial API and implementation + * + * $Id: SpecialPurchaseOrderImpl.java,v 1.4 2010-01-08 19:43:28 mfluegge Exp $ + */ +package org.eclipse.emf.cdo.tests.legacy.model2.impl; + +import org.eclipse.emf.cdo.tests.legacy.model1.impl.PurchaseOrderImpl; +import org.eclipse.emf.cdo.tests.legacy.model2.Model2Package; +import org.eclipse.emf.cdo.tests.model1.Address; +import org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +/** + * An implementation of the model object 'Special Purchase Order'. + *

+ * The following features are implemented: + *

    + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.SpecialPurchaseOrderImpl#getDiscountCode Discount Code + * }
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.SpecialPurchaseOrderImpl#getShippingAddress Shipping + * Address}
  • + *
+ *

+ * + * @generated + */ +public class SpecialPurchaseOrderImpl extends PurchaseOrderImpl implements SpecialPurchaseOrder +{ + /** + * The default value of the '{@link #getDiscountCode() Discount Code}' attribute. + * + * + * @see #getDiscountCode() + * @generated + * @ordered + */ + protected static final String DISCOUNT_CODE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getDiscountCode() Discount Code}' attribute. + * + * @see #getDiscountCode() + * @generated + * @ordered + */ + protected String discountCode = DISCOUNT_CODE_EDEFAULT; + + /** + * The cached value of the '{@link #getShippingAddress() Shipping Address}' containment reference. + * + * @see #getShippingAddress() + * @generated + * @ordered + */ + protected Address shippingAddress; + + /** + * + * + * @generated + */ + protected SpecialPurchaseOrderImpl() + { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() + { + return Model2Package.Literals.SPECIAL_PURCHASE_ORDER; + } + + /** + * + * + * @generated + */ + public String getDiscountCode() + { + return discountCode; + } + + /** + * + * + * @generated + */ + public void setDiscountCode(String newDiscountCode) + { + String oldDiscountCode = discountCode; + discountCode = newDiscountCode; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.SPECIAL_PURCHASE_ORDER__DISCOUNT_CODE, + oldDiscountCode, discountCode)); + } + + /** + * + * + * @generated + */ + public Address getShippingAddress() + { + return shippingAddress; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetShippingAddress(Address newShippingAddress, NotificationChain msgs) + { + Address oldShippingAddress = shippingAddress; + shippingAddress = newShippingAddress; + if (eNotificationRequired()) + { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Model2Package.SPECIAL_PURCHASE_ORDER__SHIPPING_ADDRESS, oldShippingAddress, newShippingAddress); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setShippingAddress(Address newShippingAddress) + { + if (newShippingAddress != shippingAddress) + { + NotificationChain msgs = null; + if (shippingAddress != null) + msgs = ((InternalEObject)shippingAddress).eInverseRemove(this, EOPPOSITE_FEATURE_BASE + - Model2Package.SPECIAL_PURCHASE_ORDER__SHIPPING_ADDRESS, null, msgs); + if (newShippingAddress != null) + msgs = ((InternalEObject)newShippingAddress).eInverseAdd(this, EOPPOSITE_FEATURE_BASE + - Model2Package.SPECIAL_PURCHASE_ORDER__SHIPPING_ADDRESS, null, msgs); + msgs = basicSetShippingAddress(newShippingAddress, msgs); + if (msgs != null) + msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.SPECIAL_PURCHASE_ORDER__SHIPPING_ADDRESS, + newShippingAddress, newShippingAddress)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case Model2Package.SPECIAL_PURCHASE_ORDER__SHIPPING_ADDRESS: + return basicSetShippingAddress(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case Model2Package.SPECIAL_PURCHASE_ORDER__DISCOUNT_CODE: + return getDiscountCode(); + case Model2Package.SPECIAL_PURCHASE_ORDER__SHIPPING_ADDRESS: + return getShippingAddress(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case Model2Package.SPECIAL_PURCHASE_ORDER__DISCOUNT_CODE: + setDiscountCode((String)newValue); + return; + case Model2Package.SPECIAL_PURCHASE_ORDER__SHIPPING_ADDRESS: + setShippingAddress((Address)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case Model2Package.SPECIAL_PURCHASE_ORDER__DISCOUNT_CODE: + setDiscountCode(DISCOUNT_CODE_EDEFAULT); + return; + case Model2Package.SPECIAL_PURCHASE_ORDER__SHIPPING_ADDRESS: + setShippingAddress((Address)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case Model2Package.SPECIAL_PURCHASE_ORDER__DISCOUNT_CODE: + return DISCOUNT_CODE_EDEFAULT == null ? discountCode != null : !DISCOUNT_CODE_EDEFAULT.equals(discountCode); + case Model2Package.SPECIAL_PURCHASE_ORDER__SHIPPING_ADDRESS: + return shippingAddress != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() + { + if (eIsProxy()) + return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (discountCode: "); + result.append(discountCode); + result.append(')'); + return result.toString(); + } + +} // SpecialPurchaseOrderImpl diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/TaskContainerImpl.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/TaskContainerImpl.java new file mode 100644 index 0000000000..a5505e5175 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/TaskContainerImpl.java @@ -0,0 +1,189 @@ +/** + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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: + * Eike Stepper - initial API and implementation + * + * $Id: TaskContainerImpl.java,v 1.1 2010-01-08 19:43:27 mfluegge Exp $ + */ +package org.eclipse.emf.cdo.tests.legacy.model2.impl; + +import org.eclipse.emf.cdo.tests.model2.Model2Package; +import org.eclipse.emf.cdo.tests.model2.Task; +import org.eclipse.emf.cdo.tests.model2.TaskContainer; + +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import java.util.Collection; + +/** + * An implementation of the model object 'Task Container'. + *

+ * The following features are implemented: + *

    + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.TaskContainerImpl#getTasks Tasks}
  • + *
+ *

+ * + * @generated + */ +public class TaskContainerImpl extends EObjectImpl implements TaskContainer +{ + /** + * The cached value of the '{@link #getTasks() Tasks}' containment reference list. + * + * + * @see #getTasks() + * @generated + * @ordered + */ + protected EList tasks; + + /** + * + * + * @generated + */ + protected TaskContainerImpl() + { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() + { + return Model2Package.Literals.TASK_CONTAINER; + } + + /** + * + * + * @generated + */ + public EList getTasks() + { + if (tasks == null) + { + tasks = new EObjectContainmentWithInverseEList(Task.class, this, Model2Package.TASK_CONTAINER__TASKS, + Model2Package.TASK__TASK_CONTAINER); + } + return tasks; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case Model2Package.TASK_CONTAINER__TASKS: + return ((InternalEList)(InternalEList)getTasks()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case Model2Package.TASK_CONTAINER__TASKS: + return ((InternalEList)getTasks()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case Model2Package.TASK_CONTAINER__TASKS: + return getTasks(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case Model2Package.TASK_CONTAINER__TASKS: + getTasks().clear(); + getTasks().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case Model2Package.TASK_CONTAINER__TASKS: + getTasks().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case Model2Package.TASK_CONTAINER__TASKS: + return tasks != null && !tasks.isEmpty(); + } + return super.eIsSet(featureID); + } + +} // TaskContainerImpl diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/TaskImpl.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/TaskImpl.java new file mode 100644 index 0000000000..e2ea64c39c --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/TaskImpl.java @@ -0,0 +1,354 @@ +/** + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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: + * Eike Stepper - initial API and implementation + * + * $Id: TaskImpl.java,v 1.1 2010-01-08 19:43:27 mfluegge Exp $ + */ +package org.eclipse.emf.cdo.tests.legacy.model2.impl; + +import org.eclipse.emf.cdo.tests.legacy.model2.Model2Package; +import org.eclipse.emf.cdo.tests.model2.Task; +import org.eclipse.emf.cdo.tests.model2.TaskContainer; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.emf.ecore.util.EcoreUtil; + +/** + * An implementation of the model object 'Task'. + *

+ * The following features are implemented: + *

    + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.TaskImpl#getTaskContainer Task Container}
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.TaskImpl#getDescription Description}
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.TaskImpl#isDone Done}
  • + *
+ *

+ * + * @generated + */ +public class TaskImpl extends EObjectImpl implements Task +{ + /** + * The default value of the '{@link #getDescription() Description}' attribute. + * + * @see #getDescription() + * @generated + * @ordered + */ + protected static final String DESCRIPTION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getDescription() Description}' attribute. + * + * @see #getDescription() + * @generated + * @ordered + */ + protected String description = DESCRIPTION_EDEFAULT; + + /** + * The default value of the '{@link #isDone() Done}' attribute. + * + * @see #isDone() + * @generated + * @ordered + */ + protected static final boolean DONE_EDEFAULT = false; + + /** + * The cached value of the '{@link #isDone() Done}' attribute. + * + * @see #isDone() + * @generated + * @ordered + */ + protected boolean done = DONE_EDEFAULT; + + /** + * + * + * @generated + */ + protected TaskImpl() + { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() + { + return Model2Package.Literals.TASK; + } + + /** + * + * + * @generated + */ + public TaskContainer getTaskContainer() + { + if (eContainerFeatureID() != Model2Package.TASK__TASK_CONTAINER) + return null; + return (TaskContainer)eContainer(); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetTaskContainer(TaskContainer newTaskContainer, NotificationChain msgs) + { + msgs = eBasicSetContainer((InternalEObject)newTaskContainer, Model2Package.TASK__TASK_CONTAINER, msgs); + return msgs; + } + + /** + * + * + * @generated + */ + public void setTaskContainer(TaskContainer newTaskContainer) + { + if (newTaskContainer != eInternalContainer() + || (eContainerFeatureID() != Model2Package.TASK__TASK_CONTAINER && newTaskContainer != null)) + { + if (EcoreUtil.isAncestor(this, newTaskContainer)) + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + NotificationChain msgs = null; + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + if (newTaskContainer != null) + msgs = ((InternalEObject)newTaskContainer).eInverseAdd(this, Model2Package.TASK_CONTAINER__TASKS, + TaskContainer.class, msgs); + msgs = basicSetTaskContainer(newTaskContainer, msgs); + if (msgs != null) + msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.TASK__TASK_CONTAINER, newTaskContainer, + newTaskContainer)); + } + + /** + * + * + * @generated + */ + public String getDescription() + { + return description; + } + + /** + * + * + * @generated + */ + public void setDescription(String newDescription) + { + String oldDescription = description; + description = newDescription; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.TASK__DESCRIPTION, oldDescription, + description)); + } + + /** + * + * + * @generated + */ + public boolean isDone() + { + return done; + } + + /** + * + * + * @generated + */ + public void setDone(boolean newDone) + { + boolean oldDone = done; + done = newDone; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.TASK__DONE, oldDone, done)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case Model2Package.TASK__TASK_CONTAINER: + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + return basicSetTaskContainer((TaskContainer)otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case Model2Package.TASK__TASK_CONTAINER: + return basicSetTaskContainer(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) + { + switch (eContainerFeatureID()) + { + case Model2Package.TASK__TASK_CONTAINER: + return eInternalContainer().eInverseRemove(this, Model2Package.TASK_CONTAINER__TASKS, TaskContainer.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case Model2Package.TASK__TASK_CONTAINER: + return getTaskContainer(); + case Model2Package.TASK__DESCRIPTION: + return getDescription(); + case Model2Package.TASK__DONE: + return isDone(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case Model2Package.TASK__TASK_CONTAINER: + setTaskContainer((TaskContainer)newValue); + return; + case Model2Package.TASK__DESCRIPTION: + setDescription((String)newValue); + return; + case Model2Package.TASK__DONE: + setDone((Boolean)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case Model2Package.TASK__TASK_CONTAINER: + setTaskContainer((TaskContainer)null); + return; + case Model2Package.TASK__DESCRIPTION: + setDescription(DESCRIPTION_EDEFAULT); + return; + case Model2Package.TASK__DONE: + setDone(DONE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case Model2Package.TASK__TASK_CONTAINER: + return getTaskContainer() != null; + case Model2Package.TASK__DESCRIPTION: + return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description); + case Model2Package.TASK__DONE: + return done != DONE_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() + { + if (eIsProxy()) + return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (description: "); + result.append(description); + result.append(", done: "); + result.append(done); + result.append(')'); + return result.toString(); + } + +} // TaskImpl diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/TransientContainerImpl.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/TransientContainerImpl.java new file mode 100644 index 0000000000..631e28563e --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/TransientContainerImpl.java @@ -0,0 +1,359 @@ +/** + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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: + * Eike Stepper - initial API and implementation + * + * $Id: TransientContainerImpl.java,v 1.1 2010-01-08 19:43:27 mfluegge Exp $ + */ +package org.eclipse.emf.cdo.tests.legacy.model2.impl; + +import org.eclipse.emf.cdo.tests.legacy.model2.Model2Package; +import org.eclipse.emf.cdo.tests.model2.PersistentContainment; +import org.eclipse.emf.cdo.tests.model2.TransientContainer; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.emf.ecore.util.EcoreUtil; + +/** + * An implementation of the model object 'Transient Container'. + *

+ * The following features are implemented: + *

    + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.TransientContainerImpl#getAttrBefore Attr Before}
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.TransientContainerImpl#getParent Parent}
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.TransientContainerImpl#getAttrAfter Attr After}
  • + *
+ *

+ * + * @generated + */ +public class TransientContainerImpl extends EObjectImpl implements TransientContainer +{ + /** + * The default value of the '{@link #getAttrBefore() Attr Before}' attribute. + * + * @see #getAttrBefore() + * @generated + * @ordered + */ + protected static final String ATTR_BEFORE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getAttrBefore() Attr Before}' attribute. + * + * @see #getAttrBefore() + * @generated + * @ordered + */ + protected String attrBefore = ATTR_BEFORE_EDEFAULT; + + /** + * The default value of the '{@link #getAttrAfter() Attr After}' attribute. + * + * @see #getAttrAfter() + * @generated + * @ordered + */ + protected static final String ATTR_AFTER_EDEFAULT = null; + + /** + * The cached value of the '{@link #getAttrAfter() Attr After}' attribute. + * + * @see #getAttrAfter() + * @generated + * @ordered + */ + protected String attrAfter = ATTR_AFTER_EDEFAULT; + + /** + * + * + * @generated + */ + protected TransientContainerImpl() + { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() + { + return Model2Package.Literals.TRANSIENT_CONTAINER; + } + + /** + * + * + * @generated + */ + public String getAttrBefore() + { + return attrBefore; + } + + /** + * + * + * @generated + */ + public void setAttrBefore(String newAttrBefore) + { + String oldAttrBefore = attrBefore; + attrBefore = newAttrBefore; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.TRANSIENT_CONTAINER__ATTR_BEFORE, + oldAttrBefore, attrBefore)); + } + + /** + * + * + * @generated + */ + public PersistentContainment getParent() + { + if (eContainerFeatureID() != Model2Package.TRANSIENT_CONTAINER__PARENT) + return null; + return (PersistentContainment)eContainer(); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetParent(PersistentContainment newParent, NotificationChain msgs) + { + msgs = eBasicSetContainer((InternalEObject)newParent, Model2Package.TRANSIENT_CONTAINER__PARENT, msgs); + return msgs; + } + + /** + * + * + * @generated + */ + public void setParent(PersistentContainment newParent) + { + if (newParent != eInternalContainer() + || (eContainerFeatureID() != Model2Package.TRANSIENT_CONTAINER__PARENT && newParent != null)) + { + if (EcoreUtil.isAncestor(this, newParent)) + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + NotificationChain msgs = null; + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + if (newParent != null) + msgs = ((InternalEObject)newParent).eInverseAdd(this, Model2Package.PERSISTENT_CONTAINMENT__CHILDREN, + PersistentContainment.class, msgs); + msgs = basicSetParent(newParent, msgs); + if (msgs != null) + msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.TRANSIENT_CONTAINER__PARENT, newParent, + newParent)); + } + + /** + * + * + * @generated + */ + public String getAttrAfter() + { + return attrAfter; + } + + /** + * + * + * @generated + */ + public void setAttrAfter(String newAttrAfter) + { + String oldAttrAfter = attrAfter; + attrAfter = newAttrAfter; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.TRANSIENT_CONTAINER__ATTR_AFTER, + oldAttrAfter, attrAfter)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case Model2Package.TRANSIENT_CONTAINER__PARENT: + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + return basicSetParent((PersistentContainment)otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case Model2Package.TRANSIENT_CONTAINER__PARENT: + return basicSetParent(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) + { + switch (eContainerFeatureID()) + { + case Model2Package.TRANSIENT_CONTAINER__PARENT: + return eInternalContainer().eInverseRemove(this, Model2Package.PERSISTENT_CONTAINMENT__CHILDREN, + PersistentContainment.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case Model2Package.TRANSIENT_CONTAINER__ATTR_BEFORE: + return getAttrBefore(); + case Model2Package.TRANSIENT_CONTAINER__PARENT: + return getParent(); + case Model2Package.TRANSIENT_CONTAINER__ATTR_AFTER: + return getAttrAfter(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case Model2Package.TRANSIENT_CONTAINER__ATTR_BEFORE: + setAttrBefore((String)newValue); + return; + case Model2Package.TRANSIENT_CONTAINER__PARENT: + setParent((PersistentContainment)newValue); + return; + case Model2Package.TRANSIENT_CONTAINER__ATTR_AFTER: + setAttrAfter((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case Model2Package.TRANSIENT_CONTAINER__ATTR_BEFORE: + setAttrBefore(ATTR_BEFORE_EDEFAULT); + return; + case Model2Package.TRANSIENT_CONTAINER__PARENT: + setParent((PersistentContainment)null); + return; + case Model2Package.TRANSIENT_CONTAINER__ATTR_AFTER: + setAttrAfter(ATTR_AFTER_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case Model2Package.TRANSIENT_CONTAINER__ATTR_BEFORE: + return ATTR_BEFORE_EDEFAULT == null ? attrBefore != null : !ATTR_BEFORE_EDEFAULT.equals(attrBefore); + case Model2Package.TRANSIENT_CONTAINER__PARENT: + return getParent() != null; + case Model2Package.TRANSIENT_CONTAINER__ATTR_AFTER: + return ATTR_AFTER_EDEFAULT == null ? attrAfter != null : !ATTR_AFTER_EDEFAULT.equals(attrAfter); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() + { + if (eIsProxy()) + return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (attrBefore: "); + result.append(attrBefore); + result.append(", attrAfter: "); + result.append(attrAfter); + result.append(')'); + return result.toString(); + } + +} // TransientContainerImpl diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/Unsettable1Impl.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/Unsettable1Impl.java new file mode 100644 index 0000000000..25a5cf02d9 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/Unsettable1Impl.java @@ -0,0 +1,1192 @@ +/** + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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: + * Eike Stepper - initial API and implementation + * + * $Id: Unsettable1Impl.java,v 1.1 2010-01-08 19:43:27 mfluegge Exp $ + */ +package org.eclipse.emf.cdo.tests.legacy.model2.impl; + +import org.eclipse.emf.cdo.tests.model1.VAT; +import org.eclipse.emf.cdo.tests.model2.Model2Package; +import org.eclipse.emf.cdo.tests.model2.Unsettable1; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import java.util.Date; + +/** + * An implementation of the model object 'Unsettable1'. + *

+ * The following features are implemented: + *

    + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable1Impl#isUnsettableBoolean Unsettable Boolean + * }
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable1Impl#getUnsettableByte Unsettable Byte}
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable1Impl#getUnsettableChar Unsettable Char}
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable1Impl#getUnsettableDate Unsettable Date}
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable1Impl#getUnsettableDouble Unsettable Double + * }
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable1Impl#getUnsettableFloat Unsettable Float} + *
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable1Impl#getUnsettableInt Unsettable Int}
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable1Impl#getUnsettableLong Unsettable Long}
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable1Impl#getUnsettableShort Unsettable Short} + *
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable1Impl#getUnsettableString Unsettable String + * }
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable1Impl#getUnsettableVAT Unsettable VAT}
  • + *
+ *

+ * + * @generated + */ +public class Unsettable1Impl extends EObjectImpl implements Unsettable1 +{ + /** + * The default value of the '{@link #isUnsettableBoolean() Unsettable Boolean}' attribute. + * + * @see #isUnsettableBoolean() + * @generated + * @ordered + */ + protected static final boolean UNSETTABLE_BOOLEAN_EDEFAULT = false; + + /** + * The cached value of the '{@link #isUnsettableBoolean() Unsettable Boolean}' attribute. + * + * @see #isUnsettableBoolean() + * @generated + * @ordered + */ + protected boolean unsettableBoolean = UNSETTABLE_BOOLEAN_EDEFAULT; + + /** + * This is true if the Unsettable Boolean attribute has been set. + * + * @generated + * @ordered + */ + protected boolean unsettableBooleanESet; + + /** + * The default value of the '{@link #getUnsettableByte() Unsettable Byte}' attribute. + * + * + * @see #getUnsettableByte() + * @generated + * @ordered + */ + protected static final byte UNSETTABLE_BYTE_EDEFAULT = 0x00; + + /** + * The cached value of the '{@link #getUnsettableByte() Unsettable Byte}' attribute. + * + * + * @see #getUnsettableByte() + * @generated + * @ordered + */ + protected byte unsettableByte = UNSETTABLE_BYTE_EDEFAULT; + + /** + * This is true if the Unsettable Byte attribute has been set. + * + * @generated + * @ordered + */ + protected boolean unsettableByteESet; + + /** + * The default value of the '{@link #getUnsettableChar() Unsettable Char}' attribute. + * + * + * @see #getUnsettableChar() + * @generated + * @ordered + */ + protected static final char UNSETTABLE_CHAR_EDEFAULT = '\u0000'; + + /** + * The cached value of the '{@link #getUnsettableChar() Unsettable Char}' attribute. + * + * + * @see #getUnsettableChar() + * @generated + * @ordered + */ + protected char unsettableChar = UNSETTABLE_CHAR_EDEFAULT; + + /** + * This is true if the Unsettable Char attribute has been set. + * + * @generated + * @ordered + */ + protected boolean unsettableCharESet; + + /** + * The default value of the '{@link #getUnsettableDate() Unsettable Date}' attribute. + * + * + * @see #getUnsettableDate() + * @generated + * @ordered + */ + protected static final Date UNSETTABLE_DATE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getUnsettableDate() Unsettable Date}' attribute. + * + * + * @see #getUnsettableDate() + * @generated + * @ordered + */ + protected Date unsettableDate = UNSETTABLE_DATE_EDEFAULT; + + /** + * This is true if the Unsettable Date attribute has been set. + * + * @generated + * @ordered + */ + protected boolean unsettableDateESet; + + /** + * The default value of the '{@link #getUnsettableDouble() Unsettable Double}' attribute. + * + * @see #getUnsettableDouble() + * @generated + * @ordered + */ + protected static final double UNSETTABLE_DOUBLE_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getUnsettableDouble() Unsettable Double}' attribute. + * + * @see #getUnsettableDouble() + * @generated + * @ordered + */ + protected double unsettableDouble = UNSETTABLE_DOUBLE_EDEFAULT; + + /** + * This is true if the Unsettable Double attribute has been set. + * + * @generated + * @ordered + */ + protected boolean unsettableDoubleESet; + + /** + * The default value of the '{@link #getUnsettableFloat() Unsettable Float}' attribute. + * + * @see #getUnsettableFloat() + * @generated + * @ordered + */ + protected static final float UNSETTABLE_FLOAT_EDEFAULT = 0.0F; + + /** + * The cached value of the '{@link #getUnsettableFloat() Unsettable Float}' attribute. + * + * @see #getUnsettableFloat() + * @generated + * @ordered + */ + protected float unsettableFloat = UNSETTABLE_FLOAT_EDEFAULT; + + /** + * This is true if the Unsettable Float attribute has been set. + * + * @generated + * @ordered + */ + protected boolean unsettableFloatESet; + + /** + * The default value of the '{@link #getUnsettableInt() Unsettable Int}' attribute. + * + * + * @see #getUnsettableInt() + * @generated + * @ordered + */ + protected static final int UNSETTABLE_INT_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getUnsettableInt() Unsettable Int}' attribute. + * + * + * @see #getUnsettableInt() + * @generated + * @ordered + */ + protected int unsettableInt = UNSETTABLE_INT_EDEFAULT; + + /** + * This is true if the Unsettable Int attribute has been set. + * + * @generated + * @ordered + */ + protected boolean unsettableIntESet; + + /** + * The default value of the '{@link #getUnsettableLong() Unsettable Long}' attribute. + * + * + * @see #getUnsettableLong() + * @generated + * @ordered + */ + protected static final long UNSETTABLE_LONG_EDEFAULT = 0L; + + /** + * The cached value of the '{@link #getUnsettableLong() Unsettable Long}' attribute. + * + * + * @see #getUnsettableLong() + * @generated + * @ordered + */ + protected long unsettableLong = UNSETTABLE_LONG_EDEFAULT; + + /** + * This is true if the Unsettable Long attribute has been set. + * + * @generated + * @ordered + */ + protected boolean unsettableLongESet; + + /** + * The default value of the '{@link #getUnsettableShort() Unsettable Short}' attribute. + * + * @see #getUnsettableShort() + * @generated + * @ordered + */ + protected static final short UNSETTABLE_SHORT_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getUnsettableShort() Unsettable Short}' attribute. + * + * @see #getUnsettableShort() + * @generated + * @ordered + */ + protected short unsettableShort = UNSETTABLE_SHORT_EDEFAULT; + + /** + * This is true if the Unsettable Short attribute has been set. + * + * @generated + * @ordered + */ + protected boolean unsettableShortESet; + + /** + * The default value of the '{@link #getUnsettableString() Unsettable String}' attribute. + * + * @see #getUnsettableString() + * @generated + * @ordered + */ + protected static final String UNSETTABLE_STRING_EDEFAULT = null; + + /** + * The cached value of the '{@link #getUnsettableString() Unsettable String}' attribute. + * + * @see #getUnsettableString() + * @generated + * @ordered + */ + protected String unsettableString = UNSETTABLE_STRING_EDEFAULT; + + /** + * This is true if the Unsettable String attribute has been set. + * + * @generated + * @ordered + */ + protected boolean unsettableStringESet; + + /** + * The default value of the '{@link #getUnsettableVAT() Unsettable VAT}' attribute. + * + * + * @see #getUnsettableVAT() + * @generated + * @ordered + */ + protected static final VAT UNSETTABLE_VAT_EDEFAULT = VAT.VAT0; + + /** + * The cached value of the '{@link #getUnsettableVAT() Unsettable VAT}' attribute. + * + * + * @see #getUnsettableVAT() + * @generated + * @ordered + */ + protected VAT unsettableVAT = UNSETTABLE_VAT_EDEFAULT; + + /** + * This is true if the Unsettable VAT attribute has been set. + * + * @generated + * @ordered + */ + protected boolean unsettableVATESet; + + /** + * + * + * @generated + */ + protected Unsettable1Impl() + { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() + { + return Model2Package.Literals.UNSETTABLE1; + } + + /** + * + * + * @generated + */ + public boolean isUnsettableBoolean() + { + return unsettableBoolean; + } + + /** + * + * + * @generated + */ + public void setUnsettableBoolean(boolean newUnsettableBoolean) + { + boolean oldUnsettableBoolean = unsettableBoolean; + unsettableBoolean = newUnsettableBoolean; + boolean oldUnsettableBooleanESet = unsettableBooleanESet; + unsettableBooleanESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.UNSETTABLE1__UNSETTABLE_BOOLEAN, + oldUnsettableBoolean, unsettableBoolean, !oldUnsettableBooleanESet)); + } + + /** + * + * + * @generated + */ + public void unsetUnsettableBoolean() + { + boolean oldUnsettableBoolean = unsettableBoolean; + boolean oldUnsettableBooleanESet = unsettableBooleanESet; + unsettableBoolean = UNSETTABLE_BOOLEAN_EDEFAULT; + unsettableBooleanESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, Model2Package.UNSETTABLE1__UNSETTABLE_BOOLEAN, + oldUnsettableBoolean, UNSETTABLE_BOOLEAN_EDEFAULT, oldUnsettableBooleanESet)); + } + + /** + * + * + * @generated + */ + public boolean isSetUnsettableBoolean() + { + return unsettableBooleanESet; + } + + /** + * + * + * @generated + */ + public byte getUnsettableByte() + { + return unsettableByte; + } + + /** + * + * + * @generated + */ + public void setUnsettableByte(byte newUnsettableByte) + { + byte oldUnsettableByte = unsettableByte; + unsettableByte = newUnsettableByte; + boolean oldUnsettableByteESet = unsettableByteESet; + unsettableByteESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.UNSETTABLE1__UNSETTABLE_BYTE, + oldUnsettableByte, unsettableByte, !oldUnsettableByteESet)); + } + + /** + * + * + * @generated + */ + public void unsetUnsettableByte() + { + byte oldUnsettableByte = unsettableByte; + boolean oldUnsettableByteESet = unsettableByteESet; + unsettableByte = UNSETTABLE_BYTE_EDEFAULT; + unsettableByteESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, Model2Package.UNSETTABLE1__UNSETTABLE_BYTE, + oldUnsettableByte, UNSETTABLE_BYTE_EDEFAULT, oldUnsettableByteESet)); + } + + /** + * + * + * @generated + */ + public boolean isSetUnsettableByte() + { + return unsettableByteESet; + } + + /** + * + * + * @generated + */ + public char getUnsettableChar() + { + return unsettableChar; + } + + /** + * + * + * @generated + */ + public void setUnsettableChar(char newUnsettableChar) + { + char oldUnsettableChar = unsettableChar; + unsettableChar = newUnsettableChar; + boolean oldUnsettableCharESet = unsettableCharESet; + unsettableCharESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.UNSETTABLE1__UNSETTABLE_CHAR, + oldUnsettableChar, unsettableChar, !oldUnsettableCharESet)); + } + + /** + * + * + * @generated + */ + public void unsetUnsettableChar() + { + char oldUnsettableChar = unsettableChar; + boolean oldUnsettableCharESet = unsettableCharESet; + unsettableChar = UNSETTABLE_CHAR_EDEFAULT; + unsettableCharESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, Model2Package.UNSETTABLE1__UNSETTABLE_CHAR, + oldUnsettableChar, UNSETTABLE_CHAR_EDEFAULT, oldUnsettableCharESet)); + } + + /** + * + * + * @generated + */ + public boolean isSetUnsettableChar() + { + return unsettableCharESet; + } + + /** + * + * + * @generated + */ + public Date getUnsettableDate() + { + return unsettableDate; + } + + /** + * + * + * @generated + */ + public void setUnsettableDate(Date newUnsettableDate) + { + Date oldUnsettableDate = unsettableDate; + unsettableDate = newUnsettableDate; + boolean oldUnsettableDateESet = unsettableDateESet; + unsettableDateESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.UNSETTABLE1__UNSETTABLE_DATE, + oldUnsettableDate, unsettableDate, !oldUnsettableDateESet)); + } + + /** + * + * + * @generated + */ + public void unsetUnsettableDate() + { + Date oldUnsettableDate = unsettableDate; + boolean oldUnsettableDateESet = unsettableDateESet; + unsettableDate = UNSETTABLE_DATE_EDEFAULT; + unsettableDateESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, Model2Package.UNSETTABLE1__UNSETTABLE_DATE, + oldUnsettableDate, UNSETTABLE_DATE_EDEFAULT, oldUnsettableDateESet)); + } + + /** + * + * + * @generated + */ + public boolean isSetUnsettableDate() + { + return unsettableDateESet; + } + + /** + * + * + * @generated + */ + public double getUnsettableDouble() + { + return unsettableDouble; + } + + /** + * + * + * @generated + */ + public void setUnsettableDouble(double newUnsettableDouble) + { + double oldUnsettableDouble = unsettableDouble; + unsettableDouble = newUnsettableDouble; + boolean oldUnsettableDoubleESet = unsettableDoubleESet; + unsettableDoubleESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.UNSETTABLE1__UNSETTABLE_DOUBLE, + oldUnsettableDouble, unsettableDouble, !oldUnsettableDoubleESet)); + } + + /** + * + * + * @generated + */ + public void unsetUnsettableDouble() + { + double oldUnsettableDouble = unsettableDouble; + boolean oldUnsettableDoubleESet = unsettableDoubleESet; + unsettableDouble = UNSETTABLE_DOUBLE_EDEFAULT; + unsettableDoubleESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, Model2Package.UNSETTABLE1__UNSETTABLE_DOUBLE, + oldUnsettableDouble, UNSETTABLE_DOUBLE_EDEFAULT, oldUnsettableDoubleESet)); + } + + /** + * + * + * @generated + */ + public boolean isSetUnsettableDouble() + { + return unsettableDoubleESet; + } + + /** + * + * + * @generated + */ + public float getUnsettableFloat() + { + return unsettableFloat; + } + + /** + * + * + * @generated + */ + public void setUnsettableFloat(float newUnsettableFloat) + { + float oldUnsettableFloat = unsettableFloat; + unsettableFloat = newUnsettableFloat; + boolean oldUnsettableFloatESet = unsettableFloatESet; + unsettableFloatESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.UNSETTABLE1__UNSETTABLE_FLOAT, + oldUnsettableFloat, unsettableFloat, !oldUnsettableFloatESet)); + } + + /** + * + * + * @generated + */ + public void unsetUnsettableFloat() + { + float oldUnsettableFloat = unsettableFloat; + boolean oldUnsettableFloatESet = unsettableFloatESet; + unsettableFloat = UNSETTABLE_FLOAT_EDEFAULT; + unsettableFloatESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, Model2Package.UNSETTABLE1__UNSETTABLE_FLOAT, + oldUnsettableFloat, UNSETTABLE_FLOAT_EDEFAULT, oldUnsettableFloatESet)); + } + + /** + * + * + * @generated + */ + public boolean isSetUnsettableFloat() + { + return unsettableFloatESet; + } + + /** + * + * + * @generated + */ + public int getUnsettableInt() + { + return unsettableInt; + } + + /** + * + * + * @generated + */ + public void setUnsettableInt(int newUnsettableInt) + { + int oldUnsettableInt = unsettableInt; + unsettableInt = newUnsettableInt; + boolean oldUnsettableIntESet = unsettableIntESet; + unsettableIntESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.UNSETTABLE1__UNSETTABLE_INT, + oldUnsettableInt, unsettableInt, !oldUnsettableIntESet)); + } + + /** + * + * + * @generated + */ + public void unsetUnsettableInt() + { + int oldUnsettableInt = unsettableInt; + boolean oldUnsettableIntESet = unsettableIntESet; + unsettableInt = UNSETTABLE_INT_EDEFAULT; + unsettableIntESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, Model2Package.UNSETTABLE1__UNSETTABLE_INT, + oldUnsettableInt, UNSETTABLE_INT_EDEFAULT, oldUnsettableIntESet)); + } + + /** + * + * + * @generated + */ + public boolean isSetUnsettableInt() + { + return unsettableIntESet; + } + + /** + * + * + * @generated + */ + public long getUnsettableLong() + { + return unsettableLong; + } + + /** + * + * + * @generated + */ + public void setUnsettableLong(long newUnsettableLong) + { + long oldUnsettableLong = unsettableLong; + unsettableLong = newUnsettableLong; + boolean oldUnsettableLongESet = unsettableLongESet; + unsettableLongESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.UNSETTABLE1__UNSETTABLE_LONG, + oldUnsettableLong, unsettableLong, !oldUnsettableLongESet)); + } + + /** + * + * + * @generated + */ + public void unsetUnsettableLong() + { + long oldUnsettableLong = unsettableLong; + boolean oldUnsettableLongESet = unsettableLongESet; + unsettableLong = UNSETTABLE_LONG_EDEFAULT; + unsettableLongESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, Model2Package.UNSETTABLE1__UNSETTABLE_LONG, + oldUnsettableLong, UNSETTABLE_LONG_EDEFAULT, oldUnsettableLongESet)); + } + + /** + * + * + * @generated + */ + public boolean isSetUnsettableLong() + { + return unsettableLongESet; + } + + /** + * + * + * @generated + */ + public short getUnsettableShort() + { + return unsettableShort; + } + + /** + * + * + * @generated + */ + public void setUnsettableShort(short newUnsettableShort) + { + short oldUnsettableShort = unsettableShort; + unsettableShort = newUnsettableShort; + boolean oldUnsettableShortESet = unsettableShortESet; + unsettableShortESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.UNSETTABLE1__UNSETTABLE_SHORT, + oldUnsettableShort, unsettableShort, !oldUnsettableShortESet)); + } + + /** + * + * + * @generated + */ + public void unsetUnsettableShort() + { + short oldUnsettableShort = unsettableShort; + boolean oldUnsettableShortESet = unsettableShortESet; + unsettableShort = UNSETTABLE_SHORT_EDEFAULT; + unsettableShortESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, Model2Package.UNSETTABLE1__UNSETTABLE_SHORT, + oldUnsettableShort, UNSETTABLE_SHORT_EDEFAULT, oldUnsettableShortESet)); + } + + /** + * + * + * @generated + */ + public boolean isSetUnsettableShort() + { + return unsettableShortESet; + } + + /** + * + * + * @generated + */ + public String getUnsettableString() + { + return unsettableString; + } + + /** + * + * + * @generated + */ + public void setUnsettableString(String newUnsettableString) + { + String oldUnsettableString = unsettableString; + unsettableString = newUnsettableString; + boolean oldUnsettableStringESet = unsettableStringESet; + unsettableStringESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.UNSETTABLE1__UNSETTABLE_STRING, + oldUnsettableString, unsettableString, !oldUnsettableStringESet)); + } + + /** + * + * + * @generated + */ + public void unsetUnsettableString() + { + String oldUnsettableString = unsettableString; + boolean oldUnsettableStringESet = unsettableStringESet; + unsettableString = UNSETTABLE_STRING_EDEFAULT; + unsettableStringESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, Model2Package.UNSETTABLE1__UNSETTABLE_STRING, + oldUnsettableString, UNSETTABLE_STRING_EDEFAULT, oldUnsettableStringESet)); + } + + /** + * + * + * @generated + */ + public boolean isSetUnsettableString() + { + return unsettableStringESet; + } + + /** + * + * + * @generated + */ + public VAT getUnsettableVAT() + { + return unsettableVAT; + } + + /** + * + * + * @generated + */ + public void setUnsettableVAT(VAT newUnsettableVAT) + { + VAT oldUnsettableVAT = unsettableVAT; + unsettableVAT = newUnsettableVAT == null ? UNSETTABLE_VAT_EDEFAULT : newUnsettableVAT; + boolean oldUnsettableVATESet = unsettableVATESet; + unsettableVATESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.UNSETTABLE1__UNSETTABLE_VAT, + oldUnsettableVAT, unsettableVAT, !oldUnsettableVATESet)); + } + + /** + * + * + * @generated + */ + public void unsetUnsettableVAT() + { + VAT oldUnsettableVAT = unsettableVAT; + boolean oldUnsettableVATESet = unsettableVATESet; + unsettableVAT = UNSETTABLE_VAT_EDEFAULT; + unsettableVATESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, Model2Package.UNSETTABLE1__UNSETTABLE_VAT, + oldUnsettableVAT, UNSETTABLE_VAT_EDEFAULT, oldUnsettableVATESet)); + } + + /** + * + * + * @generated + */ + public boolean isSetUnsettableVAT() + { + return unsettableVATESet; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case Model2Package.UNSETTABLE1__UNSETTABLE_BOOLEAN: + return isUnsettableBoolean(); + case Model2Package.UNSETTABLE1__UNSETTABLE_BYTE: + return getUnsettableByte(); + case Model2Package.UNSETTABLE1__UNSETTABLE_CHAR: + return getUnsettableChar(); + case Model2Package.UNSETTABLE1__UNSETTABLE_DATE: + return getUnsettableDate(); + case Model2Package.UNSETTABLE1__UNSETTABLE_DOUBLE: + return getUnsettableDouble(); + case Model2Package.UNSETTABLE1__UNSETTABLE_FLOAT: + return getUnsettableFloat(); + case Model2Package.UNSETTABLE1__UNSETTABLE_INT: + return getUnsettableInt(); + case Model2Package.UNSETTABLE1__UNSETTABLE_LONG: + return getUnsettableLong(); + case Model2Package.UNSETTABLE1__UNSETTABLE_SHORT: + return getUnsettableShort(); + case Model2Package.UNSETTABLE1__UNSETTABLE_STRING: + return getUnsettableString(); + case Model2Package.UNSETTABLE1__UNSETTABLE_VAT: + return getUnsettableVAT(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case Model2Package.UNSETTABLE1__UNSETTABLE_BOOLEAN: + setUnsettableBoolean((Boolean)newValue); + return; + case Model2Package.UNSETTABLE1__UNSETTABLE_BYTE: + setUnsettableByte((Byte)newValue); + return; + case Model2Package.UNSETTABLE1__UNSETTABLE_CHAR: + setUnsettableChar((Character)newValue); + return; + case Model2Package.UNSETTABLE1__UNSETTABLE_DATE: + setUnsettableDate((Date)newValue); + return; + case Model2Package.UNSETTABLE1__UNSETTABLE_DOUBLE: + setUnsettableDouble((Double)newValue); + return; + case Model2Package.UNSETTABLE1__UNSETTABLE_FLOAT: + setUnsettableFloat((Float)newValue); + return; + case Model2Package.UNSETTABLE1__UNSETTABLE_INT: + setUnsettableInt((Integer)newValue); + return; + case Model2Package.UNSETTABLE1__UNSETTABLE_LONG: + setUnsettableLong((Long)newValue); + return; + case Model2Package.UNSETTABLE1__UNSETTABLE_SHORT: + setUnsettableShort((Short)newValue); + return; + case Model2Package.UNSETTABLE1__UNSETTABLE_STRING: + setUnsettableString((String)newValue); + return; + case Model2Package.UNSETTABLE1__UNSETTABLE_VAT: + setUnsettableVAT((VAT)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case Model2Package.UNSETTABLE1__UNSETTABLE_BOOLEAN: + unsetUnsettableBoolean(); + return; + case Model2Package.UNSETTABLE1__UNSETTABLE_BYTE: + unsetUnsettableByte(); + return; + case Model2Package.UNSETTABLE1__UNSETTABLE_CHAR: + unsetUnsettableChar(); + return; + case Model2Package.UNSETTABLE1__UNSETTABLE_DATE: + unsetUnsettableDate(); + return; + case Model2Package.UNSETTABLE1__UNSETTABLE_DOUBLE: + unsetUnsettableDouble(); + return; + case Model2Package.UNSETTABLE1__UNSETTABLE_FLOAT: + unsetUnsettableFloat(); + return; + case Model2Package.UNSETTABLE1__UNSETTABLE_INT: + unsetUnsettableInt(); + return; + case Model2Package.UNSETTABLE1__UNSETTABLE_LONG: + unsetUnsettableLong(); + return; + case Model2Package.UNSETTABLE1__UNSETTABLE_SHORT: + unsetUnsettableShort(); + return; + case Model2Package.UNSETTABLE1__UNSETTABLE_STRING: + unsetUnsettableString(); + return; + case Model2Package.UNSETTABLE1__UNSETTABLE_VAT: + unsetUnsettableVAT(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case Model2Package.UNSETTABLE1__UNSETTABLE_BOOLEAN: + return isSetUnsettableBoolean(); + case Model2Package.UNSETTABLE1__UNSETTABLE_BYTE: + return isSetUnsettableByte(); + case Model2Package.UNSETTABLE1__UNSETTABLE_CHAR: + return isSetUnsettableChar(); + case Model2Package.UNSETTABLE1__UNSETTABLE_DATE: + return isSetUnsettableDate(); + case Model2Package.UNSETTABLE1__UNSETTABLE_DOUBLE: + return isSetUnsettableDouble(); + case Model2Package.UNSETTABLE1__UNSETTABLE_FLOAT: + return isSetUnsettableFloat(); + case Model2Package.UNSETTABLE1__UNSETTABLE_INT: + return isSetUnsettableInt(); + case Model2Package.UNSETTABLE1__UNSETTABLE_LONG: + return isSetUnsettableLong(); + case Model2Package.UNSETTABLE1__UNSETTABLE_SHORT: + return isSetUnsettableShort(); + case Model2Package.UNSETTABLE1__UNSETTABLE_STRING: + return isSetUnsettableString(); + case Model2Package.UNSETTABLE1__UNSETTABLE_VAT: + return isSetUnsettableVAT(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() + { + if (eIsProxy()) + return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (unsettableBoolean: "); + if (unsettableBooleanESet) + result.append(unsettableBoolean); + else + result.append(""); + result.append(", unsettableByte: "); + if (unsettableByteESet) + result.append(unsettableByte); + else + result.append(""); + result.append(", unsettableChar: "); + if (unsettableCharESet) + result.append(unsettableChar); + else + result.append(""); + result.append(", unsettableDate: "); + if (unsettableDateESet) + result.append(unsettableDate); + else + result.append(""); + result.append(", unsettableDouble: "); + if (unsettableDoubleESet) + result.append(unsettableDouble); + else + result.append(""); + result.append(", unsettableFloat: "); + if (unsettableFloatESet) + result.append(unsettableFloat); + else + result.append(""); + result.append(", unsettableInt: "); + if (unsettableIntESet) + result.append(unsettableInt); + else + result.append(""); + result.append(", unsettableLong: "); + if (unsettableLongESet) + result.append(unsettableLong); + else + result.append(""); + result.append(", unsettableShort: "); + if (unsettableShortESet) + result.append(unsettableShort); + else + result.append(""); + result.append(", unsettableString: "); + if (unsettableStringESet) + result.append(unsettableString); + else + result.append(""); + result.append(", unsettableVAT: "); + if (unsettableVATESet) + result.append(unsettableVAT); + else + result.append(""); + result.append(')'); + return result.toString(); + } + +} // Unsettable1Impl diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/Unsettable2WithDefaultImpl.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/Unsettable2WithDefaultImpl.java new file mode 100644 index 0000000000..d434338fa4 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/impl/Unsettable2WithDefaultImpl.java @@ -0,0 +1,1205 @@ +/** + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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: + * Eike Stepper - initial API and implementation + * + * $Id: Unsettable2WithDefaultImpl.java,v 1.1 2010-01-08 19:43:28 mfluegge Exp $ + */ +package org.eclipse.emf.cdo.tests.legacy.model2.impl; + +import org.eclipse.emf.cdo.tests.model1.VAT; +import org.eclipse.emf.cdo.tests.model2.Model2Package; +import org.eclipse.emf.cdo.tests.model2.Unsettable2WithDefault; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EcoreFactory; +import org.eclipse.emf.ecore.EcorePackage; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import java.util.Date; + +/** + * An implementation of the model object 'Unsettable2 With Default'. + *

+ * The following features are implemented: + *

    + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable2WithDefaultImpl#isUnsettableBoolean Unsettable + * Boolean}
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable2WithDefaultImpl#getUnsettableByte Unsettable + * Byte}
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable2WithDefaultImpl#getUnsettableChar Unsettable + * Char}
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable2WithDefaultImpl#getUnsettableDate Unsettable + * Date}
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable2WithDefaultImpl#getUnsettableDouble Unsettable + * Double}
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable2WithDefaultImpl#getUnsettableFloat Unsettable + * Float}
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable2WithDefaultImpl#getUnsettableInt Unsettable + * Int}
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable2WithDefaultImpl#getUnsettableLong Unsettable + * Long}
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable2WithDefaultImpl#getUnsettableShort Unsettable + * Short}
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable2WithDefaultImpl#getUnsettableString Unsettable + * String}
  • + *
  • {@link org.eclipse.emf.cdo.tests.legacy.model2.impl.Unsettable2WithDefaultImpl#getUnsettableVAT Unsettable + * VAT}
  • + *
+ *

+ * + * @generated + */ +public class Unsettable2WithDefaultImpl extends EObjectImpl implements Unsettable2WithDefault +{ + /** + * The default value of the '{@link #isUnsettableBoolean() Unsettable Boolean}' attribute. + * + * @see #isUnsettableBoolean() + * @generated + * @ordered + */ + protected static final boolean UNSETTABLE_BOOLEAN_EDEFAULT = true; + + /** + * The cached value of the '{@link #isUnsettableBoolean() Unsettable Boolean}' attribute. + * + * @see #isUnsettableBoolean() + * @generated + * @ordered + */ + protected boolean unsettableBoolean = UNSETTABLE_BOOLEAN_EDEFAULT; + + /** + * This is true if the Unsettable Boolean attribute has been set. + * + * @generated + * @ordered + */ + protected boolean unsettableBooleanESet; + + /** + * The default value of the '{@link #getUnsettableByte() Unsettable Byte}' attribute. + * + * + * @see #getUnsettableByte() + * @generated + * @ordered + */ + protected static final byte UNSETTABLE_BYTE_EDEFAULT = 0x03; + + /** + * The cached value of the '{@link #getUnsettableByte() Unsettable Byte}' attribute. + * + * + * @see #getUnsettableByte() + * @generated + * @ordered + */ + protected byte unsettableByte = UNSETTABLE_BYTE_EDEFAULT; + + /** + * This is true if the Unsettable Byte attribute has been set. + * + * @generated + * @ordered + */ + protected boolean unsettableByteESet; + + /** + * The default value of the '{@link #getUnsettableChar() Unsettable Char}' attribute. + * + * + * @see #getUnsettableChar() + * @generated + * @ordered + */ + protected static final char UNSETTABLE_CHAR_EDEFAULT = '\''; + + /** + * The cached value of the '{@link #getUnsettableChar() Unsettable Char}' attribute. + * + * + * @see #getUnsettableChar() + * @generated + * @ordered + */ + protected char unsettableChar = UNSETTABLE_CHAR_EDEFAULT; + + /** + * This is true if the Unsettable Char attribute has been set. + * + * @generated + * @ordered + */ + protected boolean unsettableCharESet; + + /** + * The default value of the '{@link #getUnsettableDate() Unsettable Date}' attribute. + * + * + * @see #getUnsettableDate() + * @generated + * @ordered + */ + protected static final Date UNSETTABLE_DATE_EDEFAULT = (Date)EcoreFactory.eINSTANCE.createFromString( + EcorePackage.eINSTANCE.getEDate(), "2009-12-21T15:12:59"); + + /** + * The cached value of the '{@link #getUnsettableDate() Unsettable Date}' attribute. + * + * + * @see #getUnsettableDate() + * @generated + * @ordered + */ + protected Date unsettableDate = UNSETTABLE_DATE_EDEFAULT; + + /** + * This is true if the Unsettable Date attribute has been set. + * + * @generated + * @ordered + */ + protected boolean unsettableDateESet; + + /** + * The default value of the '{@link #getUnsettableDouble() Unsettable Double}' attribute. + * + * @see #getUnsettableDouble() + * @generated + * @ordered + */ + protected static final double UNSETTABLE_DOUBLE_EDEFAULT = 3.3; + + /** + * The cached value of the '{@link #getUnsettableDouble() Unsettable Double}' attribute. + * + * @see #getUnsettableDouble() + * @generated + * @ordered + */ + protected double unsettableDouble = UNSETTABLE_DOUBLE_EDEFAULT; + + /** + * This is true if the Unsettable Double attribute has been set. + * + * @generated + * @ordered + */ + protected boolean unsettableDoubleESet; + + /** + * The default value of the '{@link #getUnsettableFloat() Unsettable Float}' attribute. + * + * @see #getUnsettableFloat() + * @generated + * @ordered + */ + protected static final float UNSETTABLE_FLOAT_EDEFAULT = 4.4F; + + /** + * The cached value of the '{@link #getUnsettableFloat() Unsettable Float}' attribute. + * + * @see #getUnsettableFloat() + * @generated + * @ordered + */ + protected float unsettableFloat = UNSETTABLE_FLOAT_EDEFAULT; + + /** + * This is true if the Unsettable Float attribute has been set. + * + * @generated + * @ordered + */ + protected boolean unsettableFloatESet; + + /** + * The default value of the '{@link #getUnsettableInt() Unsettable Int}' attribute. + * + * + * @see #getUnsettableInt() + * @generated + * @ordered + */ + protected static final int UNSETTABLE_INT_EDEFAULT = 5; + + /** + * The cached value of the '{@link #getUnsettableInt() Unsettable Int}' attribute. + * + * + * @see #getUnsettableInt() + * @generated + * @ordered + */ + protected int unsettableInt = UNSETTABLE_INT_EDEFAULT; + + /** + * This is true if the Unsettable Int attribute has been set. + * + * @generated + * @ordered + */ + protected boolean unsettableIntESet; + + /** + * The default value of the '{@link #getUnsettableLong() Unsettable Long}' attribute. + * + * + * @see #getUnsettableLong() + * @generated + * @ordered + */ + protected static final long UNSETTABLE_LONG_EDEFAULT = 6L; + + /** + * The cached value of the '{@link #getUnsettableLong() Unsettable Long}' attribute. + * + * + * @see #getUnsettableLong() + * @generated + * @ordered + */ + protected long unsettableLong = UNSETTABLE_LONG_EDEFAULT; + + /** + * This is true if the Unsettable Long attribute has been set. + * + * @generated + * @ordered + */ + protected boolean unsettableLongESet; + + /** + * The default value of the '{@link #getUnsettableShort() Unsettable Short}' attribute. + * + * @see #getUnsettableShort() + * @generated + * @ordered + */ + protected static final short UNSETTABLE_SHORT_EDEFAULT = 7; + + /** + * The cached value of the '{@link #getUnsettableShort() Unsettable Short}' attribute. + * + * @see #getUnsettableShort() + * @generated + * @ordered + */ + protected short unsettableShort = UNSETTABLE_SHORT_EDEFAULT; + + /** + * This is true if the Unsettable Short attribute has been set. + * + * @generated + * @ordered + */ + protected boolean unsettableShortESet; + + /** + * The default value of the '{@link #getUnsettableString() Unsettable String}' attribute. + * + * @see #getUnsettableString() + * @generated + * @ordered + */ + protected static final String UNSETTABLE_STRING_EDEFAULT = "\"eike\""; + + /** + * The cached value of the '{@link #getUnsettableString() Unsettable String}' attribute. + * + * @see #getUnsettableString() + * @generated + * @ordered + */ + protected String unsettableString = UNSETTABLE_STRING_EDEFAULT; + + /** + * This is true if the Unsettable String attribute has been set. + * + * @generated + * @ordered + */ + protected boolean unsettableStringESet; + + /** + * The default value of the '{@link #getUnsettableVAT() Unsettable VAT}' attribute. + * + * + * @see #getUnsettableVAT() + * @generated + * @ordered + */ + protected static final VAT UNSETTABLE_VAT_EDEFAULT = VAT.VAT0; + + /** + * The cached value of the '{@link #getUnsettableVAT() Unsettable VAT}' attribute. + * + * + * @see #getUnsettableVAT() + * @generated + * @ordered + */ + protected VAT unsettableVAT = UNSETTABLE_VAT_EDEFAULT; + + /** + * This is true if the Unsettable VAT attribute has been set. + * + * @generated + * @ordered + */ + protected boolean unsettableVATESet; + + /** + * + * + * @generated + */ + protected Unsettable2WithDefaultImpl() + { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() + { + return Model2Package.Literals.UNSETTABLE2_WITH_DEFAULT; + } + + /** + * + * + * @generated + */ + public boolean isUnsettableBoolean() + { + return unsettableBoolean; + } + + /** + * + * + * @generated + */ + public void setUnsettableBoolean(boolean newUnsettableBoolean) + { + boolean oldUnsettableBoolean = unsettableBoolean; + unsettableBoolean = newUnsettableBoolean; + boolean oldUnsettableBooleanESet = unsettableBooleanESet; + unsettableBooleanESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_BOOLEAN, + oldUnsettableBoolean, unsettableBoolean, !oldUnsettableBooleanESet)); + } + + /** + * + * + * @generated + */ + public void unsetUnsettableBoolean() + { + boolean oldUnsettableBoolean = unsettableBoolean; + boolean oldUnsettableBooleanESet = unsettableBooleanESet; + unsettableBoolean = UNSETTABLE_BOOLEAN_EDEFAULT; + unsettableBooleanESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, + Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_BOOLEAN, oldUnsettableBoolean, + UNSETTABLE_BOOLEAN_EDEFAULT, oldUnsettableBooleanESet)); + } + + /** + * + * + * @generated + */ + public boolean isSetUnsettableBoolean() + { + return unsettableBooleanESet; + } + + /** + * + * + * @generated + */ + public byte getUnsettableByte() + { + return unsettableByte; + } + + /** + * + * + * @generated + */ + public void setUnsettableByte(byte newUnsettableByte) + { + byte oldUnsettableByte = unsettableByte; + unsettableByte = newUnsettableByte; + boolean oldUnsettableByteESet = unsettableByteESet; + unsettableByteESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_BYTE, + oldUnsettableByte, unsettableByte, !oldUnsettableByteESet)); + } + + /** + * + * + * @generated + */ + public void unsetUnsettableByte() + { + byte oldUnsettableByte = unsettableByte; + boolean oldUnsettableByteESet = unsettableByteESet; + unsettableByte = UNSETTABLE_BYTE_EDEFAULT; + unsettableByteESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_BYTE, + oldUnsettableByte, UNSETTABLE_BYTE_EDEFAULT, oldUnsettableByteESet)); + } + + /** + * + * + * @generated + */ + public boolean isSetUnsettableByte() + { + return unsettableByteESet; + } + + /** + * + * + * @generated + */ + public char getUnsettableChar() + { + return unsettableChar; + } + + /** + * + * + * @generated + */ + public void setUnsettableChar(char newUnsettableChar) + { + char oldUnsettableChar = unsettableChar; + unsettableChar = newUnsettableChar; + boolean oldUnsettableCharESet = unsettableCharESet; + unsettableCharESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_CHAR, + oldUnsettableChar, unsettableChar, !oldUnsettableCharESet)); + } + + /** + * + * + * @generated + */ + public void unsetUnsettableChar() + { + char oldUnsettableChar = unsettableChar; + boolean oldUnsettableCharESet = unsettableCharESet; + unsettableChar = UNSETTABLE_CHAR_EDEFAULT; + unsettableCharESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_CHAR, + oldUnsettableChar, UNSETTABLE_CHAR_EDEFAULT, oldUnsettableCharESet)); + } + + /** + * + * + * @generated + */ + public boolean isSetUnsettableChar() + { + return unsettableCharESet; + } + + /** + * + * + * @generated + */ + public Date getUnsettableDate() + { + return unsettableDate; + } + + /** + * + * + * @generated + */ + public void setUnsettableDate(Date newUnsettableDate) + { + Date oldUnsettableDate = unsettableDate; + unsettableDate = newUnsettableDate; + boolean oldUnsettableDateESet = unsettableDateESet; + unsettableDateESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_DATE, + oldUnsettableDate, unsettableDate, !oldUnsettableDateESet)); + } + + /** + * + * + * @generated + */ + public void unsetUnsettableDate() + { + Date oldUnsettableDate = unsettableDate; + boolean oldUnsettableDateESet = unsettableDateESet; + unsettableDate = UNSETTABLE_DATE_EDEFAULT; + unsettableDateESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_DATE, + oldUnsettableDate, UNSETTABLE_DATE_EDEFAULT, oldUnsettableDateESet)); + } + + /** + * + * + * @generated + */ + public boolean isSetUnsettableDate() + { + return unsettableDateESet; + } + + /** + * + * + * @generated + */ + public double getUnsettableDouble() + { + return unsettableDouble; + } + + /** + * + * + * @generated + */ + public void setUnsettableDouble(double newUnsettableDouble) + { + double oldUnsettableDouble = unsettableDouble; + unsettableDouble = newUnsettableDouble; + boolean oldUnsettableDoubleESet = unsettableDoubleESet; + unsettableDoubleESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_DOUBLE, + oldUnsettableDouble, unsettableDouble, !oldUnsettableDoubleESet)); + } + + /** + * + * + * @generated + */ + public void unsetUnsettableDouble() + { + double oldUnsettableDouble = unsettableDouble; + boolean oldUnsettableDoubleESet = unsettableDoubleESet; + unsettableDouble = UNSETTABLE_DOUBLE_EDEFAULT; + unsettableDoubleESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, + Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_DOUBLE, oldUnsettableDouble, UNSETTABLE_DOUBLE_EDEFAULT, + oldUnsettableDoubleESet)); + } + + /** + * + * + * @generated + */ + public boolean isSetUnsettableDouble() + { + return unsettableDoubleESet; + } + + /** + * + * + * @generated + */ + public float getUnsettableFloat() + { + return unsettableFloat; + } + + /** + * + * + * @generated + */ + public void setUnsettableFloat(float newUnsettableFloat) + { + float oldUnsettableFloat = unsettableFloat; + unsettableFloat = newUnsettableFloat; + boolean oldUnsettableFloatESet = unsettableFloatESet; + unsettableFloatESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_FLOAT, + oldUnsettableFloat, unsettableFloat, !oldUnsettableFloatESet)); + } + + /** + * + * + * @generated + */ + public void unsetUnsettableFloat() + { + float oldUnsettableFloat = unsettableFloat; + boolean oldUnsettableFloatESet = unsettableFloatESet; + unsettableFloat = UNSETTABLE_FLOAT_EDEFAULT; + unsettableFloatESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_FLOAT, + oldUnsettableFloat, UNSETTABLE_FLOAT_EDEFAULT, oldUnsettableFloatESet)); + } + + /** + * + * + * @generated + */ + public boolean isSetUnsettableFloat() + { + return unsettableFloatESet; + } + + /** + * + * + * @generated + */ + public int getUnsettableInt() + { + return unsettableInt; + } + + /** + * + * + * @generated + */ + public void setUnsettableInt(int newUnsettableInt) + { + int oldUnsettableInt = unsettableInt; + unsettableInt = newUnsettableInt; + boolean oldUnsettableIntESet = unsettableIntESet; + unsettableIntESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_INT, + oldUnsettableInt, unsettableInt, !oldUnsettableIntESet)); + } + + /** + * + * + * @generated + */ + public void unsetUnsettableInt() + { + int oldUnsettableInt = unsettableInt; + boolean oldUnsettableIntESet = unsettableIntESet; + unsettableInt = UNSETTABLE_INT_EDEFAULT; + unsettableIntESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_INT, + oldUnsettableInt, UNSETTABLE_INT_EDEFAULT, oldUnsettableIntESet)); + } + + /** + * + * + * @generated + */ + public boolean isSetUnsettableInt() + { + return unsettableIntESet; + } + + /** + * + * + * @generated + */ + public long getUnsettableLong() + { + return unsettableLong; + } + + /** + * + * + * @generated + */ + public void setUnsettableLong(long newUnsettableLong) + { + long oldUnsettableLong = unsettableLong; + unsettableLong = newUnsettableLong; + boolean oldUnsettableLongESet = unsettableLongESet; + unsettableLongESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_LONG, + oldUnsettableLong, unsettableLong, !oldUnsettableLongESet)); + } + + /** + * + * + * @generated + */ + public void unsetUnsettableLong() + { + long oldUnsettableLong = unsettableLong; + boolean oldUnsettableLongESet = unsettableLongESet; + unsettableLong = UNSETTABLE_LONG_EDEFAULT; + unsettableLongESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_LONG, + oldUnsettableLong, UNSETTABLE_LONG_EDEFAULT, oldUnsettableLongESet)); + } + + /** + * + * + * @generated + */ + public boolean isSetUnsettableLong() + { + return unsettableLongESet; + } + + /** + * + * + * @generated + */ + public short getUnsettableShort() + { + return unsettableShort; + } + + /** + * + * + * @generated + */ + public void setUnsettableShort(short newUnsettableShort) + { + short oldUnsettableShort = unsettableShort; + unsettableShort = newUnsettableShort; + boolean oldUnsettableShortESet = unsettableShortESet; + unsettableShortESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_SHORT, + oldUnsettableShort, unsettableShort, !oldUnsettableShortESet)); + } + + /** + * + * + * @generated + */ + public void unsetUnsettableShort() + { + short oldUnsettableShort = unsettableShort; + boolean oldUnsettableShortESet = unsettableShortESet; + unsettableShort = UNSETTABLE_SHORT_EDEFAULT; + unsettableShortESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_SHORT, + oldUnsettableShort, UNSETTABLE_SHORT_EDEFAULT, oldUnsettableShortESet)); + } + + /** + * + * + * @generated + */ + public boolean isSetUnsettableShort() + { + return unsettableShortESet; + } + + /** + * + * + * @generated + */ + public String getUnsettableString() + { + return unsettableString; + } + + /** + * + * + * @generated + */ + public void setUnsettableString(String newUnsettableString) + { + String oldUnsettableString = unsettableString; + unsettableString = newUnsettableString; + boolean oldUnsettableStringESet = unsettableStringESet; + unsettableStringESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_STRING, + oldUnsettableString, unsettableString, !oldUnsettableStringESet)); + } + + /** + * + * + * @generated + */ + public void unsetUnsettableString() + { + String oldUnsettableString = unsettableString; + boolean oldUnsettableStringESet = unsettableStringESet; + unsettableString = UNSETTABLE_STRING_EDEFAULT; + unsettableStringESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, + Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_STRING, oldUnsettableString, UNSETTABLE_STRING_EDEFAULT, + oldUnsettableStringESet)); + } + + /** + * + * + * @generated + */ + public boolean isSetUnsettableString() + { + return unsettableStringESet; + } + + /** + * + * + * @generated + */ + public VAT getUnsettableVAT() + { + return unsettableVAT; + } + + /** + * + * + * @generated + */ + public void setUnsettableVAT(VAT newUnsettableVAT) + { + VAT oldUnsettableVAT = unsettableVAT; + unsettableVAT = newUnsettableVAT == null ? UNSETTABLE_VAT_EDEFAULT : newUnsettableVAT; + boolean oldUnsettableVATESet = unsettableVATESet; + unsettableVATESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_VAT, + oldUnsettableVAT, unsettableVAT, !oldUnsettableVATESet)); + } + + /** + * + * + * @generated + */ + public void unsetUnsettableVAT() + { + VAT oldUnsettableVAT = unsettableVAT; + boolean oldUnsettableVATESet = unsettableVATESet; + unsettableVAT = UNSETTABLE_VAT_EDEFAULT; + unsettableVATESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_VAT, + oldUnsettableVAT, UNSETTABLE_VAT_EDEFAULT, oldUnsettableVATESet)); + } + + /** + * + * + * @generated + */ + public boolean isSetUnsettableVAT() + { + return unsettableVATESet; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_BOOLEAN: + return isUnsettableBoolean(); + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_BYTE: + return getUnsettableByte(); + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_CHAR: + return getUnsettableChar(); + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_DATE: + return getUnsettableDate(); + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_DOUBLE: + return getUnsettableDouble(); + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_FLOAT: + return getUnsettableFloat(); + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_INT: + return getUnsettableInt(); + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_LONG: + return getUnsettableLong(); + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_SHORT: + return getUnsettableShort(); + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_STRING: + return getUnsettableString(); + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_VAT: + return getUnsettableVAT(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_BOOLEAN: + setUnsettableBoolean((Boolean)newValue); + return; + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_BYTE: + setUnsettableByte((Byte)newValue); + return; + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_CHAR: + setUnsettableChar((Character)newValue); + return; + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_DATE: + setUnsettableDate((Date)newValue); + return; + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_DOUBLE: + setUnsettableDouble((Double)newValue); + return; + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_FLOAT: + setUnsettableFloat((Float)newValue); + return; + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_INT: + setUnsettableInt((Integer)newValue); + return; + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_LONG: + setUnsettableLong((Long)newValue); + return; + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_SHORT: + setUnsettableShort((Short)newValue); + return; + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_STRING: + setUnsettableString((String)newValue); + return; + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_VAT: + setUnsettableVAT((VAT)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_BOOLEAN: + unsetUnsettableBoolean(); + return; + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_BYTE: + unsetUnsettableByte(); + return; + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_CHAR: + unsetUnsettableChar(); + return; + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_DATE: + unsetUnsettableDate(); + return; + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_DOUBLE: + unsetUnsettableDouble(); + return; + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_FLOAT: + unsetUnsettableFloat(); + return; + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_INT: + unsetUnsettableInt(); + return; + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_LONG: + unsetUnsettableLong(); + return; + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_SHORT: + unsetUnsettableShort(); + return; + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_STRING: + unsetUnsettableString(); + return; + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_VAT: + unsetUnsettableVAT(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_BOOLEAN: + return isSetUnsettableBoolean(); + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_BYTE: + return isSetUnsettableByte(); + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_CHAR: + return isSetUnsettableChar(); + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_DATE: + return isSetUnsettableDate(); + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_DOUBLE: + return isSetUnsettableDouble(); + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_FLOAT: + return isSetUnsettableFloat(); + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_INT: + return isSetUnsettableInt(); + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_LONG: + return isSetUnsettableLong(); + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_SHORT: + return isSetUnsettableShort(); + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_STRING: + return isSetUnsettableString(); + case Model2Package.UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_VAT: + return isSetUnsettableVAT(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() + { + if (eIsProxy()) + return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (unsettableBoolean: "); + if (unsettableBooleanESet) + result.append(unsettableBoolean); + else + result.append(""); + result.append(", unsettableByte: "); + if (unsettableByteESet) + result.append(unsettableByte); + else + result.append(""); + result.append(", unsettableChar: "); + if (unsettableCharESet) + result.append(unsettableChar); + else + result.append(""); + result.append(", unsettableDate: "); + if (unsettableDateESet) + result.append(unsettableDate); + else + result.append(""); + result.append(", unsettableDouble: "); + if (unsettableDoubleESet) + result.append(unsettableDouble); + else + result.append(""); + result.append(", unsettableFloat: "); + if (unsettableFloatESet) + result.append(unsettableFloat); + else + result.append(""); + result.append(", unsettableInt: "); + if (unsettableIntESet) + result.append(unsettableInt); + else + result.append(""); + result.append(", unsettableLong: "); + if (unsettableLongESet) + result.append(unsettableLong); + else + result.append(""); + result.append(", unsettableShort: "); + if (unsettableShortESet) + result.append(unsettableShort); + else + result.append(""); + result.append(", unsettableString: "); + if (unsettableStringESet) + result.append(unsettableString); + else + result.append(""); + result.append(", unsettableVAT: "); + if (unsettableVATESet) + result.append(unsettableVAT); + else + result.append(""); + result.append(')'); + return result.toString(); + } + +} // Unsettable2WithDefaultImpl diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/util/Model2AdapterFactory.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/util/Model2AdapterFactory.java new file mode 100644 index 0000000000..e6a45ad2cf --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/util/Model2AdapterFactory.java @@ -0,0 +1,306 @@ +/** + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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: + * Eike Stepper - initial API and implementation + * + * $Id: Model2AdapterFactory.java,v 1.4 2010-01-08 19:43:27 mfluegge Exp $ + */ +package org.eclipse.emf.cdo.tests.legacy.model2.util; + +import org.eclipse.emf.cdo.tests.model1.Order; +import org.eclipse.emf.cdo.tests.model1.PurchaseOrder; +import org.eclipse.emf.cdo.tests.model2.Model2Package; +import org.eclipse.emf.cdo.tests.model2.PersistentContainment; +import org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder; +import org.eclipse.emf.cdo.tests.model2.Task; +import org.eclipse.emf.cdo.tests.model2.TaskContainer; +import org.eclipse.emf.cdo.tests.model2.TransientContainer; +import org.eclipse.emf.cdo.tests.model2.Unsettable1; +import org.eclipse.emf.cdo.tests.model2.Unsettable2WithDefault; + +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; + +/** + * The Adapter Factory for the model. It provides an adapter createXXX + * method for each class of the model. + * + * @see org.eclipse.emf.cdo.tests.legacy.model2.Model2Package + * @generated + */ +public class Model2AdapterFactory extends AdapterFactoryImpl +{ + /** + * The cached model package. + * + * @generated + */ + protected static Model2Package modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * @generated + */ + public Model2AdapterFactory() + { + if (modelPackage == null) + { + modelPackage = Model2Package.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. This implementation + * returns true if the object is either the model's package or is an instance object of the model. + * + * @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 createXXX methods. + * + * @generated + */ + protected Model2Switch modelSwitch = new Model2Switch() + { + @Override + public Adapter caseSpecialPurchaseOrder(SpecialPurchaseOrder object) + { + return createSpecialPurchaseOrderAdapter(); + } + + @Override + public Adapter caseTaskContainer(TaskContainer object) + { + return createTaskContainerAdapter(); + } + + @Override + public Adapter caseTask(Task object) + { + return createTaskAdapter(); + } + + @Override + public Adapter caseUnsettable1(Unsettable1 object) + { + return createUnsettable1Adapter(); + } + + @Override + public Adapter caseUnsettable2WithDefault(Unsettable2WithDefault object) + { + return createUnsettable2WithDefaultAdapter(); + } + + @Override + public Adapter casePersistentContainment(PersistentContainment object) + { + return createPersistentContainmentAdapter(); + } + + @Override + public Adapter caseTransientContainer(TransientContainer object) + { + return createTransientContainerAdapter(); + } + + @Override + public Adapter caseOrder(Order object) + { + return createOrderAdapter(); + } + + @Override + public Adapter casePurchaseOrder(PurchaseOrder object) + { + return createPurchaseOrderAdapter(); + } + + @Override + public Adapter defaultCase(EObject object) + { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * @param target + * the object to adapt. + * @return the adapter for the target. + * @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.cdo.tests.legacy.model2.SpecialPurchaseOrder + * Special Purchase Order}'. 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. + * + * @return the new adapter. + * @see org.eclipse.emf.cdo.tests.legacy.model2.SpecialPurchaseOrder + * @generated + */ + public Adapter createSpecialPurchaseOrderAdapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.legacy.model2.TaskContainer + * Task Container}'. 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. + * + * @return the new adapter. + * @see org.eclipse.emf.cdo.tests.legacy.model2.TaskContainer + * @generated + */ + public Adapter createTaskContainerAdapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.legacy.model2.Task Task}'. + * 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. + * + * @return the new adapter. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Task + * @generated + */ + public Adapter createTaskAdapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1 + * Unsettable1}'. 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. + * + * @return the new adapter. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable1 + * @generated + */ + public Adapter createUnsettable1Adapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class ' + * {@link org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault Unsettable2 With Default}'. 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. + * + * @return the new adapter. + * @see org.eclipse.emf.cdo.tests.legacy.model2.Unsettable2WithDefault + * @generated + */ + public Adapter createUnsettable2WithDefaultAdapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.legacy.model2.PersistentContainment + * Persistent Containment}'. 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. + * + * @return the new adapter. + * @see org.eclipse.emf.cdo.tests.legacy.model2.PersistentContainment + * @generated + */ + public Adapter createPersistentContainmentAdapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.legacy.model2.TransientContainer + * Transient Container}'. 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. + * + * @return the new adapter. + * @see org.eclipse.emf.cdo.tests.legacy.model2.TransientContainer + * @generated + */ + public Adapter createTransientContainerAdapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.legacy.model1.Order Order} + * '. 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. + * + * @return the new adapter. + * @see org.eclipse.emf.cdo.tests.legacy.model1.Order + * @generated + */ + public Adapter createOrderAdapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.legacy.model1.PurchaseOrder + * Purchase Order}'. 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. + * + * @return the new adapter. + * @see org.eclipse.emf.cdo.tests.legacy.model1.PurchaseOrder + * @generated + */ + public Adapter createPurchaseOrderAdapter() + { + return null; + } + + /** + * Creates a new adapter for the default case. This default implementation returns null. + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() + { + return null; + } + +} // Model2AdapterFactory diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/util/Model2Switch.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/util/Model2Switch.java new file mode 100644 index 0000000000..173868a862 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/legacy/model2/util/Model2Switch.java @@ -0,0 +1,324 @@ +/** + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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: + * Eike Stepper - initial API and implementation + * + * $Id: Model2Switch.java,v 1.4 2010-01-08 19:43:26 mfluegge Exp $ + */ +package org.eclipse.emf.cdo.tests.legacy.model2.util; + +import org.eclipse.emf.cdo.tests.model1.Order; +import org.eclipse.emf.cdo.tests.model1.PurchaseOrder; +import org.eclipse.emf.cdo.tests.model2.Model2Package; +import org.eclipse.emf.cdo.tests.model2.PersistentContainment; +import org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder; +import org.eclipse.emf.cdo.tests.model2.Task; +import org.eclipse.emf.cdo.tests.model2.TaskContainer; +import org.eclipse.emf.cdo.tests.model2.TransientContainer; +import org.eclipse.emf.cdo.tests.model2.Unsettable1; +import org.eclipse.emf.cdo.tests.model2.Unsettable2WithDefault; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; + +import java.util.List; + +/** + * The Switch for the model's inheritance hierarchy. It supports the call + * {@link #doSwitch(EObject) doSwitch(object)} to invoke the caseXXX 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. + * + * @see org.eclipse.emf.cdo.tests.legacy.model2.Model2Package + * @generated + */ +public class Model2Switch +{ + /** + * The cached model package + * + * @generated + */ + protected static Model2Package modelPackage; + + /** + * Creates an instance of the switch. + * + * @generated + */ + public Model2Switch() + { + if (modelPackage == null) + { + modelPackage = Model2Package.eINSTANCE; + } + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + public T doSwitch(EObject theEObject) + { + return doSwitch(theEObject.eClass(), theEObject); + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + protected T doSwitch(EClass theEClass, EObject theEObject) + { + if (theEClass.eContainer() == modelPackage) + { + return doSwitch(theEClass.getClassifierID(), theEObject); + } + else + { + List eSuperTypes = theEClass.getESuperTypes(); + return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject); + } + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + protected T doSwitch(int classifierID, EObject theEObject) + { + switch (classifierID) + { + case Model2Package.SPECIAL_PURCHASE_ORDER: + { + SpecialPurchaseOrder specialPurchaseOrder = (SpecialPurchaseOrder)theEObject; + T result = caseSpecialPurchaseOrder(specialPurchaseOrder); + if (result == null) + result = casePurchaseOrder(specialPurchaseOrder); + if (result == null) + result = caseOrder(specialPurchaseOrder); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Model2Package.TASK_CONTAINER: + { + TaskContainer taskContainer = (TaskContainer)theEObject; + T result = caseTaskContainer(taskContainer); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Model2Package.TASK: + { + Task task = (Task)theEObject; + T result = caseTask(task); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Model2Package.UNSETTABLE1: + { + Unsettable1 unsettable1 = (Unsettable1)theEObject; + T result = caseUnsettable1(unsettable1); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Model2Package.UNSETTABLE2_WITH_DEFAULT: + { + Unsettable2WithDefault unsettable2WithDefault = (Unsettable2WithDefault)theEObject; + T result = caseUnsettable2WithDefault(unsettable2WithDefault); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Model2Package.PERSISTENT_CONTAINMENT: + { + PersistentContainment persistentContainment = (PersistentContainment)theEObject; + T result = casePersistentContainment(persistentContainment); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Model2Package.TRANSIENT_CONTAINER: + { + TransientContainer transientContainer = (TransientContainer)theEObject; + T result = caseTransientContainer(transientContainer); + if (result == null) + result = defaultCase(theEObject); + return result; + } + default: + return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Special Purchase Order'. This implementation returns null; returning a non-null result will terminate the switch. + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'Special Purchase Order'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseSpecialPurchaseOrder(SpecialPurchaseOrder object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Task Container'. + * This implementation returns null; returning a non-null result will terminate the switch. + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'Task Container'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTaskContainer(TaskContainer object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Task'. This + * implementation returns null; returning a non-null result will terminate the switch. + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'Task'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTask(Task object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Unsettable1'. + * This implementation returns null; returning a non-null result will terminate the switch. + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'Unsettable1'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseUnsettable1(Unsettable1 object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Unsettable2 With Default'. This implementation returns null; returning a non-null result will terminate the switch. + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'Unsettable2 With Default'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseUnsettable2WithDefault(Unsettable2WithDefault object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Persistent Containment'. This implementation returns null; returning a non-null result will terminate the switch. + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'Persistent Containment'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePersistentContainment(PersistentContainment object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Transient Container'. This implementation returns null; returning a non-null result will terminate the switch. + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'Transient Container'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTransientContainer(TransientContainer object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Order'. This + * implementation returns null; returning a non-null result will terminate the switch. + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'Order'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseOrder(Order object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Purchase Order'. + * This implementation returns null; returning a non-null result will terminate the switch. + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'Purchase Order'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePurchaseOrder(PurchaseOrder object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'EObject'. This + * implementation returns null; returning a non-null result will terminate the switch, but this is the last case + * anyway. + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + public T defaultCase(EObject object) + { + return null; + } + +} // Model2Switch -- cgit v1.2.3