| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package de.uka.ipd.sdq.identifier.impl; |
| 8 | |
| 9 | import org.eclipse.emf.ecore.EAttribute; |
| 10 | import org.eclipse.emf.ecore.EClass; |
| 11 | import org.eclipse.emf.ecore.EGenericType; |
| 12 | import org.eclipse.emf.ecore.EOperation; |
| 13 | import org.eclipse.emf.ecore.EPackage; |
| 14 | import org.eclipse.emf.ecore.EValidator; |
| 15 | import org.eclipse.emf.ecore.impl.EPackageImpl; |
| 16 | |
| 17 | import de.uka.ipd.sdq.identifier.Identifier; |
| 18 | import de.uka.ipd.sdq.identifier.IdentifierFactory; |
| 19 | import de.uka.ipd.sdq.identifier.IdentifierPackage; |
| 20 | import de.uka.ipd.sdq.identifier.util.IdentifierValidator; |
| 21 | |
| 22 | /** |
| 23 | * <!-- begin-user-doc --> |
| 24 | * An implementation of the model <b>Package</b>. |
| 25 | * <!-- end-user-doc --> |
| 26 | * @generated |
| 27 | */ |
| 28 | public class IdentifierPackageImpl extends EPackageImpl implements IdentifierPackage { |
| 29 | /** |
| 30 | * <!-- begin-user-doc --> |
| 31 | * <!-- end-user-doc --> |
| 32 | * @generated |
| 33 | */ |
| 34 | public static final String copyright = "Copyright 2007-2009, SDQ, IPD, U Karlsruhe"; |
| 35 | /** |
| 36 | * <!-- begin-user-doc --> |
| 37 | * <!-- end-user-doc --> |
| 38 | * @generated |
| 39 | */ |
| 40 | private EClass identifierEClass = null; |
| 41 | |
| 42 | /** |
| 43 | * Creates an instance of the model <b>Package</b>, registered with |
| 44 | * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package |
| 45 | * package URI value. |
| 46 | * <p>Note: the correct way to create the package is via the static |
| 47 | * factory method {@link #init init()}, which also performs |
| 48 | * initialization of the package, or returns the registered package, |
| 49 | * if one already exists. |
| 50 | * <!-- begin-user-doc --> |
| 51 | * <!-- end-user-doc --> |
| 52 | * @see org.eclipse.emf.ecore.EPackage.Registry |
| 53 | * @see de.uka.ipd.sdq.identifier.IdentifierPackage#eNS_URI |
| 54 | * @see #init() |
| 55 | * @generated |
| 56 | */ |
| 57 | private IdentifierPackageImpl() { |
| 58 | super(eNS_URI, IdentifierFactory.eINSTANCE); |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * <!-- begin-user-doc --> |
| 63 | * <!-- end-user-doc --> |
| 64 | * @generated |
| 65 | */ |
| 66 | private static boolean isInited = false; |
| 67 | |
| 68 | /** |
| 69 | * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. |
| 70 | * |
| 71 | * <p>This method is used to initialize {@link IdentifierPackage#eINSTANCE} when that field is accessed. |
| 72 | * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. |
| 73 | * <!-- begin-user-doc --> |
| 74 | * <!-- end-user-doc --> |
| 75 | * @see #eNS_URI |
| 76 | * @see #createPackageContents() |
| 77 | * @see #initializePackageContents() |
| 78 | * @generated |
| 79 | */ |
| 80 | public static IdentifierPackage init() { |
| 81 | if (isInited) return (IdentifierPackage)EPackage.Registry.INSTANCE.getEPackage(IdentifierPackage.eNS_URI); |
| 82 | |
| 83 | // Obtain or create and register package |
| 84 | IdentifierPackageImpl theIdentifierPackage = (IdentifierPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof IdentifierPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new IdentifierPackageImpl()); |
| 85 | |
| 86 | isInited = true; |
| 87 | |
| 88 | // Create package meta-data objects |
| 89 | theIdentifierPackage.createPackageContents(); |
| 90 | |
| 91 | // Initialize created meta-data |
| 92 | theIdentifierPackage.initializePackageContents(); |
| 93 | |
| 94 | // Register package validator |
| 95 | EValidator.Registry.INSTANCE.put |
| 96 | (theIdentifierPackage, |
| 97 | new EValidator.Descriptor() { |
| 98 | public EValidator getEValidator() { |
| 99 | return IdentifierValidator.INSTANCE; |
| 100 | } |
| 101 | }); |
| 102 | |
| 103 | // Mark meta-data to indicate it can't be changed |
| 104 | theIdentifierPackage.freeze(); |
| 105 | |
| 106 | |
| 107 | // Update the registry and return the package |
| 108 | EPackage.Registry.INSTANCE.put(IdentifierPackage.eNS_URI, theIdentifierPackage); |
| 109 | return theIdentifierPackage; |
| 110 | } |
| 111 | |
| 112 | /** |
| 113 | * <!-- begin-user-doc --> |
| 114 | * <!-- end-user-doc --> |
| 115 | * @generated |
| 116 | */ |
| 117 | public EClass getIdentifier() { |
| 118 | return identifierEClass; |
| 119 | } |
| 120 | |
| 121 | /** |
| 122 | * <!-- begin-user-doc --> |
| 123 | * <!-- end-user-doc --> |
| 124 | * @generated |
| 125 | */ |
| 126 | public EAttribute getIdentifier_Id() { |
| 127 | return (EAttribute)identifierEClass.getEStructuralFeatures().get(0); |
| 128 | } |
| 129 | |
| 130 | /** |
| 131 | * <!-- begin-user-doc --> |
| 132 | * <!-- end-user-doc --> |
| 133 | * @generated |
| 134 | */ |
| 135 | public IdentifierFactory getIdentifierFactory() { |
| 136 | return (IdentifierFactory)getEFactoryInstance(); |
| 137 | } |
| 138 | |
| 139 | /** |
| 140 | * <!-- begin-user-doc --> |
| 141 | * <!-- end-user-doc --> |
| 142 | * @generated |
| 143 | */ |
| 144 | private boolean isCreated = false; |
| 145 | |
| 146 | /** |
| 147 | * Creates the meta-model objects for the package. This method is |
| 148 | * guarded to have no affect on any invocation but its first. |
| 149 | * <!-- begin-user-doc --> |
| 150 | * <!-- end-user-doc --> |
| 151 | * @generated |
| 152 | */ |
| 153 | public void createPackageContents() { |
| 154 | if (isCreated) return; |
| 155 | isCreated = true; |
| 156 | |
| 157 | // Create classes and their features |
| 158 | identifierEClass = createEClass(IDENTIFIER); |
| 159 | createEAttribute(identifierEClass, IDENTIFIER__ID); |
| 160 | } |
| 161 | |
| 162 | /** |
| 163 | * <!-- begin-user-doc --> |
| 164 | * <!-- end-user-doc --> |
| 165 | * @generated |
| 166 | */ |
| 167 | private boolean isInitialized = false; |
| 168 | |
| 169 | /** |
| 170 | * Complete the initialization of the package and its meta-model. This |
| 171 | * method is guarded to have no affect on any invocation but its first. |
| 172 | * <!-- begin-user-doc --> |
| 173 | * <!-- end-user-doc --> |
| 174 | * @generated |
| 175 | */ |
| 176 | public void initializePackageContents() { |
| 177 | if (isInitialized) return; |
| 178 | isInitialized = true; |
| 179 | |
| 180 | // Initialize package |
| 181 | setName(eNAME); |
| 182 | setNsPrefix(eNS_PREFIX); |
| 183 | setNsURI(eNS_URI); |
| 184 | |
| 185 | // Create type parameters |
| 186 | |
| 187 | // Set bounds for type parameters |
| 188 | |
| 189 | // Add supertypes to classes |
| 190 | |
| 191 | // Initialize classes and features; add operations and parameters |
| 192 | initEClass(identifierEClass, Identifier.class, "Identifier", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| 193 | initEAttribute(getIdentifier_Id(), ecorePackage.getEString(), "id", null, 1, 1, Identifier.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); |
| 194 | |
| 195 | EOperation op = addEOperation(identifierEClass, ecorePackage.getEBoolean(), "idHasToBeUnique", 0, 1, IS_UNIQUE, IS_ORDERED); |
| 196 | addEParameter(op, ecorePackage.getEDiagnosticChain(), "diagnostics", 0, 1, IS_UNIQUE, IS_ORDERED); |
| 197 | EGenericType g1 = createEGenericType(ecorePackage.getEMap()); |
| 198 | EGenericType g2 = createEGenericType(ecorePackage.getEJavaObject()); |
| 199 | g1.getETypeArguments().add(g2); |
| 200 | g2 = createEGenericType(ecorePackage.getEJavaObject()); |
| 201 | g1.getETypeArguments().add(g2); |
| 202 | addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED); |
| 203 | |
| 204 | // Create resource |
| 205 | createResource(eNS_URI); |
| 206 | |
| 207 | // Create annotations |
| 208 | // http:///org/eclipse/emf/ecore/util/ExtendedMetaData |
| 209 | createExtendedMetaDataAnnotations(); |
| 210 | } |
| 211 | |
| 212 | /** |
| 213 | * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>. |
| 214 | * <!-- begin-user-doc --> |
| 215 | * <!-- end-user-doc --> |
| 216 | * @generated |
| 217 | */ |
| 218 | protected void createExtendedMetaDataAnnotations() { |
| 219 | String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; |
| 220 | addAnnotation |
| 221 | (getIdentifier_Id(), |
| 222 | source, |
| 223 | new String[] { |
| 224 | "name", "id", |
| 225 | "namespace", "http://sdq.ipd.uka.de/Identifier/1.0" |
| 226 | }); |
| 227 | } |
| 228 | |
| 229 | } //IdentifierPackageImpl |