| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package copyException.impl; |
| 8 | |
| 9 | import copyException.CopyExceptionFactory; |
| 10 | import copyException.CopyExceptionPackage; |
| 11 | import copyException.DeletionException; |
| 12 | import copyException.Import; |
| 13 | import copyException.Model; |
| 14 | import copyException.ReferenceException; |
| 15 | import copyException.ReplacementException; |
| 16 | |
| 17 | import org.eclipse.emf.ecore.EClass; |
| 18 | import org.eclipse.emf.ecore.EObject; |
| 19 | import org.eclipse.emf.ecore.EPackage; |
| 20 | |
| 21 | import org.eclipse.emf.ecore.impl.EFactoryImpl; |
| 22 | |
| 23 | import org.eclipse.emf.ecore.plugin.EcorePlugin; |
| 24 | |
| 25 | /** |
| 26 | * <!-- begin-user-doc --> |
| 27 | * An implementation of the model <b>Factory</b>. |
| 28 | * <!-- end-user-doc --> |
| 29 | * @generated |
| 30 | */ |
| 31 | public class CopyExceptionFactoryImpl extends EFactoryImpl implements CopyExceptionFactory { |
| 32 | /** |
| 33 | * Creates the default factory implementation. |
| 34 | * <!-- begin-user-doc --> |
| 35 | * <!-- end-user-doc --> |
| 36 | * @generated |
| 37 | */ |
| 38 | public static CopyExceptionFactory init() { |
| 39 | try { |
| 40 | CopyExceptionFactory theCopyExceptionFactory = (CopyExceptionFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.xtext.org/example/CopyException"); |
| 41 | if (theCopyExceptionFactory != null) { |
| 42 | return theCopyExceptionFactory; |
| 43 | } |
| 44 | } |
| 45 | catch (Exception exception) { |
| 46 | EcorePlugin.INSTANCE.log(exception); |
| 47 | } |
| 48 | return new CopyExceptionFactoryImpl(); |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * Creates an instance of the factory. |
| 53 | * <!-- begin-user-doc --> |
| 54 | * <!-- end-user-doc --> |
| 55 | * @generated |
| 56 | */ |
| 57 | public CopyExceptionFactoryImpl() { |
| 58 | super(); |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * <!-- begin-user-doc --> |
| 63 | * <!-- end-user-doc --> |
| 64 | * @generated |
| 65 | */ |
| 66 | @Override |
| 67 | public EObject create(EClass eClass) { |
| 68 | switch (eClass.getClassifierID()) { |
| 69 | case CopyExceptionPackage.MODEL: return createModel(); |
| 70 | case CopyExceptionPackage.IMPORT: return createImport(); |
| 71 | case CopyExceptionPackage.DELETION_EXCEPTION: return createDeletionException(); |
| 72 | case CopyExceptionPackage.REPLACEMENT_EXCEPTION: return createReplacementException(); |
| 73 | case CopyExceptionPackage.REFERENCE_EXCEPTION: return createReferenceException(); |
| 74 | default: |
| 75 | throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * <!-- begin-user-doc --> |
| 81 | * <!-- end-user-doc --> |
| 82 | * @generated |
| 83 | */ |
| 84 | public Model createModel() { |
| 85 | ModelImpl model = new ModelImpl(); |
| 86 | return model; |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * <!-- begin-user-doc --> |
| 91 | * <!-- end-user-doc --> |
| 92 | * @generated |
| 93 | */ |
| 94 | public Import createImport() { |
| 95 | ImportImpl import_ = new ImportImpl(); |
| 96 | return import_; |
| 97 | } |
| 98 | |
| 99 | /** |
| 100 | * <!-- begin-user-doc --> |
| 101 | * <!-- end-user-doc --> |
| 102 | * @generated |
| 103 | */ |
| 104 | public DeletionException createDeletionException() { |
| 105 | DeletionExceptionImpl deletionException = new DeletionExceptionImpl(); |
| 106 | return deletionException; |
| 107 | } |
| 108 | |
| 109 | /** |
| 110 | * <!-- begin-user-doc --> |
| 111 | * <!-- end-user-doc --> |
| 112 | * @generated |
| 113 | */ |
| 114 | public ReplacementException createReplacementException() { |
| 115 | ReplacementExceptionImpl replacementException = new ReplacementExceptionImpl(); |
| 116 | return replacementException; |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * <!-- begin-user-doc --> |
| 121 | * <!-- end-user-doc --> |
| 122 | * @generated |
| 123 | */ |
| 124 | public ReferenceException createReferenceException() { |
| 125 | ReferenceExceptionImpl referenceException = new ReferenceExceptionImpl(); |
| 126 | return referenceException; |
| 127 | } |
| 128 | |
| 129 | /** |
| 130 | * <!-- begin-user-doc --> |
| 131 | * <!-- end-user-doc --> |
| 132 | * @generated |
| 133 | */ |
| 134 | public CopyExceptionPackage getCopyExceptionPackage() { |
| 135 | return (CopyExceptionPackage)getEPackage(); |
| 136 | } |
| 137 | |
| 138 | /** |
| 139 | * <!-- begin-user-doc --> |
| 140 | * <!-- end-user-doc --> |
| 141 | * @deprecated |
| 142 | * @generated |
| 143 | */ |
| 144 | @Deprecated |
| 145 | public static CopyExceptionPackage getPackage() { |
| 146 | return CopyExceptionPackage.eINSTANCE; |
| 147 | } |
| 148 | |
| 149 | } //CopyExceptionFactoryImpl |