1 17 package org.eclipse.emf.ecore.xml.namespace.impl; 18 19 20 import org.eclipse.emf.ecore.EAttribute; 21 import org.eclipse.emf.ecore.EClass; 22 import org.eclipse.emf.ecore.EDataType; 23 import org.eclipse.emf.ecore.EEnum; 24 import org.eclipse.emf.ecore.EPackage; 25 import org.eclipse.emf.ecore.EReference; 26 import org.eclipse.emf.ecore.impl.EPackageImpl; 27 import org.eclipse.emf.ecore.xml.namespace.SpaceType; 28 import org.eclipse.emf.ecore.xml.namespace.XMLNamespaceDocumentRoot; 29 import org.eclipse.emf.ecore.xml.namespace.XMLNamespaceFactory; 30 import org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage; 31 import org.eclipse.emf.ecore.xml.type.XMLTypePackage; 32 import org.eclipse.emf.ecore.xml.type.impl.XMLTypePackageImpl; 33 34 35 41 public class XMLNamespacePackageImpl extends EPackageImpl implements XMLNamespacePackage 42 { 43 48 private EClass xmlNamespaceDocumentRootEClass = null; 49 50 55 private EEnum spaceTypeEEnum = null; 56 57 62 private EDataType spaceTypeObjectEDataType = null; 63 64 79 private XMLNamespacePackageImpl() 80 { 81 super(eNS_URI, XMLNamespaceFactory.eINSTANCE); 82 } 83 84 89 private static boolean isInited = false; 90 91 113 public static XMLNamespacePackage init() 114 { 115 if (isInited) return (XMLNamespacePackage)EPackage.Registry.INSTANCE.getEPackage(XMLNamespacePackage.eNS_URI); 116 117 XMLNamespacePackageImpl theXMLNamespacePackage = (XMLNamespacePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof XMLNamespacePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new XMLNamespacePackageImpl()); 119 120 isInited = true; 121 122 XMLTypePackageImpl.init(); 124 125 theXMLNamespacePackage.createPackageContents(); 127 128 theXMLNamespacePackage.initializePackageContents(); 130 131 theXMLNamespacePackage.freeze(); 133 134 return theXMLNamespacePackage; 135 } 136 137 142 public EClass getXMLNamespaceDocumentRoot() 143 { 144 return xmlNamespaceDocumentRootEClass; 145 } 146 147 152 public EAttribute getXMLNamespaceDocumentRoot_Mixed() 153 { 154 return (EAttribute)xmlNamespaceDocumentRootEClass.getEStructuralFeatures().get(0); 155 } 156 157 162 public EReference getXMLNamespaceDocumentRoot_XMLNSPrefixMap() 163 { 164 return (EReference)xmlNamespaceDocumentRootEClass.getEStructuralFeatures().get(1); 165 } 166 167 172 public EReference getXMLNamespaceDocumentRoot_XSISchemaLocation() 173 { 174 return (EReference)xmlNamespaceDocumentRootEClass.getEStructuralFeatures().get(2); 175 } 176 177 182 public EAttribute getXMLNamespaceDocumentRoot_Base() 183 { 184 return (EAttribute)xmlNamespaceDocumentRootEClass.getEStructuralFeatures().get(3); 185 } 186 187 192 public EAttribute getXMLNamespaceDocumentRoot_Id() 193 { 194 return (EAttribute)xmlNamespaceDocumentRootEClass.getEStructuralFeatures().get(4); 195 } 196 197 202 public EAttribute getXMLNamespaceDocumentRoot_Lang() 203 { 204 return (EAttribute)xmlNamespaceDocumentRootEClass.getEStructuralFeatures().get(5); 205 } 206 207 212 public EAttribute getXMLNamespaceDocumentRoot_Space() 213 { 214 return (EAttribute)xmlNamespaceDocumentRootEClass.getEStructuralFeatures().get(6); 215 } 216 217 222 public EEnum getSpaceType() 223 { 224 return spaceTypeEEnum; 225 } 226 227 232 public EDataType getSpaceTypeObject() 233 { 234 return spaceTypeObjectEDataType; 235 } 236 237 242 public XMLNamespaceFactory getXMLNamespaceFactory() 243 { 244 return (XMLNamespaceFactory)getEFactoryInstance(); 245 } 246 247 252 private boolean isCreated = false; 253 254 261 public void createPackageContents() 262 { 263 if (isCreated) return; 264 isCreated = true; 265 266 xmlNamespaceDocumentRootEClass = createEClass(XML_NAMESPACE_DOCUMENT_ROOT); 268 createEAttribute(xmlNamespaceDocumentRootEClass, XML_NAMESPACE_DOCUMENT_ROOT__MIXED); 269 createEReference(xmlNamespaceDocumentRootEClass, XML_NAMESPACE_DOCUMENT_ROOT__XMLNS_PREFIX_MAP); 270 createEReference(xmlNamespaceDocumentRootEClass, XML_NAMESPACE_DOCUMENT_ROOT__XSI_SCHEMA_LOCATION); 271 createEAttribute(xmlNamespaceDocumentRootEClass, XML_NAMESPACE_DOCUMENT_ROOT__BASE); 272 createEAttribute(xmlNamespaceDocumentRootEClass, XML_NAMESPACE_DOCUMENT_ROOT__ID); 273 createEAttribute(xmlNamespaceDocumentRootEClass, XML_NAMESPACE_DOCUMENT_ROOT__LANG); 274 createEAttribute(xmlNamespaceDocumentRootEClass, XML_NAMESPACE_DOCUMENT_ROOT__SPACE); 275 276 spaceTypeEEnum = createEEnum(SPACE_TYPE); 278 279 spaceTypeObjectEDataType = createEDataType(SPACE_TYPE_OBJECT); 281 } 282 283 288 private boolean isInitialized = false; 289 290 297 public void initializePackageContents() 298 { 299 if (isInitialized) return; 300 isInitialized = true; 301 302 setName(eNAME); 304 setNsPrefix(eNS_PREFIX); 305 setNsURI(eNS_URI); 306 307 XMLTypePackageImpl theXMLTypePackage = (XMLTypePackageImpl)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); 309 310 312 initEClass(xmlNamespaceDocumentRootEClass, XMLNamespaceDocumentRoot.class, "XMLNamespaceDocumentRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); 314 initEAttribute(getXMLNamespaceDocumentRoot_Mixed(), ecorePackage.getEFeatureMapEntry(), "mixed", null, 0, -1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 315 initEReference(getXMLNamespaceDocumentRoot_XMLNSPrefixMap(), ecorePackage.getEStringToStringMapEntry(), null, "xMLNSPrefixMap", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 316 initEReference(getXMLNamespaceDocumentRoot_XSISchemaLocation(), ecorePackage.getEStringToStringMapEntry(), null, "xSISchemaLocation", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 317 initEAttribute(getXMLNamespaceDocumentRoot_Base(), theXMLTypePackage.getAnyURI(), "base", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 318 initEAttribute(getXMLNamespaceDocumentRoot_Id(), theXMLTypePackage.getID(), "id", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 319 initEAttribute(getXMLNamespaceDocumentRoot_Lang(), theXMLTypePackage.getLanguage(), "lang", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 320 initEAttribute(getXMLNamespaceDocumentRoot_Space(), this.getSpaceType(), "space", "preserve", 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 321 322 initEEnum(spaceTypeEEnum, SpaceType.class, "SpaceType"); 324 addEEnumLiteral(spaceTypeEEnum, SpaceType.DEFAULT_LITERAL); 325 addEEnumLiteral(spaceTypeEEnum, SpaceType.PRESERVE_LITERAL); 326 327 initEDataType(spaceTypeObjectEDataType, SpaceType.class, "SpaceTypeObject", IS_SERIALIZABLE, IS_GENERATED_INSTANCE_CLASS); 329 330 createResource(eNS_URI); 332 333 createExtendedMetaDataAnnotations(); 336 } 337 338 344 protected void createExtendedMetaDataAnnotations() 345 { 346 String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; 347 addAnnotation 348 (spaceTypeEEnum, 349 source, 350 new String [] 351 { 352 "name", "space_._type" 353 }); 354 addAnnotation 355 (spaceTypeObjectEDataType, 356 source, 357 new String [] 358 { 359 "name", "space_._type:Object", 360 "baseType", "space_._type" 361 }); 362 addAnnotation 363 (xmlNamespaceDocumentRootEClass, 364 source, 365 new String [] 366 { 367 "name", "", 368 "kind", "mixed" 369 }); 370 addAnnotation 371 (getXMLNamespaceDocumentRoot_Mixed(), 372 source, 373 new String [] 374 { 375 "kind", "elementWildcard", 376 "name", ":mixed" 377 }); 378 addAnnotation 379 (getXMLNamespaceDocumentRoot_XMLNSPrefixMap(), 380 source, 381 new String [] 382 { 383 "kind", "attribute", 384 "name", "xmlns:prefix" 385 }); 386 addAnnotation 387 (getXMLNamespaceDocumentRoot_XSISchemaLocation(), 388 source, 389 new String [] 390 { 391 "kind", "attribute", 392 "name", "xsi:schemaLocation" 393 }); 394 addAnnotation 395 (getXMLNamespaceDocumentRoot_Base(), 396 source, 397 new String [] 398 { 399 "kind", "attribute", 400 "name", "base", 401 "namespace", "##targetNamespace" 402 }); 403 addAnnotation 404 (getXMLNamespaceDocumentRoot_Id(), 405 source, 406 new String [] 407 { 408 "kind", "attribute", 409 "name", "id", 410 "namespace", "##targetNamespace" 411 }); 412 addAnnotation 413 (getXMLNamespaceDocumentRoot_Lang(), 414 source, 415 new String [] 416 { 417 "kind", "attribute", 418 "name", "lang", 419 "namespace", "##targetNamespace" 420 }); 421 addAnnotation 422 (getXMLNamespaceDocumentRoot_Space(), 423 source, 424 new String [] 425 { 426 "kind", "attribute", 427 "name", "space", 428 "namespace", "##targetNamespace" 429 }); 430 } 431 432 } | Popular Tags |