/******************************************************************************* * Copyright (c) 2007 Borland Software Corporation and others. * * 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: * Borland Software Corporation - initial API and implementation *******************************************************************************/ package rdb.datatypes.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.impl.EPackageImpl; import rdb.RdbPackage; import rdb.constraints.ConstraintsPackage; import rdb.constraints.impl.ConstraintsPackageImpl; import rdb.datatypes.DataType; import rdb.datatypes.DatatypesFactory; import rdb.datatypes.DatatypesPackage; import rdb.datatypes.Domain; import rdb.datatypes.PrimitiveDataType; import rdb.impl.RdbPackageImpl; import rdb.view.ViewPackage; import rdb.view.impl.ViewPackageImpl; /** * <!-- begin-user-doc --> * An implementation of the model <b>Package</b>. * <!-- end-user-doc --> * @generated */ public class DatatypesPackageImpl extends EPackageImpl implements DatatypesPackage { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass domainEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass dataTypeEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass primitiveDataTypeEClass = 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 rdb.datatypes.DatatypesPackage#eNS_URI * @see #init() * @generated */ private DatatypesPackageImpl() { super(eNS_URI, DatatypesFactory.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. Simple * dependencies are satisfied by calling this method on all * dependent packages before doing anything else. This method drives * initialization for interdependent packages directly, in parallel * with this package, itself. * <p>Of this package and its interdependencies, all packages which * have not yet been registered by their URI values are first created * and registered. The packages are then initialized in two steps: * meta-model objects for all of the packages are created before any * are initialized, since one package's meta-model objects may refer to * those of another. * <p>Invocation of this method will not affect any packages that have * already been initialized. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #eNS_URI * @see #createPackageContents() * @see #initializePackageContents() * @generated */ public static DatatypesPackage init() { if (isInited) return (DatatypesPackage)EPackage.Registry.INSTANCE.getEPackage(DatatypesPackage.eNS_URI); // Obtain or create and register package DatatypesPackageImpl theDatatypesPackage = (DatatypesPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof DatatypesPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new DatatypesPackageImpl()); isInited = true; // Obtain or create and register interdependencies RdbPackageImpl theRdbPackage = (RdbPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(RdbPackage.eNS_URI) instanceof RdbPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(RdbPackage.eNS_URI) : RdbPackage.eINSTANCE); ConstraintsPackageImpl theConstraintsPackage = (ConstraintsPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(ConstraintsPackage.eNS_URI) instanceof ConstraintsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(ConstraintsPackage.eNS_URI) : ConstraintsPackage.eINSTANCE); ViewPackageImpl theViewPackage = (ViewPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(ViewPackage.eNS_URI) instanceof ViewPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(ViewPackage.eNS_URI) : ViewPackage.eINSTANCE); // Create package meta-data objects theDatatypesPackage.createPackageContents(); theRdbPackage.createPackageContents(); theConstraintsPackage.createPackageContents(); theViewPackage.createPackageContents(); // Initialize created meta-data theDatatypesPackage.initializePackageContents(); theRdbPackage.initializePackageContents(); theConstraintsPackage.initializePackageContents(); theViewPackage.initializePackageContents(); // Mark meta-data to indicate it can't be changed theDatatypesPackage.freeze(); return theDatatypesPackage; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getDomain() { return domainEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getDomain_ParentDomain() { return (EReference)domainEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getDataType() { return dataTypeEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getDataType_Size() { return (EAttribute)dataTypeEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getDataType_DecimalDigits() { return (EAttribute)dataTypeEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getDataType_Nullable() { return (EAttribute)dataTypeEClass.getEStructuralFeatures().get(2); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getDataType_Default() { return (EAttribute)dataTypeEClass.getEStructuralFeatures().get(3); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getDataType_Check() { return (EAttribute)dataTypeEClass.getEStructuralFeatures().get(4); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getDataType_Var() { return (EAttribute)dataTypeEClass.getEStructuralFeatures().get(5); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getPrimitiveDataType() { return primitiveDataTypeEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getPrimitiveDataType_Type() { return (EAttribute)primitiveDataTypeEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public DatatypesFactory getDatatypesFactory() { return (DatatypesFactory)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 domainEClass = createEClass(DOMAIN); createEReference(domainEClass, DOMAIN__PARENT_DOMAIN); dataTypeEClass = createEClass(DATA_TYPE); createEAttribute(dataTypeEClass, DATA_TYPE__SIZE); createEAttribute(dataTypeEClass, DATA_TYPE__DECIMAL_DIGITS); createEAttribute(dataTypeEClass, DATA_TYPE__NULLABLE); createEAttribute(dataTypeEClass, DATA_TYPE__DEFAULT); createEAttribute(dataTypeEClass, DATA_TYPE__CHECK); createEAttribute(dataTypeEClass, DATA_TYPE__VAR); primitiveDataTypeEClass = createEClass(PRIMITIVE_DATA_TYPE); createEAttribute(primitiveDataTypeEClass, PRIMITIVE_DATA_TYPE__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 RdbPackage theRdbPackage = (RdbPackage)EPackage.Registry.INSTANCE.getEPackage(RdbPackage.eNS_URI); // Create type parameters // Set bounds for type parameters // Add supertypes to classes domainEClass.getESuperTypes().add(theRdbPackage.getSchemaElement()); domainEClass.getESuperTypes().add(this.getPrimitiveDataType()); dataTypeEClass.getESuperTypes().add(theRdbPackage.getNamedElement()); primitiveDataTypeEClass.getESuperTypes().add(this.getDataType()); // Initialize classes and features; add operations and parameters initEClass(domainEClass, Domain.class, "Domain", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEReference(getDomain_ParentDomain(), this.getDomain(), null, "parentDomain", null, 0, 1, Domain.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ initEClass(dataTypeEClass, DataType.class, "DataType", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEAttribute(getDataType_Size(), ecorePackage.getEInt(), "size", null, 0, 1, DataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ initEAttribute(getDataType_DecimalDigits(), ecorePackage.getEInt(), "decimalDigits", null, 0, 1, DataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ initEAttribute(getDataType_Nullable(), ecorePackage.getEBoolean(), "nullable", null, 0, 1, DataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ initEAttribute(getDataType_Default(), ecorePackage.getEString(), "default", null, 0, 1, DataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ initEAttribute(getDataType_Check(), ecorePackage.getEString(), "check", null, 0, 1, DataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ initEAttribute(getDataType_Var(), ecorePackage.getEString(), "var", null, 0, 1, DataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ initEClass(primitiveDataTypeEClass, PrimitiveDataType.class, "PrimitiveDataType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEAttribute(getPrimitiveDataType_Type(), ecorePackage.getEString(), "type", null, 0, 1, PrimitiveDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ } } //DatatypesPackageImpl