View Javadoc

1   /**
2    * (c) Mod4j and contributors
3    *
4    * $Id$
5    */
6   package org.mod4j.crossx.mm.crossx.impl;
7   
8   import org.eclipse.emf.ecore.EAttribute;
9   import org.eclipse.emf.ecore.EClass;
10  import org.eclipse.emf.ecore.EPackage;
11  import org.eclipse.emf.ecore.EReference;
12  
13  import org.eclipse.emf.ecore.impl.EPackageImpl;
14  
15  import org.mod4j.crossx.mm.crossx.CrossxFactory;
16  import org.mod4j.crossx.mm.crossx.CrossxPackage;
17  import org.mod4j.crossx.mm.crossx.LiteralSymbolProperty;
18  import org.mod4j.crossx.mm.crossx.ModelInfo;
19  import org.mod4j.crossx.mm.crossx.ReferenceSymbolProperty;
20  import org.mod4j.crossx.mm.crossx.Symbol;
21  import org.mod4j.crossx.mm.crossx.SymbolProperty;
22  
23  /**
24   * <!-- begin-user-doc -->
25   * An implementation of the model <b>Package</b>.
26   * <!-- end-user-doc -->
27   * @generated
28   */
29  public class CrossxPackageImpl extends EPackageImpl implements CrossxPackage {
30      /**
31       * <!-- begin-user-doc -->
32       * <!-- end-user-doc -->
33       * @generated
34       */
35      private EClass modelInfoEClass = null;
36  
37      /**
38       * <!-- begin-user-doc -->
39       * <!-- end-user-doc -->
40       * @generated
41       */
42      private EClass symbolEClass = null;
43  
44      /**
45       * <!-- begin-user-doc -->
46       * <!-- end-user-doc -->
47       * @generated
48       */
49      private EClass symbolPropertyEClass = null;
50  
51      /**
52       * <!-- begin-user-doc -->
53       * <!-- end-user-doc -->
54       * @generated
55       */
56      private EClass literalSymbolPropertyEClass = null;
57  
58      /**
59       * <!-- begin-user-doc -->
60       * <!-- end-user-doc -->
61       * @generated
62       */
63      private EClass referenceSymbolPropertyEClass = null;
64  
65      /**
66       * Creates an instance of the model <b>Package</b>, registered with
67       * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
68       * package URI value.
69       * <p>Note: the correct way to create the package is via the static
70       * factory method {@link #init init()}, which also performs
71       * initialization of the package, or returns the registered package,
72       * if one already exists.
73       * <!-- begin-user-doc -->
74       * <!-- end-user-doc -->
75       * @see org.eclipse.emf.ecore.EPackage.Registry
76       * @see org.mod4j.crossx.mm.crossx.CrossxPackage#eNS_URI
77       * @see #init()
78       * @generated
79       */
80      private CrossxPackageImpl() {
81          super(eNS_URI, CrossxFactory.eINSTANCE);
82      }
83  
84      /**
85       * <!-- begin-user-doc -->
86       * <!-- end-user-doc -->
87       * @generated
88       */
89      private static boolean isInited = false;
90  
91      /**
92       * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
93       * 
94       * <p>This method is used to initialize {@link CrossxPackage#eINSTANCE} when that field is accessed.
95       * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
96       * <!-- begin-user-doc -->
97       * <!-- end-user-doc -->
98       * @see #eNS_URI
99       * @see #createPackageContents()
100      * @see #initializePackageContents()
101      * @generated
102      */
103     public static CrossxPackage init() {
104         if (isInited) return (CrossxPackage)EPackage.Registry.INSTANCE.getEPackage(CrossxPackage.eNS_URI);
105 
106         // Obtain or create and register package
107         CrossxPackageImpl theCrossxPackage = (CrossxPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof CrossxPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new CrossxPackageImpl());
108 
109         isInited = true;
110 
111         // Create package meta-data objects
112         theCrossxPackage.createPackageContents();
113 
114         // Initialize created meta-data
115         theCrossxPackage.initializePackageContents();
116 
117         // Mark meta-data to indicate it can't be changed
118         theCrossxPackage.freeze();
119 
120   
121         // Update the registry and return the package
122         EPackage.Registry.INSTANCE.put(CrossxPackage.eNS_URI, theCrossxPackage);
123         return theCrossxPackage;
124     }
125 
126     /**
127      * <!-- begin-user-doc -->
128      * <!-- end-user-doc -->
129      * @generated
130      */
131     public EClass getModelInfo() {
132         return modelInfoEClass;
133     }
134 
135     /**
136      * <!-- begin-user-doc -->
137      * <!-- end-user-doc -->
138      * @generated
139      */
140     public EReference getModelInfo_Symbols() {
141         return (EReference)modelInfoEClass.getEStructuralFeatures().get(0);
142     }
143 
144     /**
145      * <!-- begin-user-doc -->
146      * <!-- end-user-doc -->
147      * @generated
148      */
149     public EAttribute getModelInfo_LastChanged() {
150         return (EAttribute)modelInfoEClass.getEStructuralFeatures().get(1);
151     }
152 
153     /**
154      * <!-- begin-user-doc -->
155      * <!-- end-user-doc -->
156      * @generated
157      */
158     public EAttribute getModelInfo_Modelname() {
159         return (EAttribute)modelInfoEClass.getEStructuralFeatures().get(2);
160     }
161 
162     /**
163      * <!-- begin-user-doc -->
164      * <!-- end-user-doc -->
165      * @generated
166      */
167     public EAttribute getModelInfo_Resource() {
168         return (EAttribute)modelInfoEClass.getEStructuralFeatures().get(3);
169     }
170 
171     /**
172      * <!-- begin-user-doc -->
173      * <!-- end-user-doc -->
174      * @generated
175      */
176     public EAttribute getModelInfo_Dslname() {
177         return (EAttribute)modelInfoEClass.getEStructuralFeatures().get(4);
178     }
179 
180     /**
181      * <!-- begin-user-doc -->
182      * <!-- end-user-doc -->
183      * @generated
184      */
185     public EClass getSymbol() {
186         return symbolEClass;
187     }
188 
189     /**
190      * <!-- begin-user-doc -->
191      * <!-- end-user-doc -->
192      * @generated
193      */
194     public EAttribute getSymbol_Name() {
195         return (EAttribute)symbolEClass.getEStructuralFeatures().get(0);
196     }
197 
198     /**
199      * <!-- begin-user-doc -->
200      * <!-- end-user-doc -->
201      * @generated
202      */
203     public EAttribute getSymbol_Type() {
204         return (EAttribute)symbolEClass.getEStructuralFeatures().get(1);
205     }
206 
207     /**
208      * <!-- begin-user-doc -->
209      * <!-- end-user-doc -->
210      * @generated
211      */
212     public EReference getSymbol_Properties() {
213         return (EReference)symbolEClass.getEStructuralFeatures().get(2);
214     }
215 
216     /**
217      * <!-- begin-user-doc -->
218      * <!-- end-user-doc -->
219      * @generated
220      */
221     public EReference getSymbol_SubSymbols() {
222         return (EReference)symbolEClass.getEStructuralFeatures().get(3);
223     }
224 
225     /**
226      * <!-- begin-user-doc -->
227      * <!-- end-user-doc -->
228      * @generated
229      */
230     public EReference getSymbol_Owner() {
231         return (EReference)symbolEClass.getEStructuralFeatures().get(4);
232     }
233 
234     /**
235      * <!-- begin-user-doc -->
236      * <!-- end-user-doc -->
237      * @generated
238      */
239     public EReference getSymbol_Parent() {
240         return (EReference)symbolEClass.getEStructuralFeatures().get(5);
241     }
242 
243     /**
244      * <!-- begin-user-doc -->
245      * <!-- end-user-doc -->
246      * @generated
247      */
248     public EClass getSymbolProperty() {
249         return symbolPropertyEClass;
250     }
251 
252     /**
253      * <!-- begin-user-doc -->
254      * <!-- end-user-doc -->
255      * @generated
256      */
257     public EAttribute getSymbolProperty_Name() {
258         return (EAttribute)symbolPropertyEClass.getEStructuralFeatures().get(0);
259     }
260 
261     /**
262      * <!-- begin-user-doc -->
263      * <!-- end-user-doc -->
264      * @generated
265      */
266     public EReference getSymbolProperty_SubProperties() {
267         return (EReference)symbolPropertyEClass.getEStructuralFeatures().get(1);
268     }
269 
270     /**
271      * <!-- begin-user-doc -->
272      * <!-- end-user-doc -->
273      * @generated
274      */
275     public EClass getLiteralSymbolProperty() {
276         return literalSymbolPropertyEClass;
277     }
278 
279     /**
280      * <!-- begin-user-doc -->
281      * <!-- end-user-doc -->
282      * @generated
283      */
284     public EAttribute getLiteralSymbolProperty_Value() {
285         return (EAttribute)literalSymbolPropertyEClass.getEStructuralFeatures().get(0);
286     }
287 
288     /**
289      * <!-- begin-user-doc -->
290      * <!-- end-user-doc -->
291      * @generated
292      */
293     public EClass getReferenceSymbolProperty() {
294         return referenceSymbolPropertyEClass;
295     }
296 
297     /**
298      * <!-- begin-user-doc -->
299      * <!-- end-user-doc -->
300      * @generated
301      */
302     public EAttribute getReferenceSymbolProperty_Type() {
303         return (EAttribute)referenceSymbolPropertyEClass.getEStructuralFeatures().get(0);
304     }
305 
306     /**
307      * <!-- begin-user-doc -->
308      * <!-- end-user-doc -->
309      * @generated
310      */
311     public EAttribute getReferenceSymbolProperty_Modelname() {
312         return (EAttribute)referenceSymbolPropertyEClass.getEStructuralFeatures().get(1);
313     }
314 
315     /**
316      * <!-- begin-user-doc -->
317      * <!-- end-user-doc -->
318      * @generated
319      */
320     public EAttribute getReferenceSymbolProperty_Symbolname() {
321         return (EAttribute)referenceSymbolPropertyEClass.getEStructuralFeatures().get(2);
322     }
323 
324     /**
325      * <!-- begin-user-doc -->
326      * <!-- end-user-doc -->
327      * @generated
328      */
329     public CrossxFactory getCrossxFactory() {
330         return (CrossxFactory)getEFactoryInstance();
331     }
332 
333     /**
334      * <!-- begin-user-doc -->
335      * <!-- end-user-doc -->
336      * @generated
337      */
338     private boolean isCreated = false;
339 
340     /**
341      * Creates the meta-model objects for the package.  This method is
342      * guarded to have no affect on any invocation but its first.
343      * <!-- begin-user-doc -->
344      * <!-- end-user-doc -->
345      * @generated
346      */
347     public void createPackageContents() {
348         if (isCreated) return;
349         isCreated = true;
350 
351         // Create classes and their features
352         modelInfoEClass = createEClass(MODEL_INFO);
353         createEReference(modelInfoEClass, MODEL_INFO__SYMBOLS);
354         createEAttribute(modelInfoEClass, MODEL_INFO__LAST_CHANGED);
355         createEAttribute(modelInfoEClass, MODEL_INFO__MODELNAME);
356         createEAttribute(modelInfoEClass, MODEL_INFO__RESOURCE);
357         createEAttribute(modelInfoEClass, MODEL_INFO__DSLNAME);
358 
359         symbolEClass = createEClass(SYMBOL);
360         createEAttribute(symbolEClass, SYMBOL__NAME);
361         createEAttribute(symbolEClass, SYMBOL__TYPE);
362         createEReference(symbolEClass, SYMBOL__PROPERTIES);
363         createEReference(symbolEClass, SYMBOL__SUB_SYMBOLS);
364         createEReference(symbolEClass, SYMBOL__OWNER);
365         createEReference(symbolEClass, SYMBOL__PARENT);
366 
367         symbolPropertyEClass = createEClass(SYMBOL_PROPERTY);
368         createEAttribute(symbolPropertyEClass, SYMBOL_PROPERTY__NAME);
369         createEReference(symbolPropertyEClass, SYMBOL_PROPERTY__SUB_PROPERTIES);
370 
371         literalSymbolPropertyEClass = createEClass(LITERAL_SYMBOL_PROPERTY);
372         createEAttribute(literalSymbolPropertyEClass, LITERAL_SYMBOL_PROPERTY__VALUE);
373 
374         referenceSymbolPropertyEClass = createEClass(REFERENCE_SYMBOL_PROPERTY);
375         createEAttribute(referenceSymbolPropertyEClass, REFERENCE_SYMBOL_PROPERTY__TYPE);
376         createEAttribute(referenceSymbolPropertyEClass, REFERENCE_SYMBOL_PROPERTY__MODELNAME);
377         createEAttribute(referenceSymbolPropertyEClass, REFERENCE_SYMBOL_PROPERTY__SYMBOLNAME);
378     }
379 
380     /**
381      * <!-- begin-user-doc -->
382      * <!-- end-user-doc -->
383      * @generated
384      */
385     private boolean isInitialized = false;
386 
387     /**
388      * Complete the initialization of the package and its meta-model.  This
389      * method is guarded to have no affect on any invocation but its first.
390      * <!-- begin-user-doc -->
391      * <!-- end-user-doc -->
392      * @generated
393      */
394     public void initializePackageContents() {
395         if (isInitialized) return;
396         isInitialized = true;
397 
398         // Initialize package
399         setName(eNAME);
400         setNsPrefix(eNS_PREFIX);
401         setNsURI(eNS_URI);
402 
403         // Create type parameters
404 
405         // Set bounds for type parameters
406 
407         // Add supertypes to classes
408         literalSymbolPropertyEClass.getESuperTypes().add(this.getSymbolProperty());
409         referenceSymbolPropertyEClass.getESuperTypes().add(this.getSymbolProperty());
410 
411         // Initialize classes and features; add operations and parameters
412         initEClass(modelInfoEClass, ModelInfo.class, "ModelInfo", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
413         initEReference(getModelInfo_Symbols(), this.getSymbol(), this.getSymbol_Owner(), "symbols", null, 0, -1, ModelInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
414         initEAttribute(getModelInfo_LastChanged(), ecorePackage.getEString(), "lastChanged", "", 0, 1, ModelInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
415         initEAttribute(getModelInfo_Modelname(), ecorePackage.getEString(), "modelname", null, 0, 1, ModelInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
416         initEAttribute(getModelInfo_Resource(), ecorePackage.getEString(), "resource", "[unknown]", 0, 1, ModelInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
417         initEAttribute(getModelInfo_Dslname(), ecorePackage.getEString(), "dslname", null, 0, 1, ModelInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
418 
419         initEClass(symbolEClass, Symbol.class, "Symbol", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
420         initEAttribute(getSymbol_Name(), ecorePackage.getEString(), "name", null, 0, 1, Symbol.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
421         initEAttribute(getSymbol_Type(), ecorePackage.getEString(), "type", null, 0, 1, Symbol.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
422         initEReference(getSymbol_Properties(), this.getSymbolProperty(), null, "properties", null, 0, -1, Symbol.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
423         initEReference(getSymbol_SubSymbols(), this.getSymbol(), this.getSymbol_Parent(), "subSymbols", null, 0, -1, Symbol.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
424         initEReference(getSymbol_Owner(), this.getModelInfo(), this.getModelInfo_Symbols(), "owner", null, 0, 1, Symbol.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
425         initEReference(getSymbol_Parent(), this.getSymbol(), this.getSymbol_SubSymbols(), "parent", null, 0, 1, Symbol.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
426 
427         initEClass(symbolPropertyEClass, SymbolProperty.class, "SymbolProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
428         initEAttribute(getSymbolProperty_Name(), ecorePackage.getEString(), "name", null, 0, 1, SymbolProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
429         initEReference(getSymbolProperty_SubProperties(), this.getSymbolProperty(), null, "subProperties", null, 0, -1, SymbolProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
430 
431         initEClass(literalSymbolPropertyEClass, LiteralSymbolProperty.class, "LiteralSymbolProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
432         initEAttribute(getLiteralSymbolProperty_Value(), ecorePackage.getEString(), "value", null, 0, 1, LiteralSymbolProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
433 
434         initEClass(referenceSymbolPropertyEClass, ReferenceSymbolProperty.class, "ReferenceSymbolProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
435         initEAttribute(getReferenceSymbolProperty_Type(), ecorePackage.getEString(), "type", null, 0, 1, ReferenceSymbolProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
436         initEAttribute(getReferenceSymbolProperty_Modelname(), ecorePackage.getEString(), "modelname", null, 0, 1, ReferenceSymbolProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
437         initEAttribute(getReferenceSymbolProperty_Symbolname(), ecorePackage.getEString(), "symbolname", null, 0, 1, ReferenceSymbolProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
438 
439         // Create resource
440         createResource(eNS_URI);
441     }
442 
443 } //CrossxPackageImpl