1 | /** |
2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.pcm.core.entity.impl; |
7 | |
8 | import de.uka.ipd.sdq.pcm.core.entity.*; |
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.core.entity.EntityFactory; |
16 | import de.uka.ipd.sdq.pcm.core.entity.EntityPackage; |
17 | import de.uka.ipd.sdq.pcm.core.entity.ResourceInterfaceProvidingEntity; |
18 | import de.uka.ipd.sdq.pcm.core.entity.ResourceInterfaceProvidingRequiringEntity; |
19 | import de.uka.ipd.sdq.pcm.core.entity.ResourceInterfaceRequiringEntity; |
20 | import de.uka.ipd.sdq.pcm.core.entity.ResourceProvidedRole; |
21 | import de.uka.ipd.sdq.pcm.core.entity.ResourceRequiredRole; |
22 | |
23 | /** |
24 | * <!-- begin-user-doc --> |
25 | * An implementation of the model <b>Factory</b>. |
26 | * <!-- end-user-doc --> |
27 | * @generated |
28 | */ |
29 | public class EntityFactoryImpl extends EFactoryImpl implements EntityFactory { |
30 | /** |
31 | * <!-- begin-user-doc --> |
32 | * <!-- end-user-doc --> |
33 | * @generated |
34 | */ |
35 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
36 | |
37 | /** |
38 | * Creates the default factory implementation. |
39 | * <!-- begin-user-doc --> |
40 | * <!-- end-user-doc --> |
41 | * @generated |
42 | */ |
43 | public static EntityFactory init() { |
44 | try { |
45 | EntityFactory theEntityFactory = (EntityFactory)EPackage.Registry.INSTANCE.getEFactory("http://sdq.ipd.uka.de/PalladioComponentModel/Core/Entity/4.0"); |
46 | if (theEntityFactory != null) { |
47 | return theEntityFactory; |
48 | } |
49 | } |
50 | catch (Exception exception) { |
51 | EcorePlugin.INSTANCE.log(exception); |
52 | } |
53 | return new EntityFactoryImpl(); |
54 | } |
55 | |
56 | /** |
57 | * Creates an instance of the factory. |
58 | * <!-- begin-user-doc --> |
59 | * <!-- end-user-doc --> |
60 | * @generated |
61 | */ |
62 | public EntityFactoryImpl() { |
63 | super(); |
64 | } |
65 | |
66 | /** |
67 | * <!-- begin-user-doc --> |
68 | * <!-- end-user-doc --> |
69 | * @generated |
70 | */ |
71 | @Override |
72 | public EObject create(EClass eClass) { |
73 | switch (eClass.getClassifierID()) { |
74 | case EntityPackage.RESOURCE_PROVIDED_ROLE: return createResourceProvidedRole(); |
75 | case EntityPackage.RESOURCE_INTERFACE_REQUIRING_ENTITY: return createResourceInterfaceRequiringEntity(); |
76 | case EntityPackage.RESOURCE_REQUIRED_ROLE: return createResourceRequiredRole(); |
77 | case EntityPackage.RESOURCE_INTERFACE_PROVIDING_ENTITY: return createResourceInterfaceProvidingEntity(); |
78 | case EntityPackage.RESOURCE_INTERFACE_PROVIDING_REQUIRING_ENTITY: return createResourceInterfaceProvidingRequiringEntity(); |
79 | default: |
80 | throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); |
81 | } |
82 | } |
83 | |
84 | /** |
85 | * <!-- begin-user-doc --> |
86 | * <!-- end-user-doc --> |
87 | * @generated |
88 | */ |
89 | public ResourceProvidedRole createResourceProvidedRole() { |
90 | ResourceProvidedRoleImpl resourceProvidedRole = new ResourceProvidedRoleImpl(); |
91 | return resourceProvidedRole; |
92 | } |
93 | |
94 | /** |
95 | * <!-- begin-user-doc --> |
96 | * <!-- end-user-doc --> |
97 | * @generated |
98 | */ |
99 | public ResourceInterfaceRequiringEntity createResourceInterfaceRequiringEntity() { |
100 | ResourceInterfaceRequiringEntityImpl resourceInterfaceRequiringEntity = new ResourceInterfaceRequiringEntityImpl(); |
101 | return resourceInterfaceRequiringEntity; |
102 | } |
103 | |
104 | /** |
105 | * <!-- begin-user-doc --> |
106 | * <!-- end-user-doc --> |
107 | * @generated |
108 | */ |
109 | public ResourceRequiredRole createResourceRequiredRole() { |
110 | ResourceRequiredRoleImpl resourceRequiredRole = new ResourceRequiredRoleImpl(); |
111 | return resourceRequiredRole; |
112 | } |
113 | |
114 | /** |
115 | * <!-- begin-user-doc --> |
116 | * <!-- end-user-doc --> |
117 | * @generated |
118 | */ |
119 | public ResourceInterfaceProvidingEntity createResourceInterfaceProvidingEntity() { |
120 | ResourceInterfaceProvidingEntityImpl resourceInterfaceProvidingEntity = new ResourceInterfaceProvidingEntityImpl(); |
121 | return resourceInterfaceProvidingEntity; |
122 | } |
123 | |
124 | /** |
125 | * <!-- begin-user-doc --> |
126 | * <!-- end-user-doc --> |
127 | * @generated |
128 | */ |
129 | public ResourceInterfaceProvidingRequiringEntity createResourceInterfaceProvidingRequiringEntity() { |
130 | ResourceInterfaceProvidingRequiringEntityImpl resourceInterfaceProvidingRequiringEntity = new ResourceInterfaceProvidingRequiringEntityImpl(); |
131 | return resourceInterfaceProvidingRequiringEntity; |
132 | } |
133 | |
134 | /** |
135 | * <!-- begin-user-doc --> |
136 | * <!-- end-user-doc --> |
137 | * @generated |
138 | */ |
139 | public EntityPackage getEntityPackage() { |
140 | return (EntityPackage)getEPackage(); |
141 | } |
142 | |
143 | /** |
144 | * <!-- begin-user-doc --> |
145 | * <!-- end-user-doc --> |
146 | * @deprecated |
147 | * @generated |
148 | */ |
149 | @Deprecated |
150 | public static EntityPackage getPackage() { |
151 | return EntityPackage.eINSTANCE; |
152 | } |
153 | |
154 | } //EntityFactoryImpl |