Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-06-12 17:22:29 +0000
committerEike Stepper2008-06-12 17:22:29 +0000
commitf89b60e8831466326020a15241e3a20bc8ecbc43 (patch)
tree8a074cd21cccaddb5aec6c250be38b0431024200 /plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf
parent178e2a92ef4f994462138aa005e0909bb3354e62 (diff)
downloadcdo-f89b60e8831466326020a15241e3a20bc8ecbc43.tar.gz
cdo-f89b60e8831466326020a15241e3a20bc8ecbc43.tar.xz
cdo-f89b60e8831466326020a15241e3a20bc8ecbc43.zip
[236313] IllegalArgumentException due to null value where a default was specified
https://bugs.eclipse.org/bugs/show_bug.cgi?id=236313
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf')
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/MangoFactory.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/MangoPackage.java125
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/Parameter.java84
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/ParameterPassing.java219
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/impl/MangoFactoryImpl.java76
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/impl/MangoPackageImpl.java77
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/impl/ParameterImpl.java103
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/util/MangoAdapterFactory.java23
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/util/MangoSwitch.java25
9 files changed, 736 insertions, 6 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/MangoFactory.java b/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/MangoFactory.java
index 964dde69dd..e9e61d0372 100644
--- a/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/MangoFactory.java
+++ b/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/MangoFactory.java
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: MangoFactory.java,v 1.2 2008-02-23 10:00:33 estepper Exp $
+ * $Id: MangoFactory.java,v 1.3 2008-06-12 17:22:17 estepper Exp $
*/
package org.eclipse.emf.cdo.tests.mango;
@@ -41,6 +41,14 @@ public interface MangoFactory extends EFactory
Value createValue();
/**
+ * Returns a new object of class '<em>Parameter</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Parameter</em>'.
+ * @generated
+ */
+ Parameter createParameter();
+
+ /**
* 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.mango/src/org/eclipse/emf/cdo/tests/mango/MangoPackage.java b/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/MangoPackage.java
index 406750744c..e264b68c02 100644
--- a/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/MangoPackage.java
+++ b/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/MangoPackage.java
@@ -2,12 +2,13 @@
* <copyright>
* </copyright>
*
- * $Id: MangoPackage.java,v 1.4 2008-06-03 06:41:27 estepper Exp $
+ * $Id: MangoPackage.java,v 1.5 2008-06-12 17:22:17 estepper Exp $
*/
package org.eclipse.emf.cdo.tests.mango;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
@@ -116,6 +117,50 @@ public interface MangoPackage extends EPackage
int VALUE_FEATURE_COUNT = 1;
/**
+ * The meta object id for the '{@link org.eclipse.emf.cdo.tests.mango.impl.ParameterImpl <em>Parameter</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.cdo.tests.mango.impl.ParameterImpl
+ * @see org.eclipse.emf.cdo.tests.mango.impl.MangoPackageImpl#getParameter()
+ * @generated
+ */
+ int PARAMETER = 2;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PARAMETER__NAME = 0;
+
+ /**
+ * The feature id for the '<em><b>Passing</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PARAMETER__PASSING = 1;
+
+ /**
+ * The number of structural features of the '<em>Parameter</em>' class. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PARAMETER_FEATURE_COUNT = 2;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.emf.cdo.tests.mango.ParameterPassing <em>Parameter Passing</em>}'
+ * enum. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.cdo.tests.mango.ParameterPassing
+ * @see org.eclipse.emf.cdo.tests.mango.impl.MangoPackageImpl#getParameterPassing()
+ * @generated
+ */
+ int PARAMETER_PASSING = 3;
+
+ /**
* Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.mango.ValueList <em>Value List</em>}'. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
@@ -169,6 +214,48 @@ public interface MangoPackage extends EPackage
EAttribute getValue_Name();
/**
+ * Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.mango.Parameter <em>Parameter</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Parameter</em>'.
+ * @see org.eclipse.emf.cdo.tests.mango.Parameter
+ * @generated
+ */
+ EClass getParameter();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.tests.mango.Parameter#getName <em>Name</em>}
+ * '. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.emf.cdo.tests.mango.Parameter#getName()
+ * @see #getParameter()
+ * @generated
+ */
+ EAttribute getParameter_Name();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.tests.mango.Parameter#getPassing
+ * <em>Passing</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Passing</em>'.
+ * @see org.eclipse.emf.cdo.tests.mango.Parameter#getPassing()
+ * @see #getParameter()
+ * @generated
+ */
+ EAttribute getParameter_Passing();
+
+ /**
+ * Returns the meta object for enum '{@link org.eclipse.emf.cdo.tests.mango.ParameterPassing
+ * <em>Parameter Passing</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for enum '<em>Parameter Passing</em>'.
+ * @see org.eclipse.emf.cdo.tests.mango.ParameterPassing
+ * @generated
+ */
+ EEnum getParameterPassing();
+
+ /**
* 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.
@@ -234,6 +321,42 @@ public interface MangoPackage extends EPackage
*/
EAttribute VALUE__NAME = eINSTANCE.getValue_Name();
+ /**
+ * The meta object literal for the '{@link org.eclipse.emf.cdo.tests.mango.impl.ParameterImpl <em>Parameter</em>}'
+ * class. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.cdo.tests.mango.impl.ParameterImpl
+ * @see org.eclipse.emf.cdo.tests.mango.impl.MangoPackageImpl#getParameter()
+ * @generated
+ */
+ EClass PARAMETER = eINSTANCE.getParameter();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ EAttribute PARAMETER__NAME = eINSTANCE.getParameter_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Passing</b></em>' attribute feature. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ EAttribute PARAMETER__PASSING = eINSTANCE.getParameter_Passing();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.emf.cdo.tests.mango.ParameterPassing
+ * <em>Parameter Passing</em>}' enum. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.cdo.tests.mango.ParameterPassing
+ * @see org.eclipse.emf.cdo.tests.mango.impl.MangoPackageImpl#getParameterPassing()
+ * @generated
+ */
+ EEnum PARAMETER_PASSING = eINSTANCE.getParameterPassing();
+
}
} // MangoPackage
diff --git a/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/Parameter.java b/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/Parameter.java
new file mode 100644
index 0000000000..5a79a20734
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/Parameter.java
@@ -0,0 +1,84 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: Parameter.java,v 1.1 2008-06-12 17:22:17 estepper Exp $
+ */
+package org.eclipse.emf.cdo.tests.mango;
+
+import org.eclipse.emf.cdo.CDOObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '<em><b>Parameter</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.emf.cdo.tests.mango.Parameter#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.mango.Parameter#getPassing <em>Passing</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.emf.cdo.tests.mango.MangoPackage#getParameter()
+ * @model
+ * @extends CDOObject
+ * @generated
+ */
+public interface Parameter extends CDOObject
+{
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear, there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.emf.cdo.tests.mango.MangoPackage#getParameter_Name()
+ * @model
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.cdo.tests.mango.Parameter#getName <em>Name</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Passing</b></em>' attribute. The literals are from the enumeration
+ * {@link org.eclipse.emf.cdo.tests.mango.ParameterPassing}. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Passing</em>' attribute isn't clear, there really should be more of a description
+ * here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Passing</em>' attribute.
+ * @see org.eclipse.emf.cdo.tests.mango.ParameterPassing
+ * @see #setPassing(ParameterPassing)
+ * @see org.eclipse.emf.cdo.tests.mango.MangoPackage#getParameter_Passing()
+ * @model
+ * @generated
+ */
+ ParameterPassing getPassing();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.cdo.tests.mango.Parameter#getPassing <em>Passing</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Passing</em>' attribute.
+ * @see org.eclipse.emf.cdo.tests.mango.ParameterPassing
+ * @see #getPassing()
+ * @generated
+ */
+ void setPassing(ParameterPassing value);
+
+} // Parameter
diff --git a/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/ParameterPassing.java b/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/ParameterPassing.java
new file mode 100644
index 0000000000..e42fa73bae
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/ParameterPassing.java
@@ -0,0 +1,219 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: ParameterPassing.java,v 1.1 2008-06-12 17:22:17 estepper Exp $
+ */
+package org.eclipse.emf.cdo.tests.mango;
+
+import org.eclipse.emf.common.util.Enumerator;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * <!-- begin-user-doc --> A representation of the literals of the enumeration '<em><b>Parameter Passing</b></em>', and
+ * utility methods for working with them. <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.cdo.tests.mango.MangoPackage#getParameterPassing()
+ * @model
+ * @generated
+ */
+public enum ParameterPassing implements Enumerator
+{
+ /**
+ * The '<em><b>By Value</b></em>' literal object. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #BY_VALUE_VALUE
+ * @generated
+ * @ordered
+ */
+ BY_VALUE(0, "ByValue", "ByValue"),
+
+ /**
+ * The '<em><b>By Reference</b></em>' literal object. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #BY_REFERENCE_VALUE
+ * @generated
+ * @ordered
+ */
+ BY_REFERENCE(1, "ByReference", "ByReference");
+
+ /**
+ * The '<em><b>By Value</b></em>' literal value. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>By Value</b></em>' literal object isn't clear, there really should be more of a
+ * description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @see #BY_VALUE
+ * @model name="ByValue"
+ * @generated
+ * @ordered
+ */
+ public static final int BY_VALUE_VALUE = 0;
+
+ /**
+ * The '<em><b>By Reference</b></em>' literal value. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>By Reference</b></em>' literal object isn't clear, there really should be more of a
+ * description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @see #BY_REFERENCE
+ * @model name="ByReference"
+ * @generated
+ * @ordered
+ */
+ public static final int BY_REFERENCE_VALUE = 1;
+
+ /**
+ * An array of all the '<em><b>Parameter Passing</b></em>' enumerators. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private static final ParameterPassing[] VALUES_ARRAY = new ParameterPassing[] { BY_VALUE, BY_REFERENCE, };
+
+ /**
+ * A public read-only list of all the '<em><b>Parameter Passing</b></em>' enumerators. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ public static final List<ParameterPassing> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
+
+ /**
+ * Returns the '<em><b>Parameter Passing</b></em>' literal with the specified literal value. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static ParameterPassing get(String literal)
+ {
+ for (int i = 0; i < VALUES_ARRAY.length; ++i)
+ {
+ ParameterPassing result = VALUES_ARRAY[i];
+ if (result.toString().equals(literal))
+ {
+ return result;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the '<em><b>Parameter Passing</b></em>' literal with the specified name. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ public static ParameterPassing getByName(String name)
+ {
+ for (int i = 0; i < VALUES_ARRAY.length; ++i)
+ {
+ ParameterPassing result = VALUES_ARRAY[i];
+ if (result.getName().equals(name))
+ {
+ return result;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the '<em><b>Parameter Passing</b></em>' literal with the specified integer value. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static ParameterPassing get(int value)
+ {
+ switch (value)
+ {
+ case BY_VALUE_VALUE:
+ return BY_VALUE;
+ case BY_REFERENCE_VALUE:
+ return BY_REFERENCE;
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private final int value;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private final String name;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private final String literal;
+
+ /**
+ * Only this class can construct instances. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private ParameterPassing(int value, String name, String literal)
+ {
+ this.value = value;
+ this.name = name;
+ this.literal = literal;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public int getValue()
+ {
+ return value;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getLiteral()
+ {
+ return literal;
+ }
+
+ /**
+ * Returns the literal value of the enumerator, which is its string representation. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString()
+ {
+ return literal;
+ }
+
+} // ParameterPassing
diff --git a/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/impl/MangoFactoryImpl.java b/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/impl/MangoFactoryImpl.java
index 1118249e0d..05566921c6 100644
--- a/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/impl/MangoFactoryImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/impl/MangoFactoryImpl.java
@@ -2,16 +2,19 @@
* <copyright>
* </copyright>
*
- * $Id: MangoFactoryImpl.java,v 1.3 2008-04-27 08:57:26 estepper Exp $
+ * $Id: MangoFactoryImpl.java,v 1.4 2008-06-12 17:22:17 estepper Exp $
*/
package org.eclipse.emf.cdo.tests.mango.impl;
import org.eclipse.emf.cdo.tests.mango.MangoFactory;
import org.eclipse.emf.cdo.tests.mango.MangoPackage;
+import org.eclipse.emf.cdo.tests.mango.Parameter;
+import org.eclipse.emf.cdo.tests.mango.ParameterPassing;
import org.eclipse.emf.cdo.tests.mango.Value;
import org.eclipse.emf.cdo.tests.mango.ValueList;
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;
@@ -71,6 +74,8 @@ public class MangoFactoryImpl extends EFactoryImpl implements MangoFactory
return (EObject)createValueList();
case MangoPackage.VALUE:
return (EObject)createValue();
+ case MangoPackage.PARAMETER:
+ return (EObject)createParameter();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
@@ -81,6 +86,40 @@ public class MangoFactoryImpl extends EFactoryImpl implements MangoFactory
*
* @generated
*/
+ @Override
+ public Object createFromString(EDataType eDataType, String initialValue)
+ {
+ switch (eDataType.getClassifierID())
+ {
+ case MangoPackage.PARAMETER_PASSING:
+ return createParameterPassingFromString(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 MangoPackage.PARAMETER_PASSING:
+ return convertParameterPassingToString(eDataType, instanceValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public ValueList createValueList()
{
ValueListImpl valueList = new ValueListImpl();
@@ -103,6 +142,41 @@ public class MangoFactoryImpl extends EFactoryImpl implements MangoFactory
*
* @generated
*/
+ public Parameter createParameter()
+ {
+ ParameterImpl parameter = new ParameterImpl();
+ return parameter;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ParameterPassing createParameterPassingFromString(EDataType eDataType, String initialValue)
+ {
+ ParameterPassing result = ParameterPassing.get(initialValue);
+ if (result == null)
+ throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '"
+ + eDataType.getName() + "'");
+ return result;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String convertParameterPassingToString(EDataType eDataType, Object instanceValue)
+ {
+ return instanceValue == null ? null : instanceValue.toString();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public MangoPackage getMangoPackage()
{
return (MangoPackage)getEPackage();
diff --git a/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/impl/MangoPackageImpl.java b/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/impl/MangoPackageImpl.java
index c23d4976d5..e974ef2a8e 100644
--- a/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/impl/MangoPackageImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/impl/MangoPackageImpl.java
@@ -2,17 +2,20 @@
* <copyright>
* </copyright>
*
- * $Id: MangoPackageImpl.java,v 1.3 2008-06-03 06:41:27 estepper Exp $
+ * $Id: MangoPackageImpl.java,v 1.4 2008-06-12 17:22:17 estepper Exp $
*/
package org.eclipse.emf.cdo.tests.mango.impl;
import org.eclipse.emf.cdo.tests.mango.MangoFactory;
import org.eclipse.emf.cdo.tests.mango.MangoPackage;
+import org.eclipse.emf.cdo.tests.mango.Parameter;
+import org.eclipse.emf.cdo.tests.mango.ParameterPassing;
import org.eclipse.emf.cdo.tests.mango.Value;
import org.eclipse.emf.cdo.tests.mango.ValueList;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.impl.EPackageImpl;
@@ -39,6 +42,20 @@ public class MangoPackageImpl extends EPackageImpl implements MangoPackage
private EClass valueEClass = null;
/**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private EClass parameterEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private EEnum parameterPassingEEnum = 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>
@@ -159,6 +176,46 @@ public class MangoPackageImpl extends EPackageImpl implements MangoPackage
*
* @generated
*/
+ public EClass getParameter()
+ {
+ return parameterEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EAttribute getParameter_Name()
+ {
+ return (EAttribute)parameterEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EAttribute getParameter_Passing()
+ {
+ return (EAttribute)parameterEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EEnum getParameterPassing()
+ {
+ return parameterPassingEEnum;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public MangoFactory getMangoFactory()
{
return (MangoFactory)getEFactoryInstance();
@@ -189,6 +246,13 @@ public class MangoPackageImpl extends EPackageImpl implements MangoPackage
valueEClass = createEClass(VALUE);
createEAttribute(valueEClass, VALUE__NAME);
+
+ parameterEClass = createEClass(PARAMETER);
+ createEAttribute(parameterEClass, PARAMETER__NAME);
+ createEAttribute(parameterEClass, PARAMETER__PASSING);
+
+ // Create enums
+ parameterPassingEEnum = createEEnum(PARAMETER_PASSING);
}
/**
@@ -232,6 +296,17 @@ public class MangoPackageImpl extends EPackageImpl implements MangoPackage
initEAttribute(getValue_Name(), ecorePackage.getEString(), "name", null, 0, 1, Value.class, !IS_TRANSIENT,
!IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(parameterEClass, Parameter.class, "Parameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getParameter_Name(), ecorePackage.getEString(), "name", null, 0, 1, Parameter.class, !IS_TRANSIENT,
+ !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getParameter_Passing(), this.getParameterPassing(), "passing", null, 0, 1, Parameter.class,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ // Initialize enums and add enum literals
+ initEEnum(parameterPassingEEnum, ParameterPassing.class, "ParameterPassing");
+ addEEnumLiteral(parameterPassingEEnum, ParameterPassing.BY_VALUE);
+ addEEnumLiteral(parameterPassingEEnum, ParameterPassing.BY_REFERENCE);
+
// Create resource
createResource(eNS_URI);
}
diff --git a/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/impl/ParameterImpl.java b/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/impl/ParameterImpl.java
new file mode 100644
index 0000000000..3c4f976eda
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/impl/ParameterImpl.java
@@ -0,0 +1,103 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: ParameterImpl.java,v 1.1 2008-06-12 17:22:17 estepper Exp $
+ */
+package org.eclipse.emf.cdo.tests.mango.impl;
+
+import org.eclipse.emf.cdo.tests.mango.MangoPackage;
+import org.eclipse.emf.cdo.tests.mango.Parameter;
+import org.eclipse.emf.cdo.tests.mango.ParameterPassing;
+
+import org.eclipse.emf.internal.cdo.CDOObjectImpl;
+
+import org.eclipse.emf.ecore.EClass;
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '<em><b>Parameter</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.emf.cdo.tests.mango.impl.ParameterImpl#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.mango.impl.ParameterImpl#getPassing <em>Passing</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ParameterImpl extends CDOObjectImpl implements Parameter
+{
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ParameterImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return MangoPackage.Literals.PARAMETER;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected int eStaticFeatureCount()
+ {
+ return 0;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getName()
+ {
+ return (String)eGet(MangoPackage.Literals.PARAMETER__NAME, true);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setName(String newName)
+ {
+ eSet(MangoPackage.Literals.PARAMETER__NAME, newName);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ParameterPassing getPassing()
+ {
+ return (ParameterPassing)eGet(MangoPackage.Literals.PARAMETER__PASSING, true);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setPassing(ParameterPassing newPassing)
+ {
+ eSet(MangoPackage.Literals.PARAMETER__PASSING, newPassing);
+ }
+
+} // ParameterImpl
diff --git a/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/util/MangoAdapterFactory.java b/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/util/MangoAdapterFactory.java
index ff73d3ec51..d7138e6ce9 100644
--- a/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/util/MangoAdapterFactory.java
+++ b/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/util/MangoAdapterFactory.java
@@ -2,11 +2,12 @@
* <copyright>
* </copyright>
*
- * $Id: MangoAdapterFactory.java,v 1.3 2008-06-03 06:41:27 estepper Exp $
+ * $Id: MangoAdapterFactory.java,v 1.4 2008-06-12 17:22:17 estepper Exp $
*/
package org.eclipse.emf.cdo.tests.mango.util;
import org.eclipse.emf.cdo.tests.mango.MangoPackage;
+import org.eclipse.emf.cdo.tests.mango.Parameter;
import org.eclipse.emf.cdo.tests.mango.Value;
import org.eclipse.emf.cdo.tests.mango.ValueList;
@@ -86,6 +87,12 @@ public class MangoAdapterFactory extends AdapterFactoryImpl
}
@Override
+ public Adapter caseParameter(Parameter object)
+ {
+ return createParameterAdapter();
+ }
+
+ @Override
public Adapter defaultCase(EObject object)
{
return createEObjectAdapter();
@@ -135,6 +142,20 @@ public class MangoAdapterFactory extends AdapterFactoryImpl
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.mango.Parameter <em>Parameter</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.mango.Parameter
+ * @generated
+ */
+ public Adapter createParameterAdapter()
+ {
+ 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.mango/src/org/eclipse/emf/cdo/tests/mango/util/MangoSwitch.java b/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/util/MangoSwitch.java
index 207a0df8cb..4e308b2766 100644
--- a/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/util/MangoSwitch.java
+++ b/plugins/org.eclipse.emf.cdo.tests.mango/src/org/eclipse/emf/cdo/tests/mango/util/MangoSwitch.java
@@ -2,11 +2,12 @@
* <copyright>
* </copyright>
*
- * $Id: MangoSwitch.java,v 1.3 2008-06-03 06:41:27 estepper Exp $
+ * $Id: MangoSwitch.java,v 1.4 2008-06-12 17:22:17 estepper Exp $
*/
package org.eclipse.emf.cdo.tests.mango.util;
import org.eclipse.emf.cdo.tests.mango.MangoPackage;
+import org.eclipse.emf.cdo.tests.mango.Parameter;
import org.eclipse.emf.cdo.tests.mango.Value;
import org.eclipse.emf.cdo.tests.mango.ValueList;
@@ -103,6 +104,13 @@ public class MangoSwitch<T>
if (result == null) result = defaultCase(theEObject);
return result;
}
+ case MangoPackage.PARAMETER:
+ {
+ Parameter parameter = (Parameter)theEObject;
+ T result = caseParameter(parameter);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
default:
return defaultCase(theEObject);
}
@@ -139,6 +147,21 @@ public class MangoSwitch<T>
}
/**
+ * Returns the result of interpreting the object as an instance of '<em>Parameter</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>Parameter</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseParameter(Parameter 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