/******************************************************************************* | |
* Copyright (c) 2010 Ericsson | |
* | |
* 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 | |
* | |
* Description: | |
* | |
* Contributors: | |
* Alvaro Sanchez-Leon - Initial Implementation and API | |
*******************************************************************************/ | |
package org.eclipse.mylyn.reviews.frame.core.model.impl; | |
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; | |
import org.eclipse.mylyn.reviews.frame.core.model.*; | |
import org.eclipse.mylyn.reviews.frame.core.model.Comment; | |
import org.eclipse.mylyn.reviews.frame.core.model.Item; | |
import org.eclipse.mylyn.reviews.frame.core.model.ModelFactory; | |
import org.eclipse.mylyn.reviews.frame.core.model.ModelPackage; | |
import org.eclipse.mylyn.reviews.frame.core.model.Review; | |
import org.eclipse.mylyn.reviews.frame.core.model.ReviewComponent; | |
import org.eclipse.mylyn.reviews.frame.core.model.ReviewGroup; | |
import org.eclipse.mylyn.reviews.frame.core.model.TaskReference; | |
import org.eclipse.mylyn.reviews.frame.core.model.Topic; | |
import org.eclipse.mylyn.reviews.frame.core.model.User; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model <b>Factory</b>. | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public class ModelFactoryImpl extends EFactoryImpl implements ModelFactory { | |
/** | |
* Creates the default factory implementation. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public static ModelFactory init() { | |
try { | |
ModelFactory theModelFactory = (ModelFactory)EPackage.Registry.INSTANCE.getEFactory("http://org.eclipse.mylyn.reviews.frame.core.model/1.0"); | |
if (theModelFactory != null) { | |
return theModelFactory; | |
} | |
} | |
catch (Exception exception) { | |
EcorePlugin.INSTANCE.log(exception); | |
} | |
return new ModelFactoryImpl(); | |
} | |
/** | |
* Creates an instance of the factory. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public ModelFactoryImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public EObject create(EClass eClass) { | |
switch (eClass.getClassifierID()) { | |
case ModelPackage.REVIEW: return createReview(); | |
case ModelPackage.COMMENT: return createComment(); | |
case ModelPackage.ITEM: return createItem(); | |
case ModelPackage.USER: return createUser(); | |
case ModelPackage.TASK_REFERENCE: return createTaskReference(); | |
case ModelPackage.REVIEW_GROUP: return createReviewGroup(); | |
case ModelPackage.TOPIC: return createTopic(); | |
case ModelPackage.REVIEW_COMPONENT: return createReviewComponent(); | |
case ModelPackage.SUB_MODEL_ROOT: return createSubModelRoot(); | |
default: | |
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); | |
} | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public Review createReview() { | |
ReviewImpl review = new ReviewImpl(); | |
return review; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public Comment createComment() { | |
CommentImpl comment = new CommentImpl(); | |
return comment; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public Item createItem() { | |
ItemImpl item = new ItemImpl(); | |
return item; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public User createUser() { | |
UserImpl user = new UserImpl(); | |
return user; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public TaskReference createTaskReference() { | |
TaskReferenceImpl taskReference = new TaskReferenceImpl(); | |
return taskReference; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public ReviewGroup createReviewGroup() { | |
ReviewGroupImpl reviewGroup = new ReviewGroupImpl(); | |
return reviewGroup; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public Topic createTopic() { | |
TopicImpl topic = new TopicImpl(); | |
return topic; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public ReviewComponent createReviewComponent() { | |
ReviewComponentImpl reviewComponent = new ReviewComponentImpl(); | |
return reviewComponent; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public SubModelRoot createSubModelRoot() { | |
SubModelRootImpl subModelRoot = new SubModelRootImpl(); | |
return subModelRoot; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public ModelPackage getModelPackage() { | |
return (ModelPackage)getEPackage(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @deprecated | |
* @generated | |
*/ | |
@Deprecated | |
public static ModelPackage getPackage() { | |
return ModelPackage.eINSTANCE; | |
} | |
} //ModelFactoryImpl |