Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/sample/forum/impl/ForumFactoryImpl.java')
-rw-r--r--examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/sample/forum/impl/ForumFactoryImpl.java162
1 files changed, 162 insertions, 0 deletions
diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/sample/forum/impl/ForumFactoryImpl.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/sample/forum/impl/ForumFactoryImpl.java
new file mode 100644
index 000000000..8db9ecfb8
--- /dev/null
+++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/sample/forum/impl/ForumFactoryImpl.java
@@ -0,0 +1,162 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: ForumFactoryImpl.java,v 1.1 2006/07/11 16:57:11 mtaal Exp $
+ */
+package org.eclipse.emf.teneo.samples.emf.sample.forum.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.teneo.samples.emf.sample.forum.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class ForumFactoryImpl extends EFactoryImpl implements ForumFactory {
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ForumFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case ForumPackage.FORUM: return createForum();
+ case ForumPackage.MEMBER: return createMember();
+ case ForumPackage.POST: return createPost();
+ case ForumPackage.TOPIC: return createTopic();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object createFromString(EDataType eDataType, String initialValue) {
+ switch (eDataType.getClassifierID()) {
+ case ForumPackage.TOPIC_CATEGORY: {
+ TopicCategory result = TopicCategory.get(initialValue);
+ if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
+ return result;
+ }
+ case ForumPackage.TOPIC_CATEGORY_OBJECT:
+ return createTopicCategoryObjectFromString(eDataType, initialValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convertToString(EDataType eDataType, Object instanceValue) {
+ switch (eDataType.getClassifierID()) {
+ case ForumPackage.TOPIC_CATEGORY:
+ return instanceValue == null ? null : instanceValue.toString();
+ case ForumPackage.TOPIC_CATEGORY_OBJECT:
+ return convertTopicCategoryObjectToString(eDataType, instanceValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Forum createForum() {
+ ForumImpl forum = new ForumImpl();
+ return forum;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Member createMember() {
+ MemberImpl member = new MemberImpl();
+ return member;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Post createPost() {
+ PostImpl post = new PostImpl();
+ return post;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Topic createTopic() {
+ TopicImpl topic = new TopicImpl();
+ return topic;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TopicCategory createTopicCategoryObjectFromString(EDataType eDataType, String initialValue) {
+ return (TopicCategory)ForumFactory.eINSTANCE.createFromString(ForumPackage.eINSTANCE.getTopicCategory(), initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convertTopicCategoryObjectToString(EDataType eDataType, Object instanceValue) {
+ return ForumFactory.eINSTANCE.convertToString(ForumPackage.eINSTANCE.getTopicCategory(), instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ForumPackage getForumPackage() {
+ return (ForumPackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ public static ForumPackage getPackage() {
+ return ForumPackage.eINSTANCE;
+ }
+
+} //ForumFactoryImpl

Back to the top