| /** |
| */ |
| package org.hl7.fhir.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.hl7.fhir.DocumentReferenceRelatesTo; |
| import org.hl7.fhir.DocumentRelationshipType; |
| import org.hl7.fhir.FhirPackage; |
| import org.hl7.fhir.Reference; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Document Reference Relates To</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.hl7.fhir.impl.DocumentReferenceRelatesToImpl#getCode <em>Code</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.DocumentReferenceRelatesToImpl#getTarget <em>Target</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DocumentReferenceRelatesToImpl extends BackboneElementImpl implements DocumentReferenceRelatesTo { |
| /** |
| * The cached value of the '{@link #getCode() <em>Code</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCode() |
| * @generated |
| * @ordered |
| */ |
| protected DocumentRelationshipType code; |
| |
| /** |
| * The cached value of the '{@link #getTarget() <em>Target</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTarget() |
| * @generated |
| * @ordered |
| */ |
| protected Reference target; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DocumentReferenceRelatesToImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirPackage.eINSTANCE.getDocumentReferenceRelatesTo(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DocumentRelationshipType getCode() { |
| return code; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetCode(DocumentRelationshipType newCode, NotificationChain msgs) { |
| DocumentRelationshipType oldCode = code; |
| code = newCode; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.DOCUMENT_REFERENCE_RELATES_TO__CODE, oldCode, newCode); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setCode(DocumentRelationshipType newCode) { |
| if (newCode != code) { |
| NotificationChain msgs = null; |
| if (code != null) |
| msgs = ((InternalEObject)code).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.DOCUMENT_REFERENCE_RELATES_TO__CODE, null, msgs); |
| if (newCode != null) |
| msgs = ((InternalEObject)newCode).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.DOCUMENT_REFERENCE_RELATES_TO__CODE, null, msgs); |
| msgs = basicSetCode(newCode, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.DOCUMENT_REFERENCE_RELATES_TO__CODE, newCode, newCode)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Reference getTarget() { |
| return target; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetTarget(Reference newTarget, NotificationChain msgs) { |
| Reference oldTarget = target; |
| target = newTarget; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.DOCUMENT_REFERENCE_RELATES_TO__TARGET, oldTarget, newTarget); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setTarget(Reference newTarget) { |
| if (newTarget != target) { |
| NotificationChain msgs = null; |
| if (target != null) |
| msgs = ((InternalEObject)target).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.DOCUMENT_REFERENCE_RELATES_TO__TARGET, null, msgs); |
| if (newTarget != null) |
| msgs = ((InternalEObject)newTarget).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.DOCUMENT_REFERENCE_RELATES_TO__TARGET, null, msgs); |
| msgs = basicSetTarget(newTarget, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.DOCUMENT_REFERENCE_RELATES_TO__TARGET, newTarget, newTarget)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case FhirPackage.DOCUMENT_REFERENCE_RELATES_TO__CODE: |
| return basicSetCode(null, msgs); |
| case FhirPackage.DOCUMENT_REFERENCE_RELATES_TO__TARGET: |
| return basicSetTarget(null, msgs); |
| } |
| return super.eInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case FhirPackage.DOCUMENT_REFERENCE_RELATES_TO__CODE: |
| return getCode(); |
| case FhirPackage.DOCUMENT_REFERENCE_RELATES_TO__TARGET: |
| return getTarget(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case FhirPackage.DOCUMENT_REFERENCE_RELATES_TO__CODE: |
| setCode((DocumentRelationshipType)newValue); |
| return; |
| case FhirPackage.DOCUMENT_REFERENCE_RELATES_TO__TARGET: |
| setTarget((Reference)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirPackage.DOCUMENT_REFERENCE_RELATES_TO__CODE: |
| setCode((DocumentRelationshipType)null); |
| return; |
| case FhirPackage.DOCUMENT_REFERENCE_RELATES_TO__TARGET: |
| setTarget((Reference)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirPackage.DOCUMENT_REFERENCE_RELATES_TO__CODE: |
| return code != null; |
| case FhirPackage.DOCUMENT_REFERENCE_RELATES_TO__TARGET: |
| return target != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //DocumentReferenceRelatesToImpl |