3 package org.opendaylight.nemo.tool.eclipse.plugin.editor.impl;
5 import org.eclipse.emf.ecore.EAttribute;
6 import org.eclipse.emf.ecore.EClass;
7 import org.eclipse.emf.ecore.EPackage;
8 import org.eclipse.emf.ecore.EReference;
10 import org.eclipse.emf.ecore.impl.EPackageImpl;
12 import org.opendaylight.nemo.tool.eclipse.plugin.editor.Connection;
13 import org.opendaylight.nemo.tool.eclipse.plugin.editor.ConnectionUpdate;
14 import org.opendaylight.nemo.tool.eclipse.plugin.editor.EditorFactory;
15 import org.opendaylight.nemo.tool.eclipse.plugin.editor.EditorPackage;
16 import org.opendaylight.nemo.tool.eclipse.plugin.editor.Flow;
17 import org.opendaylight.nemo.tool.eclipse.plugin.editor.FlowUpdate;
18 import org.opendaylight.nemo.tool.eclipse.plugin.editor.Model;
19 import org.opendaylight.nemo.tool.eclipse.plugin.editor.Node;
20 import org.opendaylight.nemo.tool.eclipse.plugin.editor.NodeModel;
21 import org.opendaylight.nemo.tool.eclipse.plugin.editor.NodeOperating;
22 import org.opendaylight.nemo.tool.eclipse.plugin.editor.Operation;
23 import org.opendaylight.nemo.tool.eclipse.plugin.editor.Sentence;
26 * <!-- begin-user-doc -->
27 * An implementation of the model <b>Package</b>.
28 * <!-- end-user-doc -->
31 public class EditorPackageImpl extends EPackageImpl implements EditorPackage
34 * <!-- begin-user-doc -->
35 * <!-- end-user-doc -->
38 private EClass modelEClass = null;
41 * <!-- begin-user-doc -->
42 * <!-- end-user-doc -->
45 private EClass sentenceEClass = null;
48 * <!-- begin-user-doc -->
49 * <!-- end-user-doc -->
52 private EClass nodeEClass = null;
55 * <!-- begin-user-doc -->
56 * <!-- end-user-doc -->
59 private EClass nodeModelEClass = null;
62 * <!-- begin-user-doc -->
63 * <!-- end-user-doc -->
66 private EClass nodeOperatingEClass = null;
69 * <!-- begin-user-doc -->
70 * <!-- end-user-doc -->
73 private EClass connectionEClass = null;
76 * <!-- begin-user-doc -->
77 * <!-- end-user-doc -->
80 private EClass connectionUpdateEClass = null;
83 * <!-- begin-user-doc -->
84 * <!-- end-user-doc -->
87 private EClass flowEClass = null;
90 * <!-- begin-user-doc -->
91 * <!-- end-user-doc -->
94 private EClass flowUpdateEClass = null;
97 * <!-- begin-user-doc -->
98 * <!-- end-user-doc -->
101 private EClass operationEClass = null;
104 * Creates an instance of the model <b>Package</b>, registered with
105 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
107 * <p>Note: the correct way to create the package is via the static
108 * factory method {@link #init init()}, which also performs
109 * initialization of the package, or returns the registered package,
110 * if one already exists.
111 * <!-- begin-user-doc -->
112 * <!-- end-user-doc -->
113 * @see org.eclipse.emf.ecore.EPackage.Registry
114 * @see org.opendaylight.nemo.tool.eclipse.plugin.editor.EditorPackage#eNS_URI
118 private EditorPackageImpl()
120 super(eNS_URI, EditorFactory.eINSTANCE);
124 * <!-- begin-user-doc -->
125 * <!-- end-user-doc -->
128 private static boolean isInited = false;
131 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
133 * <p>This method is used to initialize {@link EditorPackage#eINSTANCE} when that field is accessed.
134 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
135 * <!-- begin-user-doc -->
136 * <!-- end-user-doc -->
138 * @see #createPackageContents()
139 * @see #initializePackageContents()
142 public static EditorPackage init()
144 if (isInited) return (EditorPackage)EPackage.Registry.INSTANCE.getEPackage(EditorPackage.eNS_URI);
146 // Obtain or create and register package
147 EditorPackageImpl theEditorPackage = (EditorPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof EditorPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new EditorPackageImpl());
151 // Create package meta-data objects
152 theEditorPackage.createPackageContents();
154 // Initialize created meta-data
155 theEditorPackage.initializePackageContents();
157 // Mark meta-data to indicate it can't be changed
158 theEditorPackage.freeze();
161 // Update the registry and return the package
162 EPackage.Registry.INSTANCE.put(EditorPackage.eNS_URI, theEditorPackage);
163 return theEditorPackage;
167 * <!-- begin-user-doc -->
168 * <!-- end-user-doc -->
171 public EClass getModel()
177 * <!-- begin-user-doc -->
178 * <!-- end-user-doc -->
181 public EReference getModel_Sentences()
183 return (EReference)modelEClass.getEStructuralFeatures().get(0);
187 * <!-- begin-user-doc -->
188 * <!-- end-user-doc -->
191 public EClass getSentence()
193 return sentenceEClass;
197 * <!-- begin-user-doc -->
198 * <!-- end-user-doc -->
201 public EClass getNode()
207 * <!-- begin-user-doc -->
208 * <!-- end-user-doc -->
211 public EAttribute getNode_Name()
213 return (EAttribute)nodeEClass.getEStructuralFeatures().get(0);
217 * <!-- begin-user-doc -->
218 * <!-- end-user-doc -->
221 public EReference getNode_Nodes()
223 return (EReference)nodeEClass.getEStructuralFeatures().get(1);
227 * <!-- begin-user-doc -->
228 * <!-- end-user-doc -->
231 public EClass getNodeModel()
233 return nodeModelEClass;
237 * <!-- begin-user-doc -->
238 * <!-- end-user-doc -->
241 public EAttribute getNodeModel_Name()
243 return (EAttribute)nodeModelEClass.getEStructuralFeatures().get(0);
247 * <!-- begin-user-doc -->
248 * <!-- end-user-doc -->
251 public EClass getNodeOperating()
253 return nodeOperatingEClass;
257 * <!-- begin-user-doc -->
258 * <!-- end-user-doc -->
261 public EReference getNodeOperating_Nodename()
263 return (EReference)nodeOperatingEClass.getEStructuralFeatures().get(0);
267 * <!-- begin-user-doc -->
268 * <!-- end-user-doc -->
271 public EReference getNodeOperating_Nodes()
273 return (EReference)nodeOperatingEClass.getEStructuralFeatures().get(1);
277 * <!-- begin-user-doc -->
278 * <!-- end-user-doc -->
281 public EClass getConnection()
283 return connectionEClass;
287 * <!-- begin-user-doc -->
288 * <!-- end-user-doc -->
291 public EAttribute getConnection_Name()
293 return (EAttribute)connectionEClass.getEStructuralFeatures().get(0);
297 * <!-- begin-user-doc -->
298 * <!-- end-user-doc -->
301 public EReference getConnection_Endnode()
303 return (EReference)connectionEClass.getEStructuralFeatures().get(1);
307 * <!-- begin-user-doc -->
308 * <!-- end-user-doc -->
311 public EClass getConnectionUpdate()
313 return connectionUpdateEClass;
317 * <!-- begin-user-doc -->
318 * <!-- end-user-doc -->
321 public EReference getConnectionUpdate_Connectionname()
323 return (EReference)connectionUpdateEClass.getEStructuralFeatures().get(0);
327 * <!-- begin-user-doc -->
328 * <!-- end-user-doc -->
331 public EReference getConnectionUpdate_Endnode()
333 return (EReference)connectionUpdateEClass.getEStructuralFeatures().get(1);
337 * <!-- begin-user-doc -->
338 * <!-- end-user-doc -->
341 public EClass getFlow()
347 * <!-- begin-user-doc -->
348 * <!-- end-user-doc -->
351 public EAttribute getFlow_Name()
353 return (EAttribute)flowEClass.getEStructuralFeatures().get(0);
357 * <!-- begin-user-doc -->
358 * <!-- end-user-doc -->
361 public EClass getFlowUpdate()
363 return flowUpdateEClass;
367 * <!-- begin-user-doc -->
368 * <!-- end-user-doc -->
371 public EReference getFlowUpdate_FlowId()
373 return (EReference)flowUpdateEClass.getEStructuralFeatures().get(0);
377 * <!-- begin-user-doc -->
378 * <!-- end-user-doc -->
381 public EClass getOperation()
383 return operationEClass;
387 * <!-- begin-user-doc -->
388 * <!-- end-user-doc -->
391 public EAttribute getOperation_Name()
393 return (EAttribute)operationEClass.getEStructuralFeatures().get(0);
397 * <!-- begin-user-doc -->
398 * <!-- end-user-doc -->
401 public EAttribute getOperation_Value()
403 return (EAttribute)operationEClass.getEStructuralFeatures().get(1);
407 * <!-- begin-user-doc -->
408 * <!-- end-user-doc -->
411 public EReference getOperation_TargetId()
413 return (EReference)operationEClass.getEStructuralFeatures().get(2);
417 * <!-- begin-user-doc -->
418 * <!-- end-user-doc -->
421 public EReference getOperation_TargetNode()
423 return (EReference)operationEClass.getEStructuralFeatures().get(3);
427 * <!-- begin-user-doc -->
428 * <!-- end-user-doc -->
431 public EditorFactory getEditorFactory()
433 return (EditorFactory)getEFactoryInstance();
437 * <!-- begin-user-doc -->
438 * <!-- end-user-doc -->
441 private boolean isCreated = false;
444 * Creates the meta-model objects for the package. This method is
445 * guarded to have no affect on any invocation but its first.
446 * <!-- begin-user-doc -->
447 * <!-- end-user-doc -->
450 public void createPackageContents()
452 if (isCreated) return;
455 // Create classes and their features
456 modelEClass = createEClass(MODEL);
457 createEReference(modelEClass, MODEL__SENTENCES);
459 sentenceEClass = createEClass(SENTENCE);
461 nodeEClass = createEClass(NODE);
462 createEAttribute(nodeEClass, NODE__NAME);
463 createEReference(nodeEClass, NODE__NODES);
465 nodeModelEClass = createEClass(NODE_MODEL);
466 createEAttribute(nodeModelEClass, NODE_MODEL__NAME);
468 nodeOperatingEClass = createEClass(NODE_OPERATING);
469 createEReference(nodeOperatingEClass, NODE_OPERATING__NODENAME);
470 createEReference(nodeOperatingEClass, NODE_OPERATING__NODES);
472 connectionEClass = createEClass(CONNECTION);
473 createEAttribute(connectionEClass, CONNECTION__NAME);
474 createEReference(connectionEClass, CONNECTION__ENDNODE);
476 connectionUpdateEClass = createEClass(CONNECTION_UPDATE);
477 createEReference(connectionUpdateEClass, CONNECTION_UPDATE__CONNECTIONNAME);
478 createEReference(connectionUpdateEClass, CONNECTION_UPDATE__ENDNODE);
480 flowEClass = createEClass(FLOW);
481 createEAttribute(flowEClass, FLOW__NAME);
483 flowUpdateEClass = createEClass(FLOW_UPDATE);
484 createEReference(flowUpdateEClass, FLOW_UPDATE__FLOW_ID);
486 operationEClass = createEClass(OPERATION);
487 createEAttribute(operationEClass, OPERATION__NAME);
488 createEAttribute(operationEClass, OPERATION__VALUE);
489 createEReference(operationEClass, OPERATION__TARGET_ID);
490 createEReference(operationEClass, OPERATION__TARGET_NODE);
494 * <!-- begin-user-doc -->
495 * <!-- end-user-doc -->
498 private boolean isInitialized = false;
501 * Complete the initialization of the package and its meta-model. This
502 * method is guarded to have no affect on any invocation but its first.
503 * <!-- begin-user-doc -->
504 * <!-- end-user-doc -->
507 public void initializePackageContents()
509 if (isInitialized) return;
510 isInitialized = true;
512 // Initialize package
514 setNsPrefix(eNS_PREFIX);
517 // Create type parameters
519 // Set bounds for type parameters
521 // Add supertypes to classes
522 nodeEClass.getESuperTypes().add(this.getSentence());
523 nodeOperatingEClass.getESuperTypes().add(this.getSentence());
524 connectionEClass.getESuperTypes().add(this.getSentence());
525 connectionUpdateEClass.getESuperTypes().add(this.getSentence());
526 flowEClass.getESuperTypes().add(this.getSentence());
527 flowUpdateEClass.getESuperTypes().add(this.getSentence());
528 operationEClass.getESuperTypes().add(this.getSentence());
530 // Initialize classes and features; add operations and parameters
531 initEClass(modelEClass, Model.class, "Model", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
532 initEReference(getModel_Sentences(), this.getSentence(), null, "sentences", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
534 initEClass(sentenceEClass, Sentence.class, "Sentence", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
536 initEClass(nodeEClass, Node.class, "Node", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
537 initEAttribute(getNode_Name(), ecorePackage.getEString(), "name", null, 0, 1, Node.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
538 initEReference(getNode_Nodes(), this.getNode(), null, "nodes", null, 0, -1, Node.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
540 initEClass(nodeModelEClass, NodeModel.class, "NodeModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
541 initEAttribute(getNodeModel_Name(), ecorePackage.getEString(), "name", null, 0, 1, NodeModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
543 initEClass(nodeOperatingEClass, NodeOperating.class, "NodeOperating", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
544 initEReference(getNodeOperating_Nodename(), this.getNode(), null, "nodename", null, 0, -1, NodeOperating.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
545 initEReference(getNodeOperating_Nodes(), this.getNode(), null, "nodes", null, 0, -1, NodeOperating.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
547 initEClass(connectionEClass, Connection.class, "Connection", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
548 initEAttribute(getConnection_Name(), ecorePackage.getEString(), "name", null, 0, 1, Connection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
549 initEReference(getConnection_Endnode(), this.getNode(), null, "endnode", null, 0, -1, Connection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
551 initEClass(connectionUpdateEClass, ConnectionUpdate.class, "ConnectionUpdate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
552 initEReference(getConnectionUpdate_Connectionname(), this.getConnection(), null, "connectionname", null, 0, -1, ConnectionUpdate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
553 initEReference(getConnectionUpdate_Endnode(), this.getNode(), null, "endnode", null, 0, -1, ConnectionUpdate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
555 initEClass(flowEClass, Flow.class, "Flow", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
556 initEAttribute(getFlow_Name(), ecorePackage.getEString(), "name", null, 0, 1, Flow.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
558 initEClass(flowUpdateEClass, FlowUpdate.class, "FlowUpdate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
559 initEReference(getFlowUpdate_FlowId(), this.getFlow(), null, "flowId", null, 0, -1, FlowUpdate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
561 initEClass(operationEClass, Operation.class, "Operation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
562 initEAttribute(getOperation_Name(), ecorePackage.getEString(), "name", null, 0, 1, Operation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
563 initEAttribute(getOperation_Value(), ecorePackage.getEInt(), "value", null, 0, -1, Operation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
564 initEReference(getOperation_TargetId(), this.getFlow(), null, "targetId", null, 0, 1, Operation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
565 initEReference(getOperation_TargetNode(), this.getNode(), null, "targetNode", null, 0, 1, Operation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
568 createResource(eNS_URI);
571 } //EditorPackageImpl