/**
* Copyright (c) 2012-2016 Marsha Chechik, Alessio Di Sandro, Michalis Famelis,
* Rick Salay.
* 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
*
* Contributors:
* Alessio Di Sandro - Implementation.
*/
package edu.toronto.cs.se.modelepedia.necsis14_classdiagram.impl;
import edu.toronto.cs.se.modelepedia.necsis14_classdiagram.Association;
import edu.toronto.cs.se.modelepedia.necsis14_classdiagram.Attribute;
import edu.toronto.cs.se.modelepedia.necsis14_classdiagram.ClassDiagram;
import edu.toronto.cs.se.modelepedia.necsis14_classdiagram.NECSIS14_ClassDiagramFactory;
import edu.toronto.cs.se.modelepedia.necsis14_classdiagram.NECSIS14_ClassDiagramPackage;
import edu.toronto.cs.se.modelepedia.necsis14_classdiagram.NamedElement;
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.impl.EPackageImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Package</b>.
* <!-- end-user-doc -->
* @generated
*/
public class NECSIS14_ClassDiagramPackageImpl extends EPackageImpl implements NECSIS14_ClassDiagramPackage {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass classDiagramEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass namedElementEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass classEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass associationEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass attributeEClass = 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 edu.toronto.cs.se.modelepedia.necsis14_classdiagram.NECSIS14_ClassDiagramPackage#eNS_URI
* @see #init()
* @generated
*/
private NECSIS14_ClassDiagramPackageImpl() {
super(eNS_URI, NECSIS14_ClassDiagramFactory.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 NECSIS14_ClassDiagramPackage#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 NECSIS14_ClassDiagramPackage init() {
if (isInited) return (NECSIS14_ClassDiagramPackage)EPackage.Registry.INSTANCE.getEPackage(NECSIS14_ClassDiagramPackage.eNS_URI);
// Obtain or create and register package
NECSIS14_ClassDiagramPackageImpl theNECSIS14_ClassDiagramPackage = (NECSIS14_ClassDiagramPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof NECSIS14_ClassDiagramPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new NECSIS14_ClassDiagramPackageImpl());
isInited = true;
// Create package meta-data objects
theNECSIS14_ClassDiagramPackage.createPackageContents();
// Initialize created meta-data
theNECSIS14_ClassDiagramPackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theNECSIS14_ClassDiagramPackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(NECSIS14_ClassDiagramPackage.eNS_URI, theNECSIS14_ClassDiagramPackage);
return theNECSIS14_ClassDiagramPackage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getClassDiagram() {
return classDiagramEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getClassDiagram_Classes() {
return (EReference)classDiagramEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getClassDiagram_Associations() {
return (EReference)classDiagramEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- 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 getClass_() {
return classEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getClass_Parent() {
return (EReference)classEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getClass_Attributes() {
return (EReference)classEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getAssociation() {
return associationEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getAssociation_Source() {
return (EReference)associationEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getAssociation_Target() {
return (EReference)associationEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getAssociation_LowerBound() {
return (EAttribute)associationEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getAssociation_UpperBound() {
return (EAttribute)associationEClass.getEStructuralFeatures().get(3);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getAttribute() {
return attributeEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NECSIS14_ClassDiagramFactory getNECSIS14_ClassDiagramFactory() {
return (NECSIS14_ClassDiagramFactory)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
classDiagramEClass = createEClass(CLASS_DIAGRAM);
createEReference(classDiagramEClass, CLASS_DIAGRAM__CLASSES);
createEReference(classDiagramEClass, CLASS_DIAGRAM__ASSOCIATIONS);
namedElementEClass = createEClass(NAMED_ELEMENT);
createEAttribute(namedElementEClass, NAMED_ELEMENT__NAME);
classEClass = createEClass(CLASS);
createEReference(classEClass, CLASS__PARENT);
createEReference(classEClass, CLASS__ATTRIBUTES);
associationEClass = createEClass(ASSOCIATION);
createEReference(associationEClass, ASSOCIATION__SOURCE);
createEReference(associationEClass, ASSOCIATION__TARGET);
createEAttribute(associationEClass, ASSOCIATION__LOWER_BOUND);
createEAttribute(associationEClass, ASSOCIATION__UPPER_BOUND);
attributeEClass = createEClass(ATTRIBUTE);
}
/**
* <!-- 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);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
classEClass.getESuperTypes().add(this.getNamedElement());
associationEClass.getESuperTypes().add(this.getNamedElement());
attributeEClass.getESuperTypes().add(this.getNamedElement());
// Initialize classes, features, and operations; add parameters
initEClass(classDiagramEClass, ClassDiagram.class, "ClassDiagram", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getClassDiagram_Classes(), this.getClass_(), null, "classes", null, 0, -1, ClassDiagram.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getClassDiagram_Associations(), this.getAssociation(), null, "associations", null, 0, -1, ClassDiagram.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(namedElementEClass, NamedElement.class, "NamedElement", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getNamedElement_Name(), ecorePackage.getEString(), "name", null, 1, 1, NamedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(classEClass, edu.toronto.cs.se.modelepedia.necsis14_classdiagram.Class.class, "Class", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getClass_Parent(), this.getClass_(), null, "parent", null, 0, 1, edu.toronto.cs.se.modelepedia.necsis14_classdiagram.Class.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getClass_Attributes(), this.getAttribute(), null, "attributes", null, 0, -1, edu.toronto.cs.se.modelepedia.necsis14_classdiagram.Class.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(associationEClass, Association.class, "Association", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getAssociation_Source(), this.getClass_(), null, "source", null, 1, 1, Association.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getAssociation_Target(), this.getClass_(), null, "target", null, 1, 1, Association.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getAssociation_LowerBound(), ecorePackage.getEInt(), "lowerBound", null, 1, 1, Association.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getAssociation_UpperBound(), ecorePackage.getEInt(), "upperBound", null, 1, 1, Association.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(attributeEClass, Attribute.class, "Attribute", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
// Create resource
createResource(eNS_URI);
// Create annotations
// gmf.diagram
createGmfAnnotations();
// gmf.node
createGmf_1Annotations();
// gmf.link
createGmf_2Annotations();
// gmf.compartment
createGmf_3Annotations();
}
/**
* Initializes the annotations for <b>gmf.diagram</b>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void createGmfAnnotations() {
String source = "gmf.diagram";
addAnnotation
(classDiagramEClass,
source,
new String[] {
});
}
/**
* Initializes the annotations for <b>gmf.node</b>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void createGmf_1Annotations() {
String source = "gmf.node";
addAnnotation
(classEClass,
source,
new String[] {
"label", "name"
});
addAnnotation
(attributeEClass,
source,
new String[] {
"label", "name"
});
}
/**
* Initializes the annotations for <b>gmf.link</b>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void createGmf_2Annotations() {
String source = "gmf.link";
addAnnotation
(getClass_Parent(),
source,
new String[] {
"target.decoration", "closedarrow"
});
addAnnotation
(associationEClass,
source,
new String[] {
"label", "name",
"label.icon", "true",
"source", "source",
"target", "target",
"target.decoration", "arrow"
});
}
/**
* Initializes the annotations for <b>gmf.compartment</b>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void createGmf_3Annotations() {
String source = "gmf.compartment";
addAnnotation
(getClass_Attributes(),
source,
new String[] {
"layout", "list"
});
}
} //NECSIS14_ClassDiagramPackageImpl