blob: 0503c21ad00d826bacab1bdd15bdbe5183941c63 [file] [log] [blame]
/**
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Based on ideas from Xtext, Xtend, Xcore
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - Initial implementation
*
*/
package org.eclipse.osbp.xtext.topologydsl.impl;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.impl.EPackageImpl;
import org.eclipse.osbp.dsl.semantic.common.types.OSBPTypesPackage;
import org.eclipse.osbp.xtext.datamartdsl.DatamartDSLPackage;
import org.eclipse.osbp.xtext.topologydsl.Topology;
import org.eclipse.osbp.xtext.topologydsl.TopologyBase;
import org.eclipse.osbp.xtext.topologydsl.TopologyDSLFactory;
import org.eclipse.osbp.xtext.topologydsl.TopologyDSLPackage;
import org.eclipse.osbp.xtext.topologydsl.TopologyKind;
import org.eclipse.osbp.xtext.topologydsl.TopologyModel;
import org.eclipse.osbp.xtext.topologydsl.TopologyPackage;
import org.eclipse.osbp.xtext.topologydsl.TopologyProperty;
import org.eclipse.xtext.xbase.annotations.xAnnotations.XAnnotationsPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Package</b>.
* <!-- end-user-doc -->
* @generated
*/
public class TopologyDSLPackageImpl extends EPackageImpl implements TopologyDSLPackage {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass topologyModelEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass topologyBaseEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass topologyPackageEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass topologyEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EEnum topologyKindEEnum = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EEnum topologyPropertyEEnum = null;
/**
* Creates an instance of the model <b>Package</b>, registered with
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
* package URI value.
* <p>Note: the correct way to create the package is via the static
* factory method {@link #init init()}, which also performs
* initialization of the package, or returns the registered package,
* if one already exists.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.emf.ecore.EPackage.Registry
* @see org.eclipse.osbp.xtext.topologydsl.TopologyDSLPackage#eNS_URI
* @see #init()
* @generated
*/
private TopologyDSLPackageImpl() {
super(eNS_URI, TopologyDSLFactory.eINSTANCE);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private static boolean isInited = false;
/**
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
*
* <p>This method is used to initialize {@link TopologyDSLPackage#eINSTANCE} when that field is accessed.
* Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #eNS_URI
* @see #createPackageContents()
* @see #initializePackageContents()
* @generated
*/
public static TopologyDSLPackage init() {
if (isInited) return (TopologyDSLPackage)EPackage.Registry.INSTANCE.getEPackage(TopologyDSLPackage.eNS_URI);
// Obtain or create and register package
TopologyDSLPackageImpl theTopologyDSLPackage = (TopologyDSLPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof TopologyDSLPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new TopologyDSLPackageImpl());
isInited = true;
// Initialize simple dependencies
XAnnotationsPackage.eINSTANCE.eClass();
DatamartDSLPackage.eINSTANCE.eClass();
OSBPTypesPackage.eINSTANCE.eClass();
EcorePackage.eINSTANCE.eClass();
// Create package meta-data objects
theTopologyDSLPackage.createPackageContents();
// Initialize created meta-data
theTopologyDSLPackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theTopologyDSLPackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(TopologyDSLPackage.eNS_URI, theTopologyDSLPackage);
return theTopologyDSLPackage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getTopologyModel() {
return topologyModelEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getTopologyModel_Packages() {
return (EReference)topologyModelEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getTopologyBase() {
return topologyBaseEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getTopologyBase_Name() {
return (EAttribute)topologyBaseEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getTopologyPackage() {
return topologyPackageEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getTopologyPackage_Topologies() {
return (EReference)topologyPackageEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getTopology() {
return topologyEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getTopology_Title() {
return (EAttribute)topologyEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getTopology_TitleValue() {
return (EAttribute)topologyEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getTopology_TopologyKind() {
return (EAttribute)topologyEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getTopology_Property() {
return (EAttribute)topologyEClass.getEStructuralFeatures().get(3);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getTopology_Partition() {
return (EAttribute)topologyEClass.getEStructuralFeatures().get(4);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getTopology_Places() {
return (EAttribute)topologyEClass.getEStructuralFeatures().get(5);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getTopology_Zoomable() {
return (EAttribute)topologyEClass.getEStructuralFeatures().get(6);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getTopology_Datamarts() {
return (EReference)topologyEClass.getEStructuralFeatures().get(7);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EEnum getTopologyKind() {
return topologyKindEEnum;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EEnum getTopologyProperty() {
return topologyPropertyEEnum;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TopologyDSLFactory getTopologyDSLFactory() {
return (TopologyDSLFactory)getEFactoryInstance();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private boolean isCreated = false;
/**
* Creates the meta-model objects for the package. This method is
* guarded to have no affect on any invocation but its first.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void createPackageContents() {
if (isCreated) return;
isCreated = true;
// Create classes and their features
topologyModelEClass = createEClass(TOPOLOGY_MODEL);
createEReference(topologyModelEClass, TOPOLOGY_MODEL__PACKAGES);
topologyBaseEClass = createEClass(TOPOLOGY_BASE);
createEAttribute(topologyBaseEClass, TOPOLOGY_BASE__NAME);
topologyPackageEClass = createEClass(TOPOLOGY_PACKAGE);
createEReference(topologyPackageEClass, TOPOLOGY_PACKAGE__TOPOLOGIES);
topologyEClass = createEClass(TOPOLOGY);
createEAttribute(topologyEClass, TOPOLOGY__TITLE);
createEAttribute(topologyEClass, TOPOLOGY__TITLE_VALUE);
createEAttribute(topologyEClass, TOPOLOGY__TOPOLOGY_KIND);
createEAttribute(topologyEClass, TOPOLOGY__PROPERTY);
createEAttribute(topologyEClass, TOPOLOGY__PARTITION);
createEAttribute(topologyEClass, TOPOLOGY__PLACES);
createEAttribute(topologyEClass, TOPOLOGY__ZOOMABLE);
createEReference(topologyEClass, TOPOLOGY__DATAMARTS);
// Create enums
topologyKindEEnum = createEEnum(TOPOLOGY_KIND);
topologyPropertyEEnum = createEEnum(TOPOLOGY_PROPERTY);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private boolean isInitialized = false;
/**
* Complete the initialization of the package and its meta-model. This
* method is guarded to have no affect on any invocation but its first.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void initializePackageContents() {
if (isInitialized) return;
isInitialized = true;
// Initialize package
setName(eNAME);
setNsPrefix(eNS_PREFIX);
setNsURI(eNS_URI);
// Obtain other dependent packages
EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
OSBPTypesPackage theOSBPTypesPackage = (OSBPTypesPackage)EPackage.Registry.INSTANCE.getEPackage(OSBPTypesPackage.eNS_URI);
DatamartDSLPackage theDatamartDSLPackage = (DatamartDSLPackage)EPackage.Registry.INSTANCE.getEPackage(DatamartDSLPackage.eNS_URI);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
topologyPackageEClass.getESuperTypes().add(theOSBPTypesPackage.getLPackage());
topologyEClass.getESuperTypes().add(this.getTopologyBase());
// Initialize classes, features, and operations; add parameters
initEClass(topologyModelEClass, TopologyModel.class, "TopologyModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getTopologyModel_Packages(), this.getTopologyPackage(), null, "packages", null, 0, -1, TopologyModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(topologyBaseEClass, TopologyBase.class, "TopologyBase", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getTopologyBase_Name(), theEcorePackage.getEString(), "name", null, 0, 1, TopologyBase.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(topologyPackageEClass, TopologyPackage.class, "TopologyPackage", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getTopologyPackage_Topologies(), this.getTopology(), null, "topologies", null, 0, -1, TopologyPackage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(topologyEClass, Topology.class, "Topology", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getTopology_Title(), theEcorePackage.getEBoolean(), "title", null, 0, 1, Topology.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getTopology_TitleValue(), theEcorePackage.getEString(), "titleValue", null, 0, 1, Topology.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getTopology_TopologyKind(), this.getTopologyKind(), "topologyKind", null, 0, 1, Topology.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getTopology_Property(), this.getTopologyProperty(), "property", null, 0, 1, Topology.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getTopology_Partition(), theEcorePackage.getEBoolean(), "partition", null, 0, 1, Topology.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getTopology_Places(), theEcorePackage.getEBoolean(), "places", null, 0, 1, Topology.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getTopology_Zoomable(), theEcorePackage.getEBoolean(), "zoomable", null, 0, 1, Topology.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getTopology_Datamarts(), theDatamartDSLPackage.getEventBrokerDataMart(), null, "datamarts", null, 0, -1, Topology.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
// Initialize enums and add enum literals
initEEnum(topologyKindEEnum, TopologyKind.class, "TopologyKind");
addEEnumLiteral(topologyKindEEnum, TopologyKind.WORLD);
addEEnumLiteral(topologyKindEEnum, TopologyKind.USA);
addEEnumLiteral(topologyKindEEnum, TopologyKind.DEU);
addEEnumLiteral(topologyKindEEnum, TopologyKind.ESP);
initEEnum(topologyPropertyEEnum, TopologyProperty.class, "TopologyProperty");
addEEnumLiteral(topologyPropertyEEnum, TopologyProperty.NAME);
addEEnumLiteral(topologyPropertyEEnum, TopologyProperty.STATE);
addEEnumLiteral(topologyPropertyEEnum, TopologyProperty.ISO);
addEEnumLiteral(topologyPropertyEEnum, TopologyProperty.ID);
// Create resource
createResource(eNS_URI);
// Create annotations
// http://www.eclipse.org/emf/2002/Ecore
createEcoreAnnotations();
}
/**
* Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore</b>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void createEcoreAnnotations() {
String source = "http://www.eclipse.org/emf/2002/Ecore";
addAnnotation
(this,
source,
new String[] {
"rootPackage", "topologydsl"
});
}
} //TopologyDSLPackageImpl