1 | /** |
2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.pcm.allocation.impl; |
7 | |
8 | import de.uka.ipd.sdq.pcm.allocation.*; |
9 | import org.eclipse.emf.ecore.EClass; |
10 | import org.eclipse.emf.ecore.EObject; |
11 | import org.eclipse.emf.ecore.EPackage; |
12 | import org.eclipse.emf.ecore.impl.EFactoryImpl; |
13 | import org.eclipse.emf.ecore.plugin.EcorePlugin; |
14 | |
15 | import de.uka.ipd.sdq.pcm.allocation.Allocation; |
16 | import de.uka.ipd.sdq.pcm.allocation.AllocationContext; |
17 | import de.uka.ipd.sdq.pcm.allocation.AllocationFactory; |
18 | import de.uka.ipd.sdq.pcm.allocation.AllocationPackage; |
19 | |
20 | /** |
21 | * <!-- begin-user-doc --> |
22 | * An implementation of the model <b>Factory</b>. |
23 | * <!-- end-user-doc --> |
24 | * @generated |
25 | */ |
26 | public class AllocationFactoryImpl extends EFactoryImpl implements AllocationFactory { |
27 | /** |
28 | * <!-- begin-user-doc --> |
29 | * <!-- end-user-doc --> |
30 | * @generated |
31 | */ |
32 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
33 | |
34 | /** |
35 | * Creates the default factory implementation. |
36 | * <!-- begin-user-doc --> |
37 | * <!-- end-user-doc --> |
38 | * @generated |
39 | */ |
40 | public static AllocationFactory init() { |
41 | try { |
42 | AllocationFactory theAllocationFactory = (AllocationFactory)EPackage.Registry.INSTANCE.getEFactory("http://sdq.ipd.uka.de/PalladioComponentModel/Allocation/4.0"); |
43 | if (theAllocationFactory != null) { |
44 | return theAllocationFactory; |
45 | } |
46 | } |
47 | catch (Exception exception) { |
48 | EcorePlugin.INSTANCE.log(exception); |
49 | } |
50 | return new AllocationFactoryImpl(); |
51 | } |
52 | |
53 | /** |
54 | * Creates an instance of the factory. |
55 | * <!-- begin-user-doc --> |
56 | * <!-- end-user-doc --> |
57 | * @generated |
58 | */ |
59 | public AllocationFactoryImpl() { |
60 | super(); |
61 | } |
62 | |
63 | /** |
64 | * <!-- begin-user-doc --> |
65 | * <!-- end-user-doc --> |
66 | * @generated |
67 | */ |
68 | @Override |
69 | public EObject create(EClass eClass) { |
70 | switch (eClass.getClassifierID()) { |
71 | case AllocationPackage.ALLOCATION_CONTEXT: return createAllocationContext(); |
72 | case AllocationPackage.ALLOCATION: return createAllocation(); |
73 | default: |
74 | throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); |
75 | } |
76 | } |
77 | |
78 | /** |
79 | * <!-- begin-user-doc --> |
80 | * <!-- end-user-doc --> |
81 | * @generated |
82 | */ |
83 | public AllocationContext createAllocationContext() { |
84 | AllocationContextImpl allocationContext = new AllocationContextImpl(); |
85 | return allocationContext; |
86 | } |
87 | |
88 | /** |
89 | * <!-- begin-user-doc --> |
90 | * <!-- end-user-doc --> |
91 | * @generated |
92 | */ |
93 | public Allocation createAllocation() { |
94 | AllocationImpl allocation = new AllocationImpl(); |
95 | return allocation; |
96 | } |
97 | |
98 | /** |
99 | * <!-- begin-user-doc --> |
100 | * <!-- end-user-doc --> |
101 | * @generated |
102 | */ |
103 | public AllocationPackage getAllocationPackage() { |
104 | return (AllocationPackage)getEPackage(); |
105 | } |
106 | |
107 | /** |
108 | * <!-- begin-user-doc --> |
109 | * <!-- end-user-doc --> |
110 | * @deprecated |
111 | * @generated |
112 | */ |
113 | @Deprecated |
114 | public static AllocationPackage getPackage() { |
115 | return AllocationPackage.eINSTANCE; |
116 | } |
117 | |
118 | } //AllocationFactoryImpl |