blob: c825f97f8024aba74a730250b1d669b0e381749e [file] [log] [blame]
/**
* Copyright (c) 2009, 2019 Mia-Software and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* Frederic Madiot (Mia-Software) - meta-model design
* Gregoire DUPE (Mia-Software) - design and implementation
*
*
* $Id$
*/
package org.eclipse.modisco.infra.facet.impl;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EOperation;
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.modisco.infra.facet.Facet;
import org.eclipse.modisco.infra.facet.FacetAttribute;
import org.eclipse.modisco.infra.facet.FacetFactory;
import org.eclipse.modisco.infra.facet.FacetPackage;
import org.eclipse.modisco.infra.facet.FacetReference;
import org.eclipse.modisco.infra.facet.FacetSet;
import org.eclipse.modisco.infra.facet.FacetStructuralFeature;
import org.eclipse.modisco.infra.facet.Shortcut;
import org.eclipse.modisco.infra.query.QueryPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Package</b>.
* <!-- end-user-doc -->
* @generated
* @deprecated Replaced by EMF Facet
*/
@Deprecated
public class FacetPackageImpl extends EPackageImpl implements FacetPackage {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass facetEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass facetAttributeEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass facetReferenceEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass facetStructuralFeatureEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass facetSetEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass shortcutEClass = 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.modisco.infra.facet.FacetPackage#eNS_URI
* @see #init()
* @generated
*/
private FacetPackageImpl() {
super(eNS_URI, FacetFactory.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 FacetPackage#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 FacetPackage init() {
if (isInited) return (FacetPackage)EPackage.Registry.INSTANCE.getEPackage(FacetPackage.eNS_URI);
// Obtain or create and register package
FacetPackageImpl theFacetPackage = (FacetPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof FacetPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new FacetPackageImpl());
isInited = true;
// Initialize simple dependencies
QueryPackage.eINSTANCE.eClass();
// Create package meta-data objects
theFacetPackage.createPackageContents();
// Initialize created meta-data
theFacetPackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theFacetPackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(FacetPackage.eNS_URI, theFacetPackage);
return theFacetPackage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getFacet() {
return facetEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getFacet_ConditionQuery() {
return (EReference)facetEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getFacet_FacetSet() {
return (EReference)facetEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getFacetAttribute() {
return facetAttributeEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getFacetReference() {
return facetReferenceEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getFacetStructuralFeature() {
return facetStructuralFeatureEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getFacetStructuralFeature_ValueQuery() {
return (EReference)facetStructuralFeatureEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getFacetSet() {
return facetSetEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getFacetSet_ExtendedPackage() {
return (EReference)facetSetEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getFacetSet_Facets() {
return (EReference)facetSetEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getShortcut() {
return shortcutEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getShortcut_Path() {
return (EReference)shortcutEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getShortcut_OppositeReference() {
return (EReference)shortcutEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FacetFactory getFacetFactory() {
return (FacetFactory)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
facetEClass = createEClass(FACET);
createEReference(facetEClass, FACET__CONDITION_QUERY);
createEReference(facetEClass, FACET__FACET_SET);
facetAttributeEClass = createEClass(FACET_ATTRIBUTE);
facetReferenceEClass = createEClass(FACET_REFERENCE);
facetStructuralFeatureEClass = createEClass(FACET_STRUCTURAL_FEATURE);
createEReference(facetStructuralFeatureEClass, FACET_STRUCTURAL_FEATURE__VALUE_QUERY);
facetSetEClass = createEClass(FACET_SET);
createEReference(facetSetEClass, FACET_SET__EXTENDED_PACKAGE);
createEReference(facetSetEClass, FACET_SET__FACETS);
shortcutEClass = createEClass(SHORTCUT);
createEReference(shortcutEClass, SHORTCUT__PATH);
createEReference(shortcutEClass, SHORTCUT__OPPOSITE_REFERENCE);
}
/**
* <!-- 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);
QueryPackage theQueryPackage = (QueryPackage)EPackage.Registry.INSTANCE.getEPackage(QueryPackage.eNS_URI);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
facetEClass.getESuperTypes().add(theEcorePackage.getEClass());
facetAttributeEClass.getESuperTypes().add(theEcorePackage.getEAttribute());
facetAttributeEClass.getESuperTypes().add(this.getFacetStructuralFeature());
facetReferenceEClass.getESuperTypes().add(theEcorePackage.getEReference());
facetReferenceEClass.getESuperTypes().add(this.getFacetStructuralFeature());
facetSetEClass.getESuperTypes().add(theEcorePackage.getEPackage());
shortcutEClass.getESuperTypes().add(theEcorePackage.getEReference());
// Initialize classes and features; add operations and parameters
initEClass(facetEClass, Facet.class, "Facet", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getFacet_ConditionQuery(), theQueryPackage.getModelQuery(), null, "conditionQuery", null, 0, 1, Facet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getFacet_FacetSet(), this.getFacetSet(), this.getFacetSet_Facets(), "facetSet", null, 0, 1, Facet.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
initEClass(facetAttributeEClass, FacetAttribute.class, "FacetAttribute", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(facetReferenceEClass, FacetReference.class, "FacetReference", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(facetStructuralFeatureEClass, FacetStructuralFeature.class, "FacetStructuralFeature", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getFacetStructuralFeature_ValueQuery(), theQueryPackage.getModelQuery(), null, "valueQuery", null, 1, 1, FacetStructuralFeature.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(facetSetEClass, FacetSet.class, "FacetSet", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getFacetSet_ExtendedPackage(), theEcorePackage.getEPackage(), null, "extendedPackage", null, 1, 1, FacetSet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getFacetSet_Facets(), this.getFacet(), this.getFacet_FacetSet(), "facets", null, 0, -1, FacetSet.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
EOperation op = addEOperation(facetSetEClass, this.getFacet(), "getFacet", 0, 1, IS_UNIQUE, IS_ORDERED);
addEParameter(op, theEcorePackage.getEString(), "name", 0, 1, IS_UNIQUE, IS_ORDERED);
initEClass(shortcutEClass, Shortcut.class, "Shortcut", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getShortcut_Path(), theEcorePackage.getEReference(), null, "path", null, 0, -1, Shortcut.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getShortcut_OppositeReference(), theEcorePackage.getEReference(), null, "oppositeReference", null, 0, 1, Shortcut.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
// Create resource
createResource(eNS_URI);
}
} //FacetPackageImpl