/** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (C) 2007 Matthias Braeuer (braeuer.matthias@web.de). * * All rights reserved. * * * * This work was done as a project at the Chair for Software Technology, * * Dresden University Of Technology, Germany (http://st.inf.tu-dresden.de). * * It is understood that any modification not identified as such is not * * covered by the preceding statement. * * * * This work is free software; you can redistribute it and/or modify it * * under the terms of the GNU Library General Public License as published * * by the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This work is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public * * License for more details. * * * * You should have received a copy of the GNU Library General Public License * * along with this library; if not, you can view it online at * * http://www.fsf.org/licensing/licenses/gpl.html. * * * * To submit a bug report, send a comment, or get the latest news on this * * project, please visit the website: http://dresden-ocl.sourceforge.net. * * For more information on OCL and related projects visit the OCL Portal: * * http://st.inf.tu-dresden.de/ocl * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * $Id$ */ package org.dresdenocl.datatypes.impl; import java.util.Collection; import java.util.List; import java.util.Set; import org.eclipse.emf.ecore.EDataType; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.impl.EPackageImpl; import org.dresdenocl.datatypes.DatatypesFactory; import org.dresdenocl.datatypes.DatatypesPackage; import org.dresdenocl.pivotmodel.PivotModelPackage; import org.dresdenocl.pivotmodel.impl.PivotModelPackageImpl; /** * <!-- begin-user-doc --> The <b>Package</b> for the model. It contains * accessors for the meta objects to represent * <ul> * <li>each class,</li> * <li>each feature of each class,</li> * <li>each enum,</li> * <li>and each data type</li> * </ul> * <!-- end-user-doc --> * @generated */ public class DatatypesPackageImpl extends EPackageImpl implements DatatypesPackage { /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ private EDataType sequenceEDataType = null; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ private EDataType setEDataType = null; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ private EDataType unlimitedNaturalEDataType = null; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ private EDataType integerEDataType = null; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ private EDataType booleanEDataType = null; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ private EDataType stringEDataType = null; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ private EDataType realEDataType = null; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ private EDataType bagEDataType = null; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ private EDataType orderedSetEDataType = null; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ private EDataType collectionEDataType = 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.dresdenocl.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. * * <p> * This method is used to initialize {@link DatatypesPackage#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 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 .get(eNS_URI) instanceof DatatypesPackageImpl ? EPackage.Registry.INSTANCE .get(eNS_URI) : new DatatypesPackageImpl()); isInited = true; // Obtain or create and register interdependencies PivotModelPackageImpl thePivotModelPackage = (PivotModelPackageImpl) (EPackage.Registry.INSTANCE .getEPackage(PivotModelPackage.eNS_URI) instanceof PivotModelPackageImpl ? EPackage.Registry.INSTANCE .getEPackage(PivotModelPackage.eNS_URI) : PivotModelPackage.eINSTANCE); // Create package meta-data objects theDatatypesPackage.createPackageContents(); thePivotModelPackage.createPackageContents(); // Initialize created meta-data theDatatypesPackage.initializePackageContents(); thePivotModelPackage.initializePackageContents(); // Mark meta-data to indicate it can't be changed theDatatypesPackage.freeze(); // Update the registry and return the package EPackage.Registry.INSTANCE.put(DatatypesPackage.eNS_URI, theDatatypesPackage); return theDatatypesPackage; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public EDataType getSequence() { return sequenceEDataType; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public EDataType getSet() { return setEDataType; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public EDataType getUnlimitedNatural() { return unlimitedNaturalEDataType; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public EDataType getInteger() { return integerEDataType; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public EDataType getBoolean() { return booleanEDataType; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public EDataType getString() { return stringEDataType; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public EDataType getReal() { return realEDataType; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public EDataType getBag() { return bagEDataType; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public EDataType getOrderedSet() { return orderedSetEDataType; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public EDataType getCollection() { return collectionEDataType; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override 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 data types booleanEDataType = createEDataType(BOOLEAN); integerEDataType = createEDataType(INTEGER); realEDataType = createEDataType(REAL); stringEDataType = createEDataType(STRING); unlimitedNaturalEDataType = createEDataType(UNLIMITED_NATURAL); collectionEDataType = createEDataType(COLLECTION); sequenceEDataType = createEDataType(SEQUENCE); bagEDataType = createEDataType(BAG); setEDataType = createEDataType(SET); orderedSetEDataType = createEDataType(ORDERED_SET); } /** * <!-- 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); // Initialize data types initEDataType(booleanEDataType, boolean.class, "Boolean", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEDataType(integerEDataType, int.class, "Integer", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEDataType(realEDataType, float.class, "Real", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEDataType(stringEDataType, String.class, "String", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEDataType( unlimitedNaturalEDataType, long.class, "UnlimitedNatural", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEDataType(collectionEDataType, Collection.class, "Collection", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEDataType(sequenceEDataType, List.class, "Sequence", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEDataType(bagEDataType, List.class, "Bag", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEDataType(setEDataType, Set.class, "Set", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEDataType(orderedSetEDataType, List.class, "OrderedSet", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ // Create resource createResource(eNS_URI); } } // DatatypesPackageImpl