1 17 package org.eclipse.emf.mapping.ecore2xml.impl; 18 19 import java.util.Map ; 20 21 import org.eclipse.emf.ecore.EAttribute; 22 import org.eclipse.emf.ecore.EClass; 23 import org.eclipse.emf.ecore.EPackage; 24 import org.eclipse.emf.ecore.EReference; 25 import org.eclipse.emf.ecore.EcorePackage; 26 27 import org.eclipse.emf.ecore.impl.EPackageImpl; 28 import org.eclipse.emf.ecore.impl.EcorePackageImpl; 29 import org.eclipse.emf.mapping.ecore2xml.Ecore2XMLFactory; 30 import org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage; 31 import org.eclipse.emf.mapping.ecore2xml.XMLInfo; 32 import org.eclipse.emf.mapping.ecore2xml.XMLMap; 33 34 40 public class Ecore2XMLPackageImpl extends EPackageImpl implements Ecore2XMLPackage 41 { 42 43 48 private EClass xmlInfoEClass = null; 49 50 55 private EClass xmlMapEClass = null; 56 57 62 private EClass eNamedElementToXMLInfoMapEntryEClass = null; 63 64 79 private Ecore2XMLPackageImpl() 80 { 81 super(eNS_URI, Ecore2XMLFactory.eINSTANCE); 82 } 83 84 89 private static boolean isInited = false; 90 91 113 public static Ecore2XMLPackage init() 114 { 115 if (isInited) return (Ecore2XMLPackage)EPackage.Registry.INSTANCE.getEPackage(Ecore2XMLPackage.eNS_URI); 116 117 Ecore2XMLPackageImpl theEcore2XMLPackage = (Ecore2XMLPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof Ecore2XMLPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new Ecore2XMLPackageImpl()); 119 120 isInited = true; 121 122 EcorePackageImpl.init(); 124 125 theEcore2XMLPackage.createPackageContents(); 127 128 theEcore2XMLPackage.initializePackageContents(); 130 131 theEcore2XMLPackage.freeze(); 133 134 return theEcore2XMLPackage; 135 } 136 137 142 public EClass getXMLInfo() 143 { 144 return xmlInfoEClass; 145 } 146 147 152 public EAttribute getXMLInfo_Name() 153 { 154 return (EAttribute)xmlInfoEClass.getEStructuralFeatures().get(0); 155 } 156 157 162 public EAttribute getXMLInfo_TargetNamespace() 163 { 164 return (EAttribute)xmlInfoEClass.getEStructuralFeatures().get(1); 165 } 166 167 172 public EAttribute getXMLInfo_XMLRepresentation() 173 { 174 return (EAttribute)xmlInfoEClass.getEStructuralFeatures().get(2); 175 } 176 177 182 public EClass getXMLMap() 183 { 184 return xmlMapEClass; 185 } 186 187 192 public EAttribute getXMLMap_IDAttributeName() 193 { 194 return (EAttribute)xmlMapEClass.getEStructuralFeatures().get(0); 195 } 196 197 202 public EReference getXMLMap_EcoreToXMLInfo() 203 { 204 return (EReference)xmlMapEClass.getEStructuralFeatures().get(1); 205 } 206 207 212 public EReference getXMLMap_NoNamespacePackage() 213 { 214 return (EReference)xmlMapEClass.getEStructuralFeatures().get(2); 215 } 216 217 222 public EClass getENamedElementToXMLInfoMapEntry() 223 { 224 return eNamedElementToXMLInfoMapEntryEClass; 225 } 226 227 232 public EReference getENamedElementToXMLInfoMapEntry_Key() 233 { 234 return (EReference)eNamedElementToXMLInfoMapEntryEClass.getEStructuralFeatures().get(0); 235 } 236 237 242 public EReference getENamedElementToXMLInfoMapEntry_Value() 243 { 244 return (EReference)eNamedElementToXMLInfoMapEntryEClass.getEStructuralFeatures().get(1); 245 } 246 247 252 public Ecore2XMLFactory getEcore2XMLFactory() 253 { 254 return (Ecore2XMLFactory)getEFactoryInstance(); 255 } 256 257 262 private boolean isCreated = false; 263 264 271 public void createPackageContents() 272 { 273 if (isCreated) return; 274 isCreated = true; 275 276 xmlInfoEClass = createEClass(XML_INFO); 278 createEAttribute(xmlInfoEClass, XML_INFO__NAME); 279 createEAttribute(xmlInfoEClass, XML_INFO__TARGET_NAMESPACE); 280 createEAttribute(xmlInfoEClass, XML_INFO__XML_REPRESENTATION); 281 282 xmlMapEClass = createEClass(XML_MAP); 283 createEAttribute(xmlMapEClass, XML_MAP__IDATTRIBUTE_NAME); 284 createEReference(xmlMapEClass, XML_MAP__ECORE_TO_XML_INFO); 285 createEReference(xmlMapEClass, XML_MAP__NO_NAMESPACE_PACKAGE); 286 287 eNamedElementToXMLInfoMapEntryEClass = createEClass(ENAMED_ELEMENT_TO_XML_INFO_MAP_ENTRY); 288 createEReference(eNamedElementToXMLInfoMapEntryEClass, ENAMED_ELEMENT_TO_XML_INFO_MAP_ENTRY__KEY); 289 createEReference(eNamedElementToXMLInfoMapEntryEClass, ENAMED_ELEMENT_TO_XML_INFO_MAP_ENTRY__VALUE); 290 } 291 292 297 private boolean isInitialized = false; 298 299 306 public void initializePackageContents() 307 { 308 if (isInitialized) return; 309 isInitialized = true; 310 311 setName(eNAME); 313 setNsPrefix(eNS_PREFIX); 314 setNsURI(eNS_URI); 315 316 EcorePackageImpl theEcorePackage = (EcorePackageImpl)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); 318 319 321 initEClass(xmlInfoEClass, XMLInfo.class, "XMLInfo", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getXMLInfo_Name(), theEcorePackage.getEString(), "name", null, 0, 1, XMLInfo.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getXMLInfo_TargetNamespace(), theEcorePackage.getEString(), "targetNamespace", null, 0, 1, XMLInfo.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getXMLInfo_XMLRepresentation(), theEcorePackage.getEInt(), "xMLRepresentation", "-1", 0, 1, XMLInfo.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 327 initEClass(xmlMapEClass, XMLMap.class, "XMLMap", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getXMLMap_IDAttributeName(), theEcorePackage.getEString(), "iDAttributeName", null, 0, 1, XMLMap.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getXMLMap_EcoreToXMLInfo(), this.getENamedElementToXMLInfoMapEntry(), null, "ecoreToXMLInfo", null, 0, -1, XMLMap.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getXMLMap_NoNamespacePackage(), theEcorePackage.getEPackage(), null, "noNamespacePackage", null, 0, 1, XMLMap.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 332 initEClass(eNamedElementToXMLInfoMapEntryEClass, Map.Entry .class, "ENamedElementToXMLInfoMapEntry", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); initEReference(getENamedElementToXMLInfoMapEntry_Key(), theEcorePackage.getENamedElement(), null, "key", null, 1, 1, Map.Entry .class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getENamedElementToXMLInfoMapEntry_Value(), this.getXMLInfo(), null, "value", null, 1, 1, Map.Entry .class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 336 createResource(eNS_URI); 338 } 339 340 } | Popular Tags |