1 7 package org.enhydra.dods.editor.Doml.impl; 8 9 import java.util.Collection ; 10 11 import org.eclipse.emf.common.notify.NotificationChain; 12 13 import org.eclipse.emf.common.util.EMap; 14 15 import org.eclipse.emf.ecore.EClass; 16 import org.eclipse.emf.ecore.EStructuralFeature; 17 import org.eclipse.emf.ecore.EcorePackage; 18 import org.eclipse.emf.ecore.InternalEObject; 19 20 import org.eclipse.emf.ecore.impl.EObjectImpl; 21 import org.eclipse.emf.ecore.impl.EStringToStringMapEntryImpl; 22 23 import org.eclipse.emf.ecore.util.BasicFeatureMap; 24 import org.eclipse.emf.ecore.util.EcoreEMap; 25 import org.eclipse.emf.ecore.util.FeatureMap; 26 import org.eclipse.emf.ecore.util.InternalEList; 27 28 import org.enhydra.dods.editor.Doml.ColumnType; 29 import org.enhydra.dods.editor.Doml.DatabaseType; 30 import org.enhydra.dods.editor.Doml.DocumentRoot; 31 import org.enhydra.dods.editor.Doml.DomlPackage; 32 import org.enhydra.dods.editor.Doml.DomlType; 33 import org.enhydra.dods.editor.Doml.IndexColumnType; 34 import org.enhydra.dods.editor.Doml.IndexType; 35 import org.enhydra.dods.editor.Doml.PackageType; 36 import org.enhydra.dods.editor.Doml.ReferenceObjectType; 37 import org.enhydra.dods.editor.Doml.TableType; 38 import org.enhydra.dods.editor.Doml.TypeType; 39 40 64 public class DocumentRootImpl extends EObjectImpl implements DocumentRoot { 65 73 protected FeatureMap mixed = null; 74 75 83 protected EMap xMLNSPrefixMap = null; 84 85 93 protected EMap xSISchemaLocation = null; 94 95 100 protected DocumentRootImpl() { 101 super(); 102 } 103 104 109 protected EClass eStaticClass() { 110 return DomlPackage.eINSTANCE.getDocumentRoot(); 111 } 112 113 118 public FeatureMap getMixed() { 119 if (mixed == null) { 120 mixed = new BasicFeatureMap(this, DomlPackage.DOCUMENT_ROOT__MIXED); 121 } 122 return mixed; 123 } 124 125 130 public EMap getXMLNSPrefixMap() { 131 if (xMLNSPrefixMap == null) { 132 xMLNSPrefixMap = new EcoreEMap(EcorePackage.eINSTANCE.getEStringToStringMapEntry(), EStringToStringMapEntryImpl.class, this, DomlPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP); 133 } 134 return xMLNSPrefixMap; 135 } 136 137 142 public EMap getXSISchemaLocation() { 143 if (xSISchemaLocation == null) { 144 xSISchemaLocation = new EcoreEMap(EcorePackage.eINSTANCE.getEStringToStringMapEntry(), EStringToStringMapEntryImpl.class, this, DomlPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION); 145 } 146 return xSISchemaLocation; 147 } 148 149 154 public ColumnType getColumn() { 155 return (ColumnType)getMixed().get(DomlPackage.eINSTANCE.getDocumentRoot_Column(), true); 156 } 157 158 163 public NotificationChain basicSetColumn(ColumnType newColumn, NotificationChain msgs) { 164 return ((FeatureMap.Internal)getMixed()).basicAdd(DomlPackage.eINSTANCE.getDocumentRoot_Column(), newColumn, null); 165 } 166 167 172 public void setColumn(ColumnType newColumn) { 173 ((FeatureMap.Internal)getMixed()).set(DomlPackage.eINSTANCE.getDocumentRoot_Column(), newColumn); 174 } 175 176 181 public DatabaseType getDatabase() { 182 return (DatabaseType)getMixed().get(DomlPackage.eINSTANCE.getDocumentRoot_Database(), true); 183 } 184 185 190 public NotificationChain basicSetDatabase(DatabaseType newDatabase, NotificationChain msgs) { 191 return ((FeatureMap.Internal)getMixed()).basicAdd(DomlPackage.eINSTANCE.getDocumentRoot_Database(), newDatabase, null); 192 } 193 194 199 public void setDatabase(DatabaseType newDatabase) { 200 ((FeatureMap.Internal)getMixed()).set(DomlPackage.eINSTANCE.getDocumentRoot_Database(), newDatabase); 201 } 202 203 208 public DomlType getDoml() { 209 return (DomlType)getMixed().get(DomlPackage.eINSTANCE.getDocumentRoot_Doml(), true); 210 } 211 212 217 public NotificationChain basicSetDoml(DomlType newDoml, NotificationChain msgs) { 218 return ((FeatureMap.Internal)getMixed()).basicAdd(DomlPackage.eINSTANCE.getDocumentRoot_Doml(), newDoml, null); 219 } 220 221 226 public void setDoml(DomlType newDoml) { 227 ((FeatureMap.Internal)getMixed()).set(DomlPackage.eINSTANCE.getDocumentRoot_Doml(), newDoml); 228 } 229 230 235 public IndexType getIndex() { 236 return (IndexType)getMixed().get(DomlPackage.eINSTANCE.getDocumentRoot_Index(), true); 237 } 238 239 244 public NotificationChain basicSetIndex(IndexType newIndex, NotificationChain msgs) { 245 return ((FeatureMap.Internal)getMixed()).basicAdd(DomlPackage.eINSTANCE.getDocumentRoot_Index(), newIndex, null); 246 } 247 248 253 public void setIndex(IndexType newIndex) { 254 ((FeatureMap.Internal)getMixed()).set(DomlPackage.eINSTANCE.getDocumentRoot_Index(), newIndex); 255 } 256 257 262 public IndexColumnType getIndexColumn() { 263 return (IndexColumnType)getMixed().get(DomlPackage.eINSTANCE.getDocumentRoot_IndexColumn(), true); 264 } 265 266 271 public NotificationChain basicSetIndexColumn(IndexColumnType newIndexColumn, NotificationChain msgs) { 272 return ((FeatureMap.Internal)getMixed()).basicAdd(DomlPackage.eINSTANCE.getDocumentRoot_IndexColumn(), newIndexColumn, null); 273 } 274 275 280 public void setIndexColumn(IndexColumnType newIndexColumn) { 281 ((FeatureMap.Internal)getMixed()).set(DomlPackage.eINSTANCE.getDocumentRoot_IndexColumn(), newIndexColumn); 282 } 283 284 289 public PackageType getPackage() { 290 return (PackageType)getMixed().get(DomlPackage.eINSTANCE.getDocumentRoot_Package(), true); 291 } 292 293 298 public NotificationChain basicSetPackage(PackageType newPackage, NotificationChain msgs) { 299 return ((FeatureMap.Internal)getMixed()).basicAdd(DomlPackage.eINSTANCE.getDocumentRoot_Package(), newPackage, null); 300 } 301 302 307 public void setPackage(PackageType newPackage) { 308 ((FeatureMap.Internal)getMixed()).set(DomlPackage.eINSTANCE.getDocumentRoot_Package(), newPackage); 309 } 310 311 316 public ReferenceObjectType getReferenceObject() { 317 return (ReferenceObjectType)getMixed().get(DomlPackage.eINSTANCE.getDocumentRoot_ReferenceObject(), true); 318 } 319 320 325 public NotificationChain basicSetReferenceObject(ReferenceObjectType newReferenceObject, NotificationChain msgs) { 326 return ((FeatureMap.Internal)getMixed()).basicAdd(DomlPackage.eINSTANCE.getDocumentRoot_ReferenceObject(), newReferenceObject, null); 327 } 328 329 334 public void setReferenceObject(ReferenceObjectType newReferenceObject) { 335 ((FeatureMap.Internal)getMixed()).set(DomlPackage.eINSTANCE.getDocumentRoot_ReferenceObject(), newReferenceObject); 336 } 337 338 343 public TableType getTable() { 344 return (TableType)getMixed().get(DomlPackage.eINSTANCE.getDocumentRoot_Table(), true); 345 } 346 347 352 public NotificationChain basicSetTable(TableType newTable, NotificationChain msgs) { 353 return ((FeatureMap.Internal)getMixed()).basicAdd(DomlPackage.eINSTANCE.getDocumentRoot_Table(), newTable, null); 354 } 355 356 361 public void setTable(TableType newTable) { 362 ((FeatureMap.Internal)getMixed()).set(DomlPackage.eINSTANCE.getDocumentRoot_Table(), newTable); 363 } 364 365 370 public TypeType getType() { 371 return (TypeType)getMixed().get(DomlPackage.eINSTANCE.getDocumentRoot_Type(), true); 372 } 373 374 379 public NotificationChain basicSetType(TypeType newType, NotificationChain msgs) { 380 return ((FeatureMap.Internal)getMixed()).basicAdd(DomlPackage.eINSTANCE.getDocumentRoot_Type(), newType, null); 381 } 382 383 388 public void setType(TypeType newType) { 389 ((FeatureMap.Internal)getMixed()).set(DomlPackage.eINSTANCE.getDocumentRoot_Type(), newType); 390 } 391 392 397 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { 398 if (featureID >= 0) { 399 switch (eDerivedStructuralFeatureID(featureID, baseClass)) { 400 case DomlPackage.DOCUMENT_ROOT__MIXED: 401 return ((InternalEList)getMixed()).basicRemove(otherEnd, msgs); 402 case DomlPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: 403 return ((InternalEList)getXMLNSPrefixMap()).basicRemove(otherEnd, msgs); 404 case DomlPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: 405 return ((InternalEList)getXSISchemaLocation()).basicRemove(otherEnd, msgs); 406 case DomlPackage.DOCUMENT_ROOT__COLUMN: 407 return basicSetColumn(null, msgs); 408 case DomlPackage.DOCUMENT_ROOT__DATABASE: 409 return basicSetDatabase(null, msgs); 410 case DomlPackage.DOCUMENT_ROOT__DOML: 411 return basicSetDoml(null, msgs); 412 case DomlPackage.DOCUMENT_ROOT__INDEX: 413 return basicSetIndex(null, msgs); 414 case DomlPackage.DOCUMENT_ROOT__INDEX_COLUMN: 415 return basicSetIndexColumn(null, msgs); 416 case DomlPackage.DOCUMENT_ROOT__PACKAGE: 417 return basicSetPackage(null, msgs); 418 case DomlPackage.DOCUMENT_ROOT__REFERENCE_OBJECT: 419 return basicSetReferenceObject(null, msgs); 420 case DomlPackage.DOCUMENT_ROOT__TABLE: 421 return basicSetTable(null, msgs); 422 case DomlPackage.DOCUMENT_ROOT__TYPE: 423 return basicSetType(null, msgs); 424 default: 425 return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); 426 } 427 } 428 return eBasicSetContainer(null, featureID, msgs); 429 } 430 431 436 public Object eGet(EStructuralFeature eFeature, boolean resolve) { 437 switch (eDerivedStructuralFeatureID(eFeature)) { 438 case DomlPackage.DOCUMENT_ROOT__MIXED: 439 return getMixed(); 440 case DomlPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: 441 return getXMLNSPrefixMap(); 442 case DomlPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: 443 return getXSISchemaLocation(); 444 case DomlPackage.DOCUMENT_ROOT__COLUMN: 445 return getColumn(); 446 case DomlPackage.DOCUMENT_ROOT__DATABASE: 447 return getDatabase(); 448 case DomlPackage.DOCUMENT_ROOT__DOML: 449 return getDoml(); 450 case DomlPackage.DOCUMENT_ROOT__INDEX: 451 return getIndex(); 452 case DomlPackage.DOCUMENT_ROOT__INDEX_COLUMN: 453 return getIndexColumn(); 454 case DomlPackage.DOCUMENT_ROOT__PACKAGE: 455 return getPackage(); 456 case DomlPackage.DOCUMENT_ROOT__REFERENCE_OBJECT: 457 return getReferenceObject(); 458 case DomlPackage.DOCUMENT_ROOT__TABLE: 459 return getTable(); 460 case DomlPackage.DOCUMENT_ROOT__TYPE: 461 return getType(); 462 } 463 return eDynamicGet(eFeature, resolve); 464 } 465 466 471 public void eSet(EStructuralFeature eFeature, Object newValue) { 472 switch (eDerivedStructuralFeatureID(eFeature)) { 473 case DomlPackage.DOCUMENT_ROOT__MIXED: 474 getMixed().clear(); 475 getMixed().addAll((Collection )newValue); 476 return; 477 case DomlPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: 478 getXMLNSPrefixMap().clear(); 479 getXMLNSPrefixMap().addAll((Collection )newValue); 480 return; 481 case DomlPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: 482 getXSISchemaLocation().clear(); 483 getXSISchemaLocation().addAll((Collection )newValue); 484 return; 485 case DomlPackage.DOCUMENT_ROOT__COLUMN: 486 setColumn((ColumnType)newValue); 487 return; 488 case DomlPackage.DOCUMENT_ROOT__DATABASE: 489 setDatabase((DatabaseType)newValue); 490 return; 491 case DomlPackage.DOCUMENT_ROOT__DOML: 492 setDoml((DomlType)newValue); 493 return; 494 case DomlPackage.DOCUMENT_ROOT__INDEX: 495 setIndex((IndexType)newValue); 496 return; 497 case DomlPackage.DOCUMENT_ROOT__INDEX_COLUMN: 498 setIndexColumn((IndexColumnType)newValue); 499 return; 500 case DomlPackage.DOCUMENT_ROOT__PACKAGE: 501 setPackage((PackageType)newValue); 502 return; 503 case DomlPackage.DOCUMENT_ROOT__REFERENCE_OBJECT: 504 setReferenceObject((ReferenceObjectType)newValue); 505 return; 506 case DomlPackage.DOCUMENT_ROOT__TABLE: 507 setTable((TableType)newValue); 508 return; 509 case DomlPackage.DOCUMENT_ROOT__TYPE: 510 setType((TypeType)newValue); 511 return; 512 } 513 eDynamicSet(eFeature, newValue); 514 } 515 516 521 public void eUnset(EStructuralFeature eFeature) { 522 switch (eDerivedStructuralFeatureID(eFeature)) { 523 case DomlPackage.DOCUMENT_ROOT__MIXED: 524 getMixed().clear(); 525 return; 526 case DomlPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: 527 getXMLNSPrefixMap().clear(); 528 return; 529 case DomlPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: 530 getXSISchemaLocation().clear(); 531 return; 532 case DomlPackage.DOCUMENT_ROOT__COLUMN: 533 setColumn((ColumnType)null); 534 return; 535 case DomlPackage.DOCUMENT_ROOT__DATABASE: 536 setDatabase((DatabaseType)null); 537 return; 538 case DomlPackage.DOCUMENT_ROOT__DOML: 539 setDoml((DomlType)null); 540 return; 541 case DomlPackage.DOCUMENT_ROOT__INDEX: 542 setIndex((IndexType)null); 543 return; 544 case DomlPackage.DOCUMENT_ROOT__INDEX_COLUMN: 545 setIndexColumn((IndexColumnType)null); 546 return; 547 case DomlPackage.DOCUMENT_ROOT__PACKAGE: 548 setPackage((PackageType)null); 549 return; 550 case DomlPackage.DOCUMENT_ROOT__REFERENCE_OBJECT: 551 setReferenceObject((ReferenceObjectType)null); 552 return; 553 case DomlPackage.DOCUMENT_ROOT__TABLE: 554 setTable((TableType)null); 555 return; 556 case DomlPackage.DOCUMENT_ROOT__TYPE: 557 setType((TypeType)null); 558 return; 559 } 560 eDynamicUnset(eFeature); 561 } 562 563 568 public boolean eIsSet(EStructuralFeature eFeature) { 569 switch (eDerivedStructuralFeatureID(eFeature)) { 570 case DomlPackage.DOCUMENT_ROOT__MIXED: 571 return mixed != null && !mixed.isEmpty(); 572 case DomlPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: 573 return xMLNSPrefixMap != null && !xMLNSPrefixMap.isEmpty(); 574 case DomlPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: 575 return xSISchemaLocation != null && !xSISchemaLocation.isEmpty(); 576 case DomlPackage.DOCUMENT_ROOT__COLUMN: 577 return getColumn() != null; 578 case DomlPackage.DOCUMENT_ROOT__DATABASE: 579 return getDatabase() != null; 580 case DomlPackage.DOCUMENT_ROOT__DOML: 581 return getDoml() != null; 582 case DomlPackage.DOCUMENT_ROOT__INDEX: 583 return getIndex() != null; 584 case DomlPackage.DOCUMENT_ROOT__INDEX_COLUMN: 585 return getIndexColumn() != null; 586 case DomlPackage.DOCUMENT_ROOT__PACKAGE: 587 return getPackage() != null; 588 case DomlPackage.DOCUMENT_ROOT__REFERENCE_OBJECT: 589 return getReferenceObject() != null; 590 case DomlPackage.DOCUMENT_ROOT__TABLE: 591 return getTable() != null; 592 case DomlPackage.DOCUMENT_ROOT__TYPE: 593 return getType() != null; 594 } 595 return eDynamicIsSet(eFeature); 596 } 597 598 603 public String toString() { 604 if (eIsProxy()) return super.toString(); 605 606 StringBuffer result = new StringBuffer (super.toString()); 607 result.append(" (mixed: "); 608 result.append(mixed); 609 result.append(')'); 610 return result.toString(); 611 } 612 613 } | Popular Tags |