Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2010-02-19 08:18:48 +0000
committerEike Stepper2010-02-19 08:18:48 +0000
commit54d7b51c400797617dfa3b6ded279a51ab7d5231 (patch)
tree1d1e8c8bd5ee9f3a002b522422be5689d0a43832 /plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf
parent28274c6e446ea59169074e1ce0541be8e1b853fa (diff)
downloadcdo-54d7b51c400797617dfa3b6ded279a51ab7d5231.tar.gz
cdo-54d7b51c400797617dfa3b6ded279a51ab7d5231.tar.xz
cdo-54d7b51c400797617dfa3b6ded279a51ab7d5231.zip
[303279] Problem with CDOStore's toArray() implementation
https://bugs.eclipse.org/bugs/show_bug.cgi?id=303279
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf')
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/Model3Factory.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/Model3Package.java96
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/impl/Model3FactoryImpl.java70
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/impl/Model3PackageImpl.java61
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/impl/PolygonImpl.java170
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/util/Model3AdapterFactory.java21
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/util/Model3Switch.java26
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Model3Factory.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Model3Package.java96
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Point.java51
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Polygon.java47
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/Model3FactoryImpl.java72
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/Model3PackageImpl.java61
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/PolygonImpl.java78
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3AdapterFactory.java21
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3Switch.java26
16 files changed, 912 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/Model3Factory.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/Model3Factory.java
index 684c809595..e7477b4f9f 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/Model3Factory.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/Model3Factory.java
@@ -12,6 +12,7 @@ package org.eclipse.emf.cdo.tests.legacy.model3;
import org.eclipse.emf.cdo.tests.model3.Class1;
import org.eclipse.emf.cdo.tests.model3.MetaRef;
+import org.eclipse.emf.cdo.tests.model3.Polygon;
/**
* <!-- begin-user-doc --> The <b>Factory</b> for the model. It provides a create method for each non-abstract class of
@@ -46,6 +47,14 @@ public interface Model3Factory extends org.eclipse.emf.cdo.tests.model3.Model3Fa
MetaRef createMetaRef();
/**
+ * Returns a new object of class '<em>Polygon</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Polygon</em>'.
+ * @generated
+ */
+ Polygon createPolygon();
+
+ /**
* Returns the package supported by this factory. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @return the package supported by this factory.
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/Model3Package.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/Model3Package.java
index f50795de9c..162314bede 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/Model3Package.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/Model3Package.java
@@ -10,7 +10,9 @@
*/
package org.eclipse.emf.cdo.tests.legacy.model3;
+import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EReference;
/**
@@ -110,6 +112,41 @@ public interface Model3Package extends org.eclipse.emf.cdo.tests.model3.Model3Pa
int META_REF_FEATURE_COUNT = 1;
/**
+ * The meta object id for the '{@link org.eclipse.emf.cdo.tests.legacy.model3.impl.PolygonImpl <em>Polygon</em>}'
+ * class. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.cdo.tests.legacy.model3.impl.PolygonImpl
+ * @see org.eclipse.emf.cdo.tests.legacy.model3.impl.Model3PackageImpl#getPolygon()
+ * @generated
+ */
+ int POLYGON = 2;
+
+ /**
+ * The feature id for the '<em><b>Point</b></em>' attribute list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int POLYGON__POINT = 0;
+
+ /**
+ * The number of structural features of the '<em>Polygon</em>' class. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int POLYGON_FEATURE_COUNT = 1;
+
+ /**
+ * The meta object id for the '<em>Point</em>' data type. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.cdo.tests.model3.Point
+ * @see org.eclipse.emf.cdo.tests.legacy.model3.impl.Model3PackageImpl#getPoint()
+ * @generated
+ */
+ int POINT = 3;
+
+ /**
* Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.legacy.model3.Class1 <em>Class1</em>}'. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
@@ -152,6 +189,38 @@ public interface Model3Package extends org.eclipse.emf.cdo.tests.model3.Model3Pa
EReference getMetaRef_EPackageRef();
/**
+ * Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.legacy.model3.Polygon <em>Polygon</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Polygon</em>'.
+ * @see org.eclipse.emf.cdo.tests.legacy.model3.Polygon
+ * @generated
+ */
+ EClass getPolygon();
+
+ /**
+ * Returns the meta object for the attribute list '{@link org.eclipse.emf.cdo.tests.legacy.model3.Polygon#getPoint
+ * <em>Point</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute list '<em>Point</em>'.
+ * @see org.eclipse.emf.cdo.tests.legacy.model3.Polygon#getPoint()
+ * @see #getPolygon()
+ * @generated
+ */
+ EAttribute getPolygon_Point();
+
+ /**
+ * Returns the meta object for data type '{@link org.eclipse.emf.cdo.tests.model3.Point <em>Point</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for data type '<em>Point</em>'.
+ * @see org.eclipse.emf.cdo.tests.model3.Point
+ * @model instanceClass="org.eclipse.emf.cdo.tests.model3.Point"
+ * @generated
+ */
+ EDataType getPoint();
+
+ /**
* Returns the factory that creates the instances of the model. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @return the factory that creates the instances of the model.
@@ -209,6 +278,33 @@ public interface Model3Package extends org.eclipse.emf.cdo.tests.model3.Model3Pa
*/
EReference META_REF__EPACKAGE_REF = eINSTANCE.getMetaRef_EPackageRef();
+ /**
+ * The meta object literal for the '{@link org.eclipse.emf.cdo.tests.legacy.model3.impl.PolygonImpl
+ * <em>Polygon</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.cdo.tests.legacy.model3.impl.PolygonImpl
+ * @see org.eclipse.emf.cdo.tests.legacy.model3.impl.Model3PackageImpl#getPolygon()
+ * @generated
+ */
+ EClass POLYGON = eINSTANCE.getPolygon();
+
+ /**
+ * The meta object literal for the '<em><b>Point</b></em>' attribute list feature. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ EAttribute POLYGON__POINT = eINSTANCE.getPolygon_Point();
+
+ /**
+ * The meta object literal for the '<em>Point</em>' data type. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.cdo.tests.model3.Point
+ * @see org.eclipse.emf.cdo.tests.legacy.model3.impl.Model3PackageImpl#getPoint()
+ * @generated
+ */
+ EDataType POINT = eINSTANCE.getPoint();
+
}
} // Model3Package
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/impl/Model3FactoryImpl.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/impl/Model3FactoryImpl.java
index 7edb3bf774..f3f9bc8d8d 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/impl/Model3FactoryImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/impl/Model3FactoryImpl.java
@@ -14,8 +14,11 @@ import org.eclipse.emf.cdo.tests.legacy.model3.Model3Factory;
import org.eclipse.emf.cdo.tests.legacy.model3.Model3Package;
import org.eclipse.emf.cdo.tests.model3.Class1;
import org.eclipse.emf.cdo.tests.model3.MetaRef;
+import org.eclipse.emf.cdo.tests.model3.Point;
+import org.eclipse.emf.cdo.tests.model3.Polygon;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
@@ -75,6 +78,8 @@ public class Model3FactoryImpl extends EFactoryImpl implements Model3Factory
return createClass1();
case Model3Package.META_REF:
return createMetaRef();
+ case Model3Package.POLYGON:
+ return createPolygon();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
@@ -85,6 +90,40 @@ public class Model3FactoryImpl extends EFactoryImpl implements Model3Factory
*
* @generated
*/
+ @Override
+ public Object createFromString(EDataType eDataType, String initialValue)
+ {
+ switch (eDataType.getClassifierID())
+ {
+ case Model3Package.POINT:
+ return createPointFromString(eDataType, initialValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String convertToString(EDataType eDataType, Object instanceValue)
+ {
+ switch (eDataType.getClassifierID())
+ {
+ case Model3Package.POINT:
+ return convertPointToString(eDataType, instanceValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public Class1 createClass1()
{
Class1Impl class1 = new Class1Impl();
@@ -107,6 +146,37 @@ public class Model3FactoryImpl extends EFactoryImpl implements Model3Factory
*
* @generated
*/
+ public Polygon createPolygon()
+ {
+ PolygonImpl polygon = new PolygonImpl();
+ return polygon;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Point createPointFromString(EDataType eDataType, String initialValue)
+ {
+ return (Point)super.createFromString(eDataType, initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String convertPointToString(EDataType eDataType, Object instanceValue)
+ {
+ return super.convertToString(eDataType, instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public Model3Package getModel3Package()
{
return (Model3Package)getEPackage();
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/impl/Model3PackageImpl.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/impl/Model3PackageImpl.java
index 1cb2952d1b..e869eda53f 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/impl/Model3PackageImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/impl/Model3PackageImpl.java
@@ -16,8 +16,12 @@ import org.eclipse.emf.cdo.tests.legacy.model3.subpackage.SubpackagePackage;
import org.eclipse.emf.cdo.tests.legacy.model3.subpackage.impl.SubpackagePackageImpl;
import org.eclipse.emf.cdo.tests.model3.Class1;
import org.eclipse.emf.cdo.tests.model3.MetaRef;
+import org.eclipse.emf.cdo.tests.model3.Point;
+import org.eclipse.emf.cdo.tests.model3.Polygon;
+import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EcorePackage;
@@ -45,6 +49,20 @@ public class Model3PackageImpl extends EPackageImpl implements Model3Package
private EClass metaRefEClass = null;
/**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private EClass polygonEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private EDataType pointEDataType = null;
+
+ /**
* Creates an instance of the model <b>Package</b>, registered with {@link org.eclipse.emf.ecore.EPackage.Registry
* EPackage.Registry} by the package package URI value.
* <p>
@@ -164,6 +182,36 @@ public class Model3PackageImpl extends EPackageImpl implements Model3Package
*
* @generated
*/
+ public EClass getPolygon()
+ {
+ return polygonEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EAttribute getPolygon_Point()
+ {
+ return (EAttribute)polygonEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EDataType getPoint()
+ {
+ return pointEDataType;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public Model3Factory getModel3Factory()
{
return (Model3Factory)getEFactoryInstance();
@@ -196,6 +244,12 @@ public class Model3PackageImpl extends EPackageImpl implements Model3Package
metaRefEClass = createEClass(META_REF);
createEReference(metaRefEClass, META_REF__EPACKAGE_REF);
+
+ polygonEClass = createEClass(POLYGON);
+ createEAttribute(polygonEClass, POLYGON__POINT);
+
+ // Create data types
+ pointEDataType = createEDataType(POINT);
}
/**
@@ -249,6 +303,13 @@ public class Model3PackageImpl extends EPackageImpl implements Model3Package
MetaRef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(polygonEClass, Polygon.class, "Polygon", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getPolygon_Point(), getPoint(), "Point", null, 1, -1, Polygon.class, !IS_TRANSIENT, !IS_VOLATILE,
+ IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ // Initialize data types
+ initEDataType(pointEDataType, Point.class, "Point", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
+
// Create resource
createResource(eNS_URI);
}
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/impl/PolygonImpl.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/impl/PolygonImpl.java
new file mode 100644
index 0000000000..2375029a20
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/impl/PolygonImpl.java
@@ -0,0 +1,170 @@
+/**
+ * Copyright (c) 2004 - 2010 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
+ */
+package org.eclipse.emf.cdo.tests.legacy.model3.impl;
+
+import org.eclipse.emf.cdo.tests.legacy.model3.Model3Package;
+import org.eclipse.emf.cdo.tests.model3.Point;
+import org.eclipse.emf.cdo.tests.model3.Polygon;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
+
+import java.util.Collection;
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '<em><b>Polygon</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.emf.cdo.tests.legacy.model3.impl.PolygonImpl#getPoint <em>Point</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class PolygonImpl extends EObjectImpl implements Polygon
+{
+ /**
+ * The cached value of the '{@link #getPoint() <em>Point</em>}' attribute list. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getPoint()
+ * @generated
+ * @ordered
+ */
+ protected EList<Point> point;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected PolygonImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return Model3Package.Literals.POLYGON;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<Point> getPoint()
+ {
+ if (point == null)
+ {
+ point = new EDataTypeUniqueEList<Point>(Point.class, this, Model3Package.POLYGON__POINT);
+ }
+ return point;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case Model3Package.POLYGON__POINT:
+ return getPoint();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case Model3Package.POLYGON__POINT:
+ getPoint().clear();
+ getPoint().addAll((Collection<? extends Point>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case Model3Package.POLYGON__POINT:
+ getPoint().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case Model3Package.POLYGON__POINT:
+ return point != null && !point.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString()
+ {
+ if (eIsProxy())
+ {
+ return super.toString();
+ }
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (Point: ");
+ result.append(point);
+ result.append(')');
+ return result.toString();
+ }
+
+} // PolygonImpl
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/util/Model3AdapterFactory.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/util/Model3AdapterFactory.java
index 8f5ef64722..ce22ea4669 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/util/Model3AdapterFactory.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/util/Model3AdapterFactory.java
@@ -13,6 +13,7 @@ package org.eclipse.emf.cdo.tests.legacy.model3.util;
import org.eclipse.emf.cdo.tests.legacy.model3.Model3Package;
import org.eclipse.emf.cdo.tests.model3.Class1;
import org.eclipse.emf.cdo.tests.model3.MetaRef;
+import org.eclipse.emf.cdo.tests.model3.Polygon;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;
@@ -90,6 +91,12 @@ public class Model3AdapterFactory extends AdapterFactoryImpl
}
@Override
+ public Adapter casePolygon(Polygon object)
+ {
+ return createPolygonAdapter();
+ }
+
+ @Override
public Adapter defaultCase(EObject object)
{
return createEObjectAdapter();
@@ -139,6 +146,20 @@ public class Model3AdapterFactory extends AdapterFactoryImpl
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.legacy.model3.Polygon
+ * <em>Polygon</em>}'. <!-- begin-user-doc --> This default implementation returns null so that we can easily ignore
+ * cases; it's useful to ignore a case when inheritance will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.emf.cdo.tests.legacy.model3.Polygon
+ * @generated
+ */
+ public Adapter createPolygonAdapter()
+ {
+ return null;
+ }
+
+ /**
* Creates a new adapter for the default case. <!-- begin-user-doc --> This default implementation returns null. <!--
* end-user-doc -->
*
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/util/Model3Switch.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/util/Model3Switch.java
index 07f0e0ab25..0541736405 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/util/Model3Switch.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/util/Model3Switch.java
@@ -13,6 +13,7 @@ package org.eclipse.emf.cdo.tests.legacy.model3.util;
import org.eclipse.emf.cdo.tests.legacy.model3.Model3Package;
import org.eclipse.emf.cdo.tests.model3.Class1;
import org.eclipse.emf.cdo.tests.model3.MetaRef;
+import org.eclipse.emf.cdo.tests.model3.Polygon;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
@@ -113,6 +114,16 @@ public class Model3Switch<T>
}
return result;
}
+ case Model3Package.POLYGON:
+ {
+ Polygon polygon = (Polygon)theEObject;
+ T result = casePolygon(polygon);
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
+ return result;
+ }
default:
return defaultCase(theEObject);
}
@@ -149,6 +160,21 @@ public class Model3Switch<T>
}
/**
+ * Returns the result of interpreting the object as an instance of '<em>Polygon</em>'. <!-- begin-user-doc --> This
+ * implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Polygon</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T casePolygon(Polygon object)
+ {
+ return null;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>EObject</em>'. <!-- begin-user-doc --> This
* implementation returns null; returning a non-null result will terminate the switch, but this is the last case
* anyway. <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Model3Factory.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Model3Factory.java
index c1a4b8f946..2af3469c75 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Model3Factory.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Model3Factory.java
@@ -45,6 +45,14 @@ public interface Model3Factory extends EFactory
MetaRef createMetaRef();
/**
+ * Returns a new object of class '<em>Polygon</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Polygon</em>'.
+ * @generated
+ */
+ Polygon createPolygon();
+
+ /**
* Returns the package supported by this factory. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @return the package supported by this factory.
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Model3Package.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Model3Package.java
index f04af00e3d..71c0d237da 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Model3Package.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Model3Package.java
@@ -10,7 +10,9 @@
*/
package org.eclipse.emf.cdo.tests.model3;
+import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
@@ -111,6 +113,41 @@ public interface Model3Package extends EPackage
int META_REF_FEATURE_COUNT = 1;
/**
+ * The meta object id for the '{@link org.eclipse.emf.cdo.tests.model3.impl.PolygonImpl <em>Polygon</em>}' class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.cdo.tests.model3.impl.PolygonImpl
+ * @see org.eclipse.emf.cdo.tests.model3.impl.Model3PackageImpl#getPolygon()
+ * @generated
+ */
+ int POLYGON = 2;
+
+ /**
+ * The feature id for the '<em><b>Point</b></em>' attribute list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int POLYGON__POINT = 0;
+
+ /**
+ * The number of structural features of the '<em>Polygon</em>' class. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int POLYGON_FEATURE_COUNT = 1;
+
+ /**
+ * The meta object id for the '<em>Point</em>' data type. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.cdo.tests.model3.Point
+ * @see org.eclipse.emf.cdo.tests.model3.impl.Model3PackageImpl#getPoint()
+ * @generated
+ */
+ int POINT = 3;
+
+ /**
* Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model3.Class1 <em>Class1</em>}'. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
@@ -153,6 +190,38 @@ public interface Model3Package extends EPackage
EReference getMetaRef_EPackageRef();
/**
+ * Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model3.Polygon <em>Polygon</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Polygon</em>'.
+ * @see org.eclipse.emf.cdo.tests.model3.Polygon
+ * @generated
+ */
+ EClass getPolygon();
+
+ /**
+ * Returns the meta object for the attribute list '{@link org.eclipse.emf.cdo.tests.model3.Polygon#getPoint
+ * <em>Point</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute list '<em>Point</em>'.
+ * @see org.eclipse.emf.cdo.tests.model3.Polygon#getPoint()
+ * @see #getPolygon()
+ * @generated
+ */
+ EAttribute getPolygon_Point();
+
+ /**
+ * Returns the meta object for data type '{@link org.eclipse.emf.cdo.tests.model3.Point <em>Point</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for data type '<em>Point</em>'.
+ * @see org.eclipse.emf.cdo.tests.model3.Point
+ * @model instanceClass="org.eclipse.emf.cdo.tests.model3.Point"
+ * @generated
+ */
+ EDataType getPoint();
+
+ /**
* Returns the factory that creates the instances of the model. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @return the factory that creates the instances of the model.
@@ -210,6 +279,33 @@ public interface Model3Package extends EPackage
*/
EReference META_REF__EPACKAGE_REF = eINSTANCE.getMetaRef_EPackageRef();
+ /**
+ * The meta object literal for the '{@link org.eclipse.emf.cdo.tests.model3.impl.PolygonImpl <em>Polygon</em>}'
+ * class. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.cdo.tests.model3.impl.PolygonImpl
+ * @see org.eclipse.emf.cdo.tests.model3.impl.Model3PackageImpl#getPolygon()
+ * @generated
+ */
+ EClass POLYGON = eINSTANCE.getPolygon();
+
+ /**
+ * The meta object literal for the '<em><b>Point</b></em>' attribute list feature. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ EAttribute POLYGON__POINT = eINSTANCE.getPolygon_Point();
+
+ /**
+ * The meta object literal for the '<em>Point</em>' data type. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.cdo.tests.model3.Point
+ * @see org.eclipse.emf.cdo.tests.model3.impl.Model3PackageImpl#getPoint()
+ * @generated
+ */
+ EDataType POINT = eINSTANCE.getPoint();
+
}
} // Model3Package
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Point.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Point.java
new file mode 100644
index 0000000000..f48e91317c
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Point.java
@@ -0,0 +1,51 @@
+/**
+ * Copyright (c) 2004 - 2010 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
+ */
+package org.eclipse.emf.cdo.tests.model3;
+
+/**
+ * @author Eike Stepper
+ */
+public final class Point
+{
+ private int x;
+
+ private int y;
+
+ public Point(int x, int y)
+ {
+ this.x = x;
+ this.y = y;
+ }
+
+ public int getX()
+ {
+ return x;
+ }
+
+ public int getY()
+ {
+ return y;
+ }
+
+ @Override
+ public String toString()
+ {
+ return Integer.toString(x) + "," + Integer.toString(y);
+ }
+
+ public static Point parse(String str)
+ {
+ String[] coordinates = str.split(",");
+ int x = Integer.parseInt(coordinates[0]);
+ int y = Integer.parseInt(coordinates[1]);
+ return new Point(x, y);
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Polygon.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Polygon.java
new file mode 100644
index 0000000000..350d42810d
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Polygon.java
@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) 2004 - 2010 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
+ */
+package org.eclipse.emf.cdo.tests.model3;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '<em><b>Polygon</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.emf.cdo.tests.model3.Polygon#getPoint <em>Point</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.emf.cdo.tests.model3.Model3Package#getPolygon()
+ * @model
+ * @generated
+ */
+public interface Polygon extends EObject
+{
+ /**
+ * Returns the value of the '<em><b>Point</b></em>' attribute list. The list contents are of type
+ * {@link org.eclipse.emf.cdo.tests.model3.Point}. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Point</em>' attribute list isn't clear, there really should be more of a description
+ * here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Point</em>' attribute list.
+ * @see org.eclipse.emf.cdo.tests.model3.Model3Package#getPolygon_Point()
+ * @model dataType="org.eclipse.emf.cdo.tests.model3.Point" required="true"
+ * @generated
+ */
+ EList<Point> getPoint();
+
+} // Polygon
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/Model3FactoryImpl.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/Model3FactoryImpl.java
index 276a873509..30ced969cf 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/Model3FactoryImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/Model3FactoryImpl.java
@@ -4,7 +4,7 @@
* 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
*/
@@ -14,8 +14,11 @@ import org.eclipse.emf.cdo.tests.model3.Class1;
import org.eclipse.emf.cdo.tests.model3.MetaRef;
import org.eclipse.emf.cdo.tests.model3.Model3Factory;
import org.eclipse.emf.cdo.tests.model3.Model3Package;
+import org.eclipse.emf.cdo.tests.model3.Point;
+import org.eclipse.emf.cdo.tests.model3.Polygon;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
@@ -75,6 +78,8 @@ public class Model3FactoryImpl extends EFactoryImpl implements Model3Factory
return createClass1();
case Model3Package.META_REF:
return createMetaRef();
+ case Model3Package.POLYGON:
+ return createPolygon();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
@@ -85,6 +90,40 @@ public class Model3FactoryImpl extends EFactoryImpl implements Model3Factory
*
* @generated
*/
+ @Override
+ public Object createFromString(EDataType eDataType, String initialValue)
+ {
+ switch (eDataType.getClassifierID())
+ {
+ case Model3Package.POINT:
+ return createPointFromString(eDataType, initialValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String convertToString(EDataType eDataType, Object instanceValue)
+ {
+ switch (eDataType.getClassifierID())
+ {
+ case Model3Package.POINT:
+ return convertPointToString(eDataType, instanceValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public Class1 createClass1()
{
Class1Impl class1 = new Class1Impl();
@@ -107,6 +146,37 @@ public class Model3FactoryImpl extends EFactoryImpl implements Model3Factory
*
* @generated
*/
+ public Polygon createPolygon()
+ {
+ PolygonImpl polygon = new PolygonImpl();
+ return polygon;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated NOT
+ */
+ public Point createPointFromString(EDataType eDataType, String initialValue)
+ {
+ return Point.parse(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated NOT
+ */
+ public String convertPointToString(EDataType eDataType, Object instanceValue)
+ {
+ return ((Point)instanceValue).toString();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public Model3Package getModel3Package()
{
return (Model3Package)getEPackage();
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/Model3PackageImpl.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/Model3PackageImpl.java
index 18a450a325..6295c23552 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/Model3PackageImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/Model3PackageImpl.java
@@ -14,10 +14,14 @@ import org.eclipse.emf.cdo.tests.model3.Class1;
import org.eclipse.emf.cdo.tests.model3.MetaRef;
import org.eclipse.emf.cdo.tests.model3.Model3Factory;
import org.eclipse.emf.cdo.tests.model3.Model3Package;
+import org.eclipse.emf.cdo.tests.model3.Point;
+import org.eclipse.emf.cdo.tests.model3.Polygon;
import org.eclipse.emf.cdo.tests.model3.subpackage.SubpackagePackage;
import org.eclipse.emf.cdo.tests.model3.subpackage.impl.SubpackagePackageImpl;
+import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EcorePackage;
@@ -45,6 +49,20 @@ public class Model3PackageImpl extends EPackageImpl implements Model3Package
private EClass metaRefEClass = null;
/**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private EClass polygonEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private EDataType pointEDataType = null;
+
+ /**
* Creates an instance of the model <b>Package</b>, registered with {@link org.eclipse.emf.ecore.EPackage.Registry
* EPackage.Registry} by the package package URI value.
* <p>
@@ -164,6 +182,36 @@ public class Model3PackageImpl extends EPackageImpl implements Model3Package
*
* @generated
*/
+ public EClass getPolygon()
+ {
+ return polygonEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EAttribute getPolygon_Point()
+ {
+ return (EAttribute)polygonEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EDataType getPoint()
+ {
+ return pointEDataType;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public Model3Factory getModel3Factory()
{
return (Model3Factory)getEFactoryInstance();
@@ -196,6 +244,12 @@ public class Model3PackageImpl extends EPackageImpl implements Model3Package
metaRefEClass = createEClass(META_REF);
createEReference(metaRefEClass, META_REF__EPACKAGE_REF);
+
+ polygonEClass = createEClass(POLYGON);
+ createEAttribute(polygonEClass, POLYGON__POINT);
+
+ // Create data types
+ pointEDataType = createEDataType(POINT);
}
/**
@@ -249,6 +303,13 @@ public class Model3PackageImpl extends EPackageImpl implements Model3Package
MetaRef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(polygonEClass, Polygon.class, "Polygon", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getPolygon_Point(), getPoint(), "Point", null, 1, -1, Polygon.class, !IS_TRANSIENT, !IS_VOLATILE,
+ IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ // Initialize data types
+ initEDataType(pointEDataType, Point.class, "Point", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
+
// Create resource
createResource(eNS_URI);
}
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/PolygonImpl.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/PolygonImpl.java
new file mode 100644
index 0000000000..ce9392390c
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/PolygonImpl.java
@@ -0,0 +1,78 @@
+/**
+ * Copyright (c) 2004 - 2010 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
+ */
+package org.eclipse.emf.cdo.tests.model3.impl;
+
+import org.eclipse.emf.cdo.tests.model3.Model3Package;
+import org.eclipse.emf.cdo.tests.model3.Point;
+import org.eclipse.emf.cdo.tests.model3.Polygon;
+
+import org.eclipse.emf.internal.cdo.CDOObjectImpl;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '<em><b>Polygon</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.emf.cdo.tests.model3.impl.PolygonImpl#getPoint <em>Point</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class PolygonImpl extends CDOObjectImpl implements Polygon
+{
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected PolygonImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return Model3Package.Literals.POLYGON;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected int eStaticFeatureCount()
+ {
+ return 0;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ public EList<Point> getPoint()
+ {
+ return (EList<Point>)eGet(Model3Package.Literals.POLYGON__POINT, true);
+ }
+
+} // PolygonImpl
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3AdapterFactory.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3AdapterFactory.java
index bd43148409..ca36d5ccc6 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3AdapterFactory.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3AdapterFactory.java
@@ -13,6 +13,7 @@ package org.eclipse.emf.cdo.tests.model3.util;
import org.eclipse.emf.cdo.tests.model3.Class1;
import org.eclipse.emf.cdo.tests.model3.MetaRef;
import org.eclipse.emf.cdo.tests.model3.Model3Package;
+import org.eclipse.emf.cdo.tests.model3.Polygon;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;
@@ -90,6 +91,12 @@ public class Model3AdapterFactory extends AdapterFactoryImpl
}
@Override
+ public Adapter casePolygon(Polygon object)
+ {
+ return createPolygonAdapter();
+ }
+
+ @Override
public Adapter defaultCase(EObject object)
{
return createEObjectAdapter();
@@ -139,6 +146,20 @@ public class Model3AdapterFactory extends AdapterFactoryImpl
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.model3.Polygon <em>Polygon</em>}'.
+ * <!-- begin-user-doc --> This default implementation returns null so that we can easily ignore cases; it's useful to
+ * ignore a case when inheritance will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.emf.cdo.tests.model3.Polygon
+ * @generated
+ */
+ public Adapter createPolygonAdapter()
+ {
+ return null;
+ }
+
+ /**
* Creates a new adapter for the default case. <!-- begin-user-doc --> This default implementation returns null. <!--
* end-user-doc -->
*
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3Switch.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3Switch.java
index aa6e59a2ec..7ae93cbad6 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3Switch.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3Switch.java
@@ -13,6 +13,7 @@ package org.eclipse.emf.cdo.tests.model3.util;
import org.eclipse.emf.cdo.tests.model3.Class1;
import org.eclipse.emf.cdo.tests.model3.MetaRef;
import org.eclipse.emf.cdo.tests.model3.Model3Package;
+import org.eclipse.emf.cdo.tests.model3.Polygon;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
@@ -113,6 +114,16 @@ public class Model3Switch<T>
}
return result;
}
+ case Model3Package.POLYGON:
+ {
+ Polygon polygon = (Polygon)theEObject;
+ T result = casePolygon(polygon);
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
+ return result;
+ }
default:
return defaultCase(theEObject);
}
@@ -149,6 +160,21 @@ public class Model3Switch<T>
}
/**
+ * Returns the result of interpreting the object as an instance of '<em>Polygon</em>'. <!-- begin-user-doc --> This
+ * implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Polygon</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T casePolygon(Polygon object)
+ {
+ return null;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>EObject</em>'. <!-- begin-user-doc --> This
* implementation returns null; returning a non-null result will terminate the switch, but this is the last case
* anyway. <!-- end-user-doc -->

Back to the top