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.EAttribute; |
18 | import org.eclipse.emf.ecore.EClass; |
19 | import org.eclipse.emf.ecore.EPackage; |
20 | import org.eclipse.emf.ecore.EReference; |
21 | |
22 | import org.eclipse.emf.ecore.impl.EPackageImpl; |
23 | |
24 | /** |
25 | * <!-- begin-user-doc --> |
26 | * An implementation of the model <b>Package</b>. |
27 | * <!-- end-user-doc --> |
28 | * @generated |
29 | */ |
30 | public class CopyExceptionPackageImpl extends EPackageImpl implements CopyExceptionPackage { |
31 | /** |
32 | * <!-- begin-user-doc --> |
33 | * <!-- end-user-doc --> |
34 | * @generated |
35 | */ |
36 | private EClass modelEClass = null; |
37 | |
38 | /** |
39 | * <!-- begin-user-doc --> |
40 | * <!-- end-user-doc --> |
41 | * @generated |
42 | */ |
43 | private EClass importEClass = null; |
44 | |
45 | /** |
46 | * <!-- begin-user-doc --> |
47 | * <!-- end-user-doc --> |
48 | * @generated |
49 | */ |
50 | private EClass exceptionEClass = null; |
51 | |
52 | /** |
53 | * <!-- begin-user-doc --> |
54 | * <!-- end-user-doc --> |
55 | * @generated |
56 | */ |
57 | private EClass deletionExceptionEClass = null; |
58 | |
59 | /** |
60 | * <!-- begin-user-doc --> |
61 | * <!-- end-user-doc --> |
62 | * @generated |
63 | */ |
64 | private EClass replacementExceptionEClass = null; |
65 | |
66 | /** |
67 | * <!-- begin-user-doc --> |
68 | * <!-- end-user-doc --> |
69 | * @generated |
70 | */ |
71 | private EClass referenceExceptionEClass = null; |
72 | |
73 | /** |
74 | * Creates an instance of the model <b>Package</b>, registered with |
75 | * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package |
76 | * package URI value. |
77 | * <p>Note: the correct way to create the package is via the static |
78 | * factory method {@link #init init()}, which also performs |
79 | * initialization of the package, or returns the registered package, |
80 | * if one already exists. |
81 | * <!-- begin-user-doc --> |
82 | * <!-- end-user-doc --> |
83 | * @see org.eclipse.emf.ecore.EPackage.Registry |
84 | * @see copyException.CopyExceptionPackage#eNS_URI |
85 | * @see #init() |
86 | * @generated |
87 | */ |
88 | private CopyExceptionPackageImpl() { |
89 | super(eNS_URI, CopyExceptionFactory.eINSTANCE); |
90 | } |
91 | |
92 | /** |
93 | * <!-- begin-user-doc --> |
94 | * <!-- end-user-doc --> |
95 | * @generated |
96 | */ |
97 | private static boolean isInited = false; |
98 | |
99 | /** |
100 | * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. |
101 | * |
102 | * <p>This method is used to initialize {@link CopyExceptionPackage#eINSTANCE} when that field is accessed. |
103 | * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. |
104 | * <!-- begin-user-doc --> |
105 | * <!-- end-user-doc --> |
106 | * @see #eNS_URI |
107 | * @see #createPackageContents() |
108 | * @see #initializePackageContents() |
109 | * @generated |
110 | */ |
111 | public static CopyExceptionPackage init() { |
112 | if (isInited) return (CopyExceptionPackage)EPackage.Registry.INSTANCE.getEPackage(CopyExceptionPackage.eNS_URI); |
113 | |
114 | // Obtain or create and register package |
115 | CopyExceptionPackageImpl theCopyExceptionPackage = (CopyExceptionPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof CopyExceptionPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new CopyExceptionPackageImpl()); |
116 | |
117 | isInited = true; |
118 | |
119 | // Create package meta-data objects |
120 | theCopyExceptionPackage.createPackageContents(); |
121 | |
122 | // Initialize created meta-data |
123 | theCopyExceptionPackage.initializePackageContents(); |
124 | |
125 | // Mark meta-data to indicate it can't be changed |
126 | theCopyExceptionPackage.freeze(); |
127 | |
128 | |
129 | // Update the registry and return the package |
130 | EPackage.Registry.INSTANCE.put(CopyExceptionPackage.eNS_URI, theCopyExceptionPackage); |
131 | return theCopyExceptionPackage; |
132 | } |
133 | |
134 | /** |
135 | * <!-- begin-user-doc --> |
136 | * <!-- end-user-doc --> |
137 | * @generated |
138 | */ |
139 | public EClass getModel() { |
140 | return modelEClass; |
141 | } |
142 | |
143 | /** |
144 | * <!-- begin-user-doc --> |
145 | * <!-- end-user-doc --> |
146 | * @generated |
147 | */ |
148 | public EReference getModel_Imports() { |
149 | return (EReference)modelEClass.getEStructuralFeatures().get(0); |
150 | } |
151 | |
152 | /** |
153 | * <!-- begin-user-doc --> |
154 | * <!-- end-user-doc --> |
155 | * @generated |
156 | */ |
157 | public EReference getModel_Exceptions() { |
158 | return (EReference)modelEClass.getEStructuralFeatures().get(1); |
159 | } |
160 | |
161 | /** |
162 | * <!-- begin-user-doc --> |
163 | * <!-- end-user-doc --> |
164 | * @generated |
165 | */ |
166 | public EClass getImport() { |
167 | return importEClass; |
168 | } |
169 | |
170 | /** |
171 | * <!-- begin-user-doc --> |
172 | * <!-- end-user-doc --> |
173 | * @generated |
174 | */ |
175 | public EAttribute getImport_ImportURI() { |
176 | return (EAttribute)importEClass.getEStructuralFeatures().get(0); |
177 | } |
178 | |
179 | /** |
180 | * <!-- begin-user-doc --> |
181 | * <!-- end-user-doc --> |
182 | * @generated |
183 | */ |
184 | public EClass getException() { |
185 | return exceptionEClass; |
186 | } |
187 | |
188 | /** |
189 | * <!-- begin-user-doc --> |
190 | * <!-- end-user-doc --> |
191 | * @generated |
192 | */ |
193 | public EClass getDeletionException() { |
194 | return deletionExceptionEClass; |
195 | } |
196 | |
197 | /** |
198 | * <!-- begin-user-doc --> |
199 | * <!-- end-user-doc --> |
200 | * @generated |
201 | */ |
202 | public EReference getDeletionException_Object() { |
203 | return (EReference)deletionExceptionEClass.getEStructuralFeatures().get(0); |
204 | } |
205 | |
206 | /** |
207 | * <!-- begin-user-doc --> |
208 | * <!-- end-user-doc --> |
209 | * @generated |
210 | */ |
211 | public EAttribute getDeletionException_Ocle() { |
212 | return (EAttribute)deletionExceptionEClass.getEStructuralFeatures().get(1); |
213 | } |
214 | |
215 | /** |
216 | * <!-- begin-user-doc --> |
217 | * <!-- end-user-doc --> |
218 | * @generated |
219 | */ |
220 | public EClass getReplacementException() { |
221 | return replacementExceptionEClass; |
222 | } |
223 | |
224 | /** |
225 | * <!-- begin-user-doc --> |
226 | * <!-- end-user-doc --> |
227 | * @generated |
228 | */ |
229 | public EReference getReplacementException_Obj() { |
230 | return (EReference)replacementExceptionEClass.getEStructuralFeatures().get(0); |
231 | } |
232 | |
233 | /** |
234 | * <!-- begin-user-doc --> |
235 | * <!-- end-user-doc --> |
236 | * @generated |
237 | */ |
238 | public EClass getReferenceException() { |
239 | return referenceExceptionEClass; |
240 | } |
241 | |
242 | /** |
243 | * <!-- begin-user-doc --> |
244 | * <!-- end-user-doc --> |
245 | * @generated |
246 | */ |
247 | public EReference getReferenceException_O() { |
248 | return (EReference)referenceExceptionEClass.getEStructuralFeatures().get(0); |
249 | } |
250 | |
251 | /** |
252 | * <!-- begin-user-doc --> |
253 | * <!-- end-user-doc --> |
254 | * @generated |
255 | */ |
256 | public CopyExceptionFactory getCopyExceptionFactory() { |
257 | return (CopyExceptionFactory)getEFactoryInstance(); |
258 | } |
259 | |
260 | /** |
261 | * <!-- begin-user-doc --> |
262 | * <!-- end-user-doc --> |
263 | * @generated |
264 | */ |
265 | private boolean isCreated = false; |
266 | |
267 | /** |
268 | * Creates the meta-model objects for the package. This method is |
269 | * guarded to have no affect on any invocation but its first. |
270 | * <!-- begin-user-doc --> |
271 | * <!-- end-user-doc --> |
272 | * @generated |
273 | */ |
274 | public void createPackageContents() { |
275 | if (isCreated) return; |
276 | isCreated = true; |
277 | |
278 | // Create classes and their features |
279 | modelEClass = createEClass(MODEL); |
280 | createEReference(modelEClass, MODEL__IMPORTS); |
281 | createEReference(modelEClass, MODEL__EXCEPTIONS); |
282 | |
283 | importEClass = createEClass(IMPORT); |
284 | createEAttribute(importEClass, IMPORT__IMPORT_URI); |
285 | |
286 | exceptionEClass = createEClass(EXCEPTION); |
287 | |
288 | deletionExceptionEClass = createEClass(DELETION_EXCEPTION); |
289 | createEReference(deletionExceptionEClass, DELETION_EXCEPTION__OBJECT); |
290 | createEAttribute(deletionExceptionEClass, DELETION_EXCEPTION__OCLE); |
291 | |
292 | replacementExceptionEClass = createEClass(REPLACEMENT_EXCEPTION); |
293 | createEReference(replacementExceptionEClass, REPLACEMENT_EXCEPTION__OBJ); |
294 | |
295 | referenceExceptionEClass = createEClass(REFERENCE_EXCEPTION); |
296 | createEReference(referenceExceptionEClass, REFERENCE_EXCEPTION__O); |
297 | } |
298 | |
299 | /** |
300 | * <!-- begin-user-doc --> |
301 | * <!-- end-user-doc --> |
302 | * @generated |
303 | */ |
304 | private boolean isInitialized = false; |
305 | |
306 | /** |
307 | * Complete the initialization of the package and its meta-model. This |
308 | * method is guarded to have no affect on any invocation but its first. |
309 | * <!-- begin-user-doc --> |
310 | * <!-- end-user-doc --> |
311 | * @generated |
312 | */ |
313 | public void initializePackageContents() { |
314 | if (isInitialized) return; |
315 | isInitialized = true; |
316 | |
317 | // Initialize package |
318 | setName(eNAME); |
319 | setNsPrefix(eNS_PREFIX); |
320 | setNsURI(eNS_URI); |
321 | |
322 | // Create type parameters |
323 | |
324 | // Set bounds for type parameters |
325 | |
326 | // Add supertypes to classes |
327 | deletionExceptionEClass.getESuperTypes().add(this.getException()); |
328 | replacementExceptionEClass.getESuperTypes().add(this.getException()); |
329 | referenceExceptionEClass.getESuperTypes().add(this.getException()); |
330 | |
331 | // Initialize classes and features; add operations and parameters |
332 | initEClass(modelEClass, Model.class, "Model", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
333 | initEReference(getModel_Imports(), this.getImport(), null, "imports", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
334 | initEReference(getModel_Exceptions(), this.getException(), null, "exceptions", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
335 | |
336 | initEClass(importEClass, Import.class, "Import", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
337 | initEAttribute(getImport_ImportURI(), ecorePackage.getEString(), "importURI", null, 0, 1, Import.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
338 | |
339 | initEClass(exceptionEClass, copyException.Exception.class, "Exception", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
340 | |
341 | initEClass(deletionExceptionEClass, DeletionException.class, "DeletionException", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
342 | initEReference(getDeletionException_Object(), ecorePackage.getEClass(), null, "object", null, 0, 1, DeletionException.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
343 | initEAttribute(getDeletionException_Ocle(), ecorePackage.getEString(), "ocle", null, 0, 1, DeletionException.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
344 | |
345 | initEClass(replacementExceptionEClass, ReplacementException.class, "ReplacementException", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
346 | initEReference(getReplacementException_Obj(), ecorePackage.getEClassifier(), null, "obj", null, 0, 1, ReplacementException.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
347 | |
348 | initEClass(referenceExceptionEClass, ReferenceException.class, "ReferenceException", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
349 | initEReference(getReferenceException_O(), ecorePackage.getEPackage(), null, "o", null, 0, 1, ReferenceException.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
350 | |
351 | // Create resource |
352 | createResource(eNS_URI); |
353 | } |
354 | |
355 | } //CopyExceptionPackageImpl |