| /** |
| * |
| * 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 |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| */ |
| package org.eclipse.osbp.infogrid.model.gridsource.impl; |
| |
| import java.io.IOException; |
| import java.net.URL; |
| import org.eclipse.emf.common.util.URI; |
| import org.eclipse.emf.common.util.WrappedException; |
| import org.eclipse.emf.ecore.EAttribute; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EClassifier; |
| import org.eclipse.emf.ecore.EPackage; |
| import org.eclipse.emf.ecore.EReference; |
| import org.eclipse.emf.ecore.impl.EPackageImpl; |
| import org.eclipse.emf.ecore.resource.Resource; |
| import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl; |
| import org.eclipse.xtext.common.types.TypesPackage; |
| import org.eclipse.osbp.infogrid.model.gridsource.CxGridSourceFactory; |
| import org.eclipse.osbp.infogrid.model.gridsource.CxGridSourcePackage; |
| import org.eclipse.osbp.infogrid.model.gridsource.style.CxGridStylePackage; |
| import org.eclipse.osbp.infogrid.model.gridsource.style.impl.CxGridStylePackageImpl; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model <b>Package</b>. |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public class CxGridSourcePackageImpl extends EPackageImpl implements CxGridSourcePackage { |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected String packageFilename = "gridsource.ecore"; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass cxGridSourceEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass cxGridSourceInputEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass cxGridPropertyEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass cxGridNestedFieldEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass cxGridNestedPathEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass cxGridSourceEQFilterEClass = 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.infogrid.model.gridsource.CxGridSourcePackage#eNS_URI |
| * @see #init() |
| * @generated |
| */ |
| private CxGridSourcePackageImpl() { |
| super(eNS_URI, CxGridSourceFactory.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 CxGridSourcePackage#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 |
| * @generated |
| */ |
| public static CxGridSourcePackage init() { |
| if (isInited) return (CxGridSourcePackage)EPackage.Registry.INSTANCE.getEPackage(CxGridSourcePackage.eNS_URI); |
| |
| // Obtain or create and register package |
| CxGridSourcePackageImpl theCxGridSourcePackage = (CxGridSourcePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof CxGridSourcePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new CxGridSourcePackageImpl()); |
| |
| isInited = true; |
| |
| // Initialize simple dependencies |
| TypesPackage.eINSTANCE.eClass(); |
| |
| // Obtain or create and register interdependencies |
| CxGridStylePackageImpl theCxGridStylePackage = (CxGridStylePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(CxGridStylePackage.eNS_URI) instanceof CxGridStylePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(CxGridStylePackage.eNS_URI) : CxGridStylePackage.eINSTANCE); |
| |
| // Load packages |
| theCxGridSourcePackage.loadPackage(); |
| |
| // Fix loaded packages |
| theCxGridSourcePackage.fixPackageContents(); |
| theCxGridStylePackage.fixPackageContents(); |
| |
| // Mark meta-data to indicate it can't be changed |
| theCxGridSourcePackage.freeze(); |
| |
| |
| // Update the registry and return the package |
| EPackage.Registry.INSTANCE.put(CxGridSourcePackage.eNS_URI, theCxGridSourcePackage); |
| return theCxGridSourcePackage; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EClass getCxGridSource() { |
| if (cxGridSourceEClass == null) { |
| cxGridSourceEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(CxGridSourcePackage.eNS_URI).getEClassifiers().get(0); |
| } |
| return cxGridSourceEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getCxGridSource_Id() { |
| return (EAttribute)getCxGridSource().getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getCxGridSource_Tags() { |
| return (EAttribute)getCxGridSource().getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getCxGridSource_Kind() { |
| return (EAttribute)getCxGridSource().getEStructuralFeatures().get(2); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getCxGridSource_RootType() { |
| return (EReference)getCxGridSource().getEStructuralFeatures().get(3); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getCxGridSource_RootTypeFQN() { |
| return (EAttribute)getCxGridSource().getEStructuralFeatures().get(4); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getCxGridSource_Properties() { |
| return (EReference)getCxGridSource().getEStructuralFeatures().get(5); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getCxGridSource_Inputs() { |
| return (EReference)getCxGridSource().getEStructuralFeatures().get(6); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getCxGridSource_SelectionEventTopic() { |
| return (EAttribute)getCxGridSource().getEStructuralFeatures().get(7); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EClass getCxGridSourceInput() { |
| if (cxGridSourceInputEClass == null) { |
| cxGridSourceInputEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(CxGridSourcePackage.eNS_URI).getEClassifiers().get(1); |
| } |
| return cxGridSourceInputEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getCxGridSourceInput_InputType() { |
| return (EReference)getCxGridSourceInput().getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getCxGridSourceInput_InputTypeFQN() { |
| return (EAttribute)getCxGridSourceInput().getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getCxGridSourceInput_Filters() { |
| return (EReference)getCxGridSourceInput().getEStructuralFeatures().get(2); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EClass getCxGridProperty() { |
| if (cxGridPropertyEClass == null) { |
| cxGridPropertyEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(CxGridSourcePackage.eNS_URI).getEClassifiers().get(2); |
| } |
| return cxGridPropertyEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getCxGridProperty_Path() { |
| return (EReference)getCxGridProperty().getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getCxGridProperty_Style() { |
| return (EReference)getCxGridProperty().getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getCxGridProperty_DotPath() { |
| return (EAttribute)getCxGridProperty().getEStructuralFeatures().get(2); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getCxGridProperty_Editable() { |
| return (EAttribute)getCxGridProperty().getEStructuralFeatures().get(3); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EClass getCxGridNestedField() { |
| if (cxGridNestedFieldEClass == null) { |
| cxGridNestedFieldEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(CxGridSourcePackage.eNS_URI).getEClassifiers().get(3); |
| } |
| return cxGridNestedFieldEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getCxGridNestedField_Field() { |
| return (EReference)getCxGridNestedField().getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getCxGridNestedField_Path() { |
| return (EReference)getCxGridNestedField().getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getCxGridNestedField_DotPath() { |
| return (EAttribute)getCxGridNestedField().getEStructuralFeatures().get(2); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EClass getCxGridNestedPath() { |
| if (cxGridNestedPathEClass == null) { |
| cxGridNestedPathEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(CxGridSourcePackage.eNS_URI).getEClassifiers().get(4); |
| } |
| return cxGridNestedPathEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getCxGridNestedPath_Field() { |
| return (EReference)getCxGridNestedPath().getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getCxGridNestedPath_Path() { |
| return (EReference)getCxGridNestedPath().getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getCxGridNestedPath_DotPath() { |
| return (EAttribute)getCxGridNestedPath().getEStructuralFeatures().get(2); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EClass getCxGridSourceEQFilter() { |
| if (cxGridSourceEQFilterEClass == null) { |
| cxGridSourceEQFilterEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(CxGridSourcePackage.eNS_URI).getEClassifiers().get(5); |
| } |
| return cxGridSourceEQFilterEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getCxGridSourceEQFilter_InputTypePropertyPath() { |
| return (EReference)getCxGridSourceEQFilter().getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getCxGridSourceEQFilter_RootTypePropertyPath() { |
| return (EReference)getCxGridSourceEQFilter().getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CxGridSourceFactory getCxGridSourceFactory() { |
| return (CxGridSourceFactory)getEFactoryInstance(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private boolean isLoaded = false; |
| |
| /** |
| * Laods the package and any sub-packages from their serialized form. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void loadPackage() { |
| if (isLoaded) return; |
| isLoaded = true; |
| |
| URL url = getClass().getResource(packageFilename); |
| if (url == null) { |
| throw new RuntimeException("Missing serialized package: " + packageFilename); |
| } |
| URI uri = URI.createURI(url.toString()); |
| Resource resource = new EcoreResourceFactoryImpl().createResource(uri); |
| try { |
| resource.load(null); |
| } |
| catch (IOException exception) { |
| throw new WrappedException(exception); |
| } |
| initializeFromLoadedEPackage(this, (EPackage)resource.getContents().get(0)); |
| createResource(eNS_URI); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private boolean isFixed = false; |
| |
| /** |
| * Fixes up the loaded package, to make it appear as if it had been programmatically built. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void fixPackageContents() { |
| if (isFixed) return; |
| isFixed = true; |
| fixEClassifiers(); |
| } |
| |
| /** |
| * Sets the instance class on the given classifier. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected void fixInstanceClass(EClassifier eClassifier) { |
| if (eClassifier.getInstanceClassName() == null) { |
| eClassifier.setInstanceClassName("org.eclipse.osbp.infogrid.model.gridsource." + eClassifier.getName()); |
| setGeneratedClassName(eClassifier); |
| } |
| } |
| |
| } //CxGridSourcePackageImpl |