blob: a027589bd191543828b1d54ac2531f6b9b9d18de [file] [log] [blame]
/**
*/
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.Attachment;
import org.hl7.fhir.Coding;
import org.hl7.fhir.DocumentReferenceContent;
import org.hl7.fhir.FhirPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Document Reference Content</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.impl.DocumentReferenceContentImpl#getAttachment <em>Attachment</em>}</li>
* <li>{@link org.hl7.fhir.impl.DocumentReferenceContentImpl#getFormat <em>Format</em>}</li>
* </ul>
*
* @generated
*/
public class DocumentReferenceContentImpl extends BackboneElementImpl implements DocumentReferenceContent {
/**
* The cached value of the '{@link #getAttachment() <em>Attachment</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAttachment()
* @generated
* @ordered
*/
protected Attachment attachment;
/**
* The cached value of the '{@link #getFormat() <em>Format</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFormat()
* @generated
* @ordered
*/
protected Coding format;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DocumentReferenceContentImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getDocumentReferenceContent();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Attachment getAttachment() {
return attachment;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetAttachment(Attachment newAttachment, NotificationChain msgs) {
Attachment oldAttachment = attachment;
attachment = newAttachment;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.DOCUMENT_REFERENCE_CONTENT__ATTACHMENT, oldAttachment, newAttachment);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAttachment(Attachment newAttachment) {
if (newAttachment != attachment) {
NotificationChain msgs = null;
if (attachment != null)
msgs = ((InternalEObject)attachment).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.DOCUMENT_REFERENCE_CONTENT__ATTACHMENT, null, msgs);
if (newAttachment != null)
msgs = ((InternalEObject)newAttachment).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.DOCUMENT_REFERENCE_CONTENT__ATTACHMENT, null, msgs);
msgs = basicSetAttachment(newAttachment, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.DOCUMENT_REFERENCE_CONTENT__ATTACHMENT, newAttachment, newAttachment));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Coding getFormat() {
return format;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetFormat(Coding newFormat, NotificationChain msgs) {
Coding oldFormat = format;
format = newFormat;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.DOCUMENT_REFERENCE_CONTENT__FORMAT, oldFormat, newFormat);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setFormat(Coding newFormat) {
if (newFormat != format) {
NotificationChain msgs = null;
if (format != null)
msgs = ((InternalEObject)format).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.DOCUMENT_REFERENCE_CONTENT__FORMAT, null, msgs);
if (newFormat != null)
msgs = ((InternalEObject)newFormat).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.DOCUMENT_REFERENCE_CONTENT__FORMAT, null, msgs);
msgs = basicSetFormat(newFormat, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.DOCUMENT_REFERENCE_CONTENT__FORMAT, newFormat, newFormat));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirPackage.DOCUMENT_REFERENCE_CONTENT__ATTACHMENT:
return basicSetAttachment(null, msgs);
case FhirPackage.DOCUMENT_REFERENCE_CONTENT__FORMAT:
return basicSetFormat(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_CONTENT__ATTACHMENT:
return getAttachment();
case FhirPackage.DOCUMENT_REFERENCE_CONTENT__FORMAT:
return getFormat();
}
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_CONTENT__ATTACHMENT:
setAttachment((Attachment)newValue);
return;
case FhirPackage.DOCUMENT_REFERENCE_CONTENT__FORMAT:
setFormat((Coding)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_CONTENT__ATTACHMENT:
setAttachment((Attachment)null);
return;
case FhirPackage.DOCUMENT_REFERENCE_CONTENT__FORMAT:
setFormat((Coding)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.DOCUMENT_REFERENCE_CONTENT__ATTACHMENT:
return attachment != null;
case FhirPackage.DOCUMENT_REFERENCE_CONTENT__FORMAT:
return format != null;
}
return super.eIsSet(featureID);
}
} //DocumentReferenceContentImpl