| /** |
| */ |
| package org.xtext.example.mydsl.myDsl.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.xtext.example.mydsl.myDsl.*; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model <b>Factory</b>. |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public class MyDslFactoryImpl extends EFactoryImpl implements MyDslFactory |
| { |
| /** |
| * Creates the default factory implementation. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static MyDslFactory init() |
| { |
| try |
| { |
| MyDslFactory theMyDslFactory = (MyDslFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.xtext.org/example/mydsl/MyDsl"); |
| if (theMyDslFactory != null) |
| { |
| return theMyDslFactory; |
| } |
| } |
| catch (Exception exception) |
| { |
| EcorePlugin.INSTANCE.log(exception); |
| } |
| return new MyDslFactoryImpl(); |
| } |
| |
| /** |
| * Creates an instance of the factory. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public MyDslFactoryImpl() |
| { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EObject create(EClass eClass) |
| { |
| switch (eClass.getClassifierID()) |
| { |
| case MyDslPackage.MODEL: return createModel(); |
| case MyDslPackage.GREETING: return createGreeting(); |
| default: |
| throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Model createModel() |
| { |
| ModelImpl model = new ModelImpl(); |
| return model; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Greeting createGreeting() |
| { |
| GreetingImpl greeting = new GreetingImpl(); |
| return greeting; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public MyDslPackage getMyDslPackage() |
| { |
| return (MyDslPackage)getEPackage(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @deprecated |
| * @generated |
| */ |
| @Deprecated |
| public static MyDslPackage getPackage() |
| { |
| return MyDslPackage.eINSTANCE; |
| } |
| |
| } //MyDslFactoryImpl |