/**
*/
package org.framed.orm.model.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.impl.EPackageImpl;
import org.framed.orm.geometry.GeometryPackage;
import org.framed.orm.geometry.impl.GeometryPackageImpl;
import org.framed.orm.model.Model;
import org.framed.orm.model.ModelElement;
import org.framed.orm.model.NamedElement;
import org.framed.orm.model.OrmFactory;
import org.framed.orm.model.OrmPackage;
import org.framed.orm.model.Relation;
import org.framed.orm.model.Segment;
import org.framed.orm.model.Shape;
import org.framed.orm.model.Type;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Package</b>.
* <!-- end-user-doc -->
* @generated
*/
public class OrmPackageImpl extends EPackageImpl implements OrmPackage {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass namedElementEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass modelElementEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass modelEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass relationEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass shapeEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass segmentEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EEnum typeEEnum = 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.framed.orm.model.OrmPackage#eNS_URI
* @see #init()
* @generated
*/
private OrmPackageImpl() {
super(eNS_URI, OrmFactory.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 OrmPackage#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 OrmPackage init() {
if (isInited)
return (OrmPackage) EPackage.Registry.INSTANCE
.getEPackage(OrmPackage.eNS_URI);
// Obtain or create and register package
OrmPackageImpl theOrmPackage = (OrmPackageImpl) (EPackage.Registry.INSTANCE
.get(eNS_URI) instanceof OrmPackageImpl ? EPackage.Registry.INSTANCE
.get(eNS_URI) : new OrmPackageImpl());
isInited = true;
// Obtain or create and register interdependencies
GeometryPackageImpl theGeometryPackage = (GeometryPackageImpl) (EPackage.Registry.INSTANCE
.getEPackage(GeometryPackage.eNS_URI) instanceof GeometryPackageImpl ? EPackage.Registry.INSTANCE
.getEPackage(GeometryPackage.eNS_URI)
: GeometryPackage.eINSTANCE);
// Create package meta-data objects
theOrmPackage.createPackageContents();
theGeometryPackage.createPackageContents();
// Initialize created meta-data
theOrmPackage.initializePackageContents();
theGeometryPackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theOrmPackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(OrmPackage.eNS_URI, theOrmPackage);
return theOrmPackage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getNamedElement() {
return namedElementEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getNamedElement_Name() {
return (EAttribute) namedElementEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getModelElement() {
return modelElementEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getModelElement_Container() {
return (EReference) modelElementEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getModelElement_IncomingRelations() {
return (EReference) modelElementEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getModelElement_OutgoingRelations() {
return (EReference) modelElementEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getModelElement_Type() {
return (EAttribute) modelElementEClass.getEStructuralFeatures().get(3);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getModel() {
return modelEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getModel_Elements() {
return (EReference) modelEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getModel_Parent() {
return (EReference) modelEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getRelation() {
return relationEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getRelation_Target() {
return (EReference) relationEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getRelation_Source() {
return (EReference) relationEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getRelation_Bendpoints() {
return (EReference) relationEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getRelation_SourceLabel() {
return (EReference) relationEClass.getEStructuralFeatures().get(3);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getRelation_TargetLabel() {
return (EReference) relationEClass.getEStructuralFeatures().get(4);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getRelation_ReferencedRelation() {
return (EReference) relationEClass.getEStructuralFeatures().get(5);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getRelation_ReferencedRoles() {
return (EReference) relationEClass.getEStructuralFeatures().get(6);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getRelation_ConnectionAnchor() {
return (EReference) relationEClass.getEStructuralFeatures().get(7);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getShape() {
return shapeEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getShape_FirstSegment() {
return (EReference) shapeEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getShape_SecondSegment() {
return (EReference) shapeEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getShape_Model() {
return (EReference) shapeEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getShape_Description() {
return (EReference) shapeEClass.getEStructuralFeatures().get(3);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getShape_Boundaries() {
return (EReference) shapeEClass.getEStructuralFeatures().get(4);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getSegment() {
return segmentEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getSegment_Elements() {
return (EReference) segmentEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EEnum getType() {
return typeEEnum;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public OrmFactory getOrmFactory() {
return (OrmFactory) 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
namedElementEClass = createEClass(NAMED_ELEMENT);
createEAttribute(namedElementEClass, NAMED_ELEMENT__NAME);
modelElementEClass = createEClass(MODEL_ELEMENT);
createEReference(modelElementEClass, MODEL_ELEMENT__CONTAINER);
createEReference(modelElementEClass, MODEL_ELEMENT__INCOMING_RELATIONS);
createEReference(modelElementEClass, MODEL_ELEMENT__OUTGOING_RELATIONS);
createEAttribute(modelElementEClass, MODEL_ELEMENT__TYPE);
modelEClass = createEClass(MODEL);
createEReference(modelEClass, MODEL__ELEMENTS);
createEReference(modelEClass, MODEL__PARENT);
relationEClass = createEClass(RELATION);
createEReference(relationEClass, RELATION__TARGET);
createEReference(relationEClass, RELATION__SOURCE);
createEReference(relationEClass, RELATION__BENDPOINTS);
createEReference(relationEClass, RELATION__SOURCE_LABEL);
createEReference(relationEClass, RELATION__TARGET_LABEL);
createEReference(relationEClass, RELATION__REFERENCED_RELATION);
createEReference(relationEClass, RELATION__REFERENCED_ROLES);
createEReference(relationEClass, RELATION__CONNECTION_ANCHOR);
shapeEClass = createEClass(SHAPE);
createEReference(shapeEClass, SHAPE__FIRST_SEGMENT);
createEReference(shapeEClass, SHAPE__SECOND_SEGMENT);
createEReference(shapeEClass, SHAPE__MODEL);
createEReference(shapeEClass, SHAPE__DESCRIPTION);
createEReference(shapeEClass, SHAPE__BOUNDARIES);
segmentEClass = createEClass(SEGMENT);
createEReference(segmentEClass, SEGMENT__ELEMENTS);
// Create enums
typeEEnum = createEEnum(TYPE);
}
/**
* <!-- 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
GeometryPackage theGeometryPackage = (GeometryPackage) EPackage.Registry.INSTANCE
.getEPackage(GeometryPackage.eNS_URI);
// Add subpackages
getESubpackages().add(theGeometryPackage);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
modelElementEClass.getESuperTypes().add(this.getNamedElement());
relationEClass.getESuperTypes().add(this.getModelElement());
shapeEClass.getESuperTypes().add(this.getModelElement());
// Initialize classes, features, and operations; add parameters
initEClass(namedElementEClass, NamedElement.class, "NamedElement",
!IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getNamedElement_Name(), ecorePackage.getEString(),
"name", null, 0, 1, NamedElement.class, !IS_TRANSIENT,
!IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEClass(modelElementEClass, ModelElement.class, "ModelElement",
!IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getModelElement_Container(), this.getModel(),
this.getModel_Elements(), "container", null, 1, 1,
ModelElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
!IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEReference(getModelElement_IncomingRelations(), this.getRelation(),
this.getRelation_Target(), "incomingRelations", null, 0, -1,
ModelElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
!IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEReference(getModelElement_OutgoingRelations(), this.getRelation(),
this.getRelation_Source(), "outgoingRelations", null, 0, -1,
ModelElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
!IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEAttribute(getModelElement_Type(), this.getType(), "type", null, 1,
1, ModelElement.class, !IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
IS_ORDERED);
initEClass(modelEClass, Model.class, "Model", !IS_ABSTRACT,
!IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getModel_Elements(), this.getModelElement(),
this.getModelElement_Container(), "elements", null, 0, -1,
Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEReference(getModel_Parent(), this.getShape(),
this.getShape_Model(), "parent", null, 0, 1, Model.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE,
!IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED,
IS_ORDERED);
initEClass(relationEClass, Relation.class, "Relation", !IS_ABSTRACT,
!IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getRelation_Target(), this.getModelElement(),
this.getModelElement_IncomingRelations(), "target", null, 0, 1,
Relation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
!IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEReference(getRelation_Source(), this.getModelElement(),
this.getModelElement_OutgoingRelations(), "source", null, 0, 1,
Relation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
!IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEReference(getRelation_Bendpoints(),
theGeometryPackage.getRelativePoint(), null, "bendpoints",
null, 0, -1, Relation.class, !IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getRelation_SourceLabel(), this.getNamedElement(), null,
"sourceLabel", null, 0, 1, Relation.class, !IS_TRANSIENT,
!IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getRelation_TargetLabel(), this.getNamedElement(), null,
"targetLabel", null, 0, 1, Relation.class, !IS_TRANSIENT,
!IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getRelation_ReferencedRelation(), this.getRelation(),
null, "referencedRelation", null, 0, -1, Relation.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE,
IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED,
IS_ORDERED);
initEReference(getRelation_ReferencedRoles(), this.getShape(), null,
"referencedRoles", null, 0, -1, Relation.class, !IS_TRANSIENT,
!IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getRelation_ConnectionAnchor(), this.getShape(), null,
"connectionAnchor", null, 0, 1, Relation.class, !IS_TRANSIENT,
!IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(shapeEClass, Shape.class, "Shape", !IS_ABSTRACT,
!IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getShape_FirstSegment(), this.getSegment(), null,
"firstSegment", null, 0, 1, Shape.class, !IS_TRANSIENT,
!IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getShape_SecondSegment(), this.getSegment(), null,
"secondSegment", null, 0, 1, Shape.class, !IS_TRANSIENT,
!IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getShape_Model(), this.getModel(),
this.getModel_Parent(), "model", null, 0, 1, Shape.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE,
!IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED,
IS_ORDERED);
initEReference(getShape_Description(), this.getNamedElement(), null,
"description", null, 0, 1, Shape.class, !IS_TRANSIENT,
!IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getShape_Boundaries(),
theGeometryPackage.getRectangle(), null, "boundaries", null, 0,
1, Shape.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEClass(segmentEClass, Segment.class, "Segment", !IS_ABSTRACT,
!IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getSegment_Elements(), this.getNamedElement(), null,
"elements", null, 0, -1, Segment.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(typeEEnum, Type.class, "Type");
addEEnumLiteral(typeEEnum, Type.COMPARTMENT_TYPE);
addEEnumLiteral(typeEEnum, Type.NATURAL_TYPE);
addEEnumLiteral(typeEEnum, Type.ROLE_TYPE);
addEEnumLiteral(typeEEnum, Type.DATA_TYPE);
addEEnumLiteral(typeEEnum, Type.ROLE_IMPLICATION);
addEEnumLiteral(typeEEnum, Type.ROLE_EQUIVALENCE);
addEEnumLiteral(typeEEnum, Type.INHERITANCE);
addEEnumLiteral(typeEEnum, Type.RELATIONSHIP);
addEEnumLiteral(typeEEnum, Type.TOTAL);
addEEnumLiteral(typeEEnum, Type.CYCLIC);
addEEnumLiteral(typeEEnum, Type.IRREFLEXIVE);
addEEnumLiteral(typeEEnum, Type.ROLE_PROHIBITION);
addEEnumLiteral(typeEEnum, Type.ROLE_GROUP);
addEEnumLiteral(typeEEnum, Type.GROUP);
addEEnumLiteral(typeEEnum, Type.FULFILLMENT);
addEEnumLiteral(typeEEnum, Type.RELATIONSHIP_IMPLICATION);
addEEnumLiteral(typeEEnum, Type.RELATIONSHIP_SHAPE_CHILD);
addEEnumLiteral(typeEEnum, Type.ACYCLIC);
addEEnumLiteral(typeEEnum, Type.REFLEXIVE);
addEEnumLiteral(typeEEnum, Type.RELATIONSHIP_EXCLUSION);
// Create resource
createResource(eNS_URI);
}
} //OrmPackageImpl