blob: 7e6652e4fbec7f1171790bf14b268cf181f328f2 [file] [log] [blame]
/**
* generated by Xtext 2.22.0
*/
package org.eclipse.papyrus.robotics.xtext.datatypes.dTML.impl;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
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.papyrus.robotics.xtext.datatypes.dTML.Assignment;
import org.eclipse.papyrus.robotics.xtext.datatypes.dTML.DTMLFactory;
import org.eclipse.papyrus.robotics.xtext.datatypes.dTML.DTMLPackage;
import org.eclipse.papyrus.robotics.xtext.datatypes.dTML.DTModel;
import org.eclipse.papyrus.robotics.xtext.datatypes.dTML.Model;
import org.eclipse.papyrus.robotics.xtext.datatypes.dTML.Property;
import org.eclipse.papyrus.robotics.xtext.datatypes.dTML.Value;
import org.eclipse.papyrus.uml.textedit.common.xtext.umlCommon.UmlCommonPackage;
import org.eclipse.uml2.types.TypesPackage;
import org.eclipse.uml2.uml.UMLPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Package</b>.
* <!-- end-user-doc -->
* @generated
*/
public class DTMLPackageImpl extends EPackageImpl implements DTMLPackage
{
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass modelEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass dtModelEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass propertyEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass assignmentEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass valueEClass = 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.papyrus.robotics.xtext.datatypes.dTML.DTMLPackage#eNS_URI
* @see #init()
* @generated
*/
private DTMLPackageImpl()
{
super(eNS_URI, DTMLFactory.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 DTMLPackage#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 DTMLPackage init()
{
if (isInited) return (DTMLPackage)EPackage.Registry.INSTANCE.getEPackage(DTMLPackage.eNS_URI);
// Obtain or create and register package
Object registeredDTMLPackage = EPackage.Registry.INSTANCE.get(eNS_URI);
DTMLPackageImpl theDTMLPackage = registeredDTMLPackage instanceof DTMLPackageImpl ? (DTMLPackageImpl)registeredDTMLPackage : new DTMLPackageImpl();
isInited = true;
// Initialize simple dependencies
EcorePackage.eINSTANCE.eClass();
UmlCommonPackage.eINSTANCE.eClass();
UMLPackage.eINSTANCE.eClass();
TypesPackage.eINSTANCE.eClass();
// Create package meta-data objects
theDTMLPackage.createPackageContents();
// Initialize created meta-data
theDTMLPackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theDTMLPackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(DTMLPackage.eNS_URI, theDTMLPackage);
return theDTMLPackage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EClass getModel()
{
return modelEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EAttribute getModel_Name()
{
return (EAttribute)modelEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EClass getDTModel()
{
return dtModelEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EReference getDTModel_Attributes()
{
return (EReference)dtModelEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EClass getProperty()
{
return propertyEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EAttribute getProperty_Name()
{
return (EAttribute)propertyEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EReference getProperty_Type()
{
return (EReference)propertyEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EAttribute getProperty_TypeUndefined()
{
return (EAttribute)propertyEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EReference getProperty_Multiplicity()
{
return (EReference)propertyEClass.getEStructuralFeatures().get(3);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EReference getProperty_Value()
{
return (EReference)propertyEClass.getEStructuralFeatures().get(4);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EAttribute getProperty_Comment()
{
return (EAttribute)propertyEClass.getEStructuralFeatures().get(5);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EClass getAssignment()
{
return assignmentEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EAttribute getAssignment_Expression()
{
return (EAttribute)assignmentEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EClass getValue()
{
return valueEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EAttribute getValue_Str()
{
return (EAttribute)valueEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EAttribute getValue_Ival()
{
return (EAttribute)valueEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EAttribute getValue_Dval()
{
return (EAttribute)valueEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public DTMLFactory getDTMLFactory()
{
return (DTMLFactory)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
modelEClass = createEClass(MODEL);
createEAttribute(modelEClass, MODEL__NAME);
dtModelEClass = createEClass(DT_MODEL);
createEReference(dtModelEClass, DT_MODEL__ATTRIBUTES);
propertyEClass = createEClass(PROPERTY);
createEAttribute(propertyEClass, PROPERTY__NAME);
createEReference(propertyEClass, PROPERTY__TYPE);
createEAttribute(propertyEClass, PROPERTY__TYPE_UNDEFINED);
createEReference(propertyEClass, PROPERTY__MULTIPLICITY);
createEReference(propertyEClass, PROPERTY__VALUE);
createEAttribute(propertyEClass, PROPERTY__COMMENT);
assignmentEClass = createEClass(ASSIGNMENT);
createEAttribute(assignmentEClass, ASSIGNMENT__EXPRESSION);
valueEClass = createEClass(VALUE);
createEAttribute(valueEClass, VALUE__STR);
createEAttribute(valueEClass, VALUE__IVAL);
createEAttribute(valueEClass, VALUE__DVAL);
}
/**
* <!-- 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);
UmlCommonPackage theUmlCommonPackage = (UmlCommonPackage)EPackage.Registry.INSTANCE.getEPackage(UmlCommonPackage.eNS_URI);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
dtModelEClass.getESuperTypes().add(this.getModel());
assignmentEClass.getESuperTypes().add(this.getModel());
// Initialize classes and features; add operations and parameters
initEClass(modelEClass, Model.class, "Model", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getModel_Name(), theEcorePackage.getEString(), "name", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(dtModelEClass, DTModel.class, "DTModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getDTModel_Attributes(), this.getProperty(), null, "attributes", null, 0, -1, DTModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(propertyEClass, Property.class, "Property", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getProperty_Name(), theEcorePackage.getEString(), "name", null, 0, 1, Property.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getProperty_Type(), theUmlCommonPackage.getTypeRule(), null, "type", null, 0, 1, Property.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getProperty_TypeUndefined(), theEcorePackage.getEBoolean(), "typeUndefined", null, 0, 1, Property.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getProperty_Multiplicity(), theUmlCommonPackage.getMultiplicityRule(), null, "multiplicity", null, 0, 1, Property.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getProperty_Value(), this.getValue(), null, "value", null, 0, 1, Property.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getProperty_Comment(), theEcorePackage.getEString(), "comment", null, 0, 1, Property.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(assignmentEClass, Assignment.class, "Assignment", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getAssignment_Expression(), theEcorePackage.getEString(), "expression", null, 0, 1, Assignment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(valueEClass, Value.class, "Value", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getValue_Str(), theEcorePackage.getEString(), "str", null, 0, 1, Value.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getValue_Ival(), theEcorePackage.getEInt(), "ival", null, 0, 1, Value.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getValue_Dval(), theEcorePackage.getEDouble(), "dval", null, 0, 1, Value.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
// Create resource
createResource(eNS_URI);
}
} //DTMLPackageImpl