blob: 7c9c860af2c9f4096bbf18fce7e516c035ad6448 [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.Canonical;
import org.hl7.fhir.CapabilityStatementDocument;
import org.hl7.fhir.DocumentMode;
import org.hl7.fhir.FhirPackage;
import org.hl7.fhir.Markdown;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Capability Statement Document</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.impl.CapabilityStatementDocumentImpl#getMode <em>Mode</em>}</li>
* <li>{@link org.hl7.fhir.impl.CapabilityStatementDocumentImpl#getDocumentation <em>Documentation</em>}</li>
* <li>{@link org.hl7.fhir.impl.CapabilityStatementDocumentImpl#getProfile <em>Profile</em>}</li>
* </ul>
*
* @generated
*/
public class CapabilityStatementDocumentImpl extends BackboneElementImpl implements CapabilityStatementDocument {
/**
* The cached value of the '{@link #getMode() <em>Mode</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMode()
* @generated
* @ordered
*/
protected DocumentMode mode;
/**
* The cached value of the '{@link #getDocumentation() <em>Documentation</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDocumentation()
* @generated
* @ordered
*/
protected Markdown documentation;
/**
* The cached value of the '{@link #getProfile() <em>Profile</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getProfile()
* @generated
* @ordered
*/
protected Canonical profile;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected CapabilityStatementDocumentImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getCapabilityStatementDocument();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DocumentMode getMode() {
return mode;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetMode(DocumentMode newMode, NotificationChain msgs) {
DocumentMode oldMode = mode;
mode = newMode;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__MODE, oldMode, newMode);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMode(DocumentMode newMode) {
if (newMode != mode) {
NotificationChain msgs = null;
if (mode != null)
msgs = ((InternalEObject)mode).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__MODE, null, msgs);
if (newMode != null)
msgs = ((InternalEObject)newMode).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__MODE, null, msgs);
msgs = basicSetMode(newMode, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__MODE, newMode, newMode));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Markdown getDocumentation() {
return documentation;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetDocumentation(Markdown newDocumentation, NotificationChain msgs) {
Markdown oldDocumentation = documentation;
documentation = newDocumentation;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__DOCUMENTATION, oldDocumentation, newDocumentation);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDocumentation(Markdown newDocumentation) {
if (newDocumentation != documentation) {
NotificationChain msgs = null;
if (documentation != null)
msgs = ((InternalEObject)documentation).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__DOCUMENTATION, null, msgs);
if (newDocumentation != null)
msgs = ((InternalEObject)newDocumentation).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__DOCUMENTATION, null, msgs);
msgs = basicSetDocumentation(newDocumentation, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__DOCUMENTATION, newDocumentation, newDocumentation));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Canonical getProfile() {
return profile;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetProfile(Canonical newProfile, NotificationChain msgs) {
Canonical oldProfile = profile;
profile = newProfile;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__PROFILE, oldProfile, newProfile);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setProfile(Canonical newProfile) {
if (newProfile != profile) {
NotificationChain msgs = null;
if (profile != null)
msgs = ((InternalEObject)profile).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__PROFILE, null, msgs);
if (newProfile != null)
msgs = ((InternalEObject)newProfile).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__PROFILE, null, msgs);
msgs = basicSetProfile(newProfile, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__PROFILE, newProfile, newProfile));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__MODE:
return basicSetMode(null, msgs);
case FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__DOCUMENTATION:
return basicSetDocumentation(null, msgs);
case FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__PROFILE:
return basicSetProfile(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.CAPABILITY_STATEMENT_DOCUMENT__MODE:
return getMode();
case FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__DOCUMENTATION:
return getDocumentation();
case FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__PROFILE:
return getProfile();
}
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.CAPABILITY_STATEMENT_DOCUMENT__MODE:
setMode((DocumentMode)newValue);
return;
case FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__DOCUMENTATION:
setDocumentation((Markdown)newValue);
return;
case FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__PROFILE:
setProfile((Canonical)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__MODE:
setMode((DocumentMode)null);
return;
case FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__DOCUMENTATION:
setDocumentation((Markdown)null);
return;
case FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__PROFILE:
setProfile((Canonical)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__MODE:
return mode != null;
case FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__DOCUMENTATION:
return documentation != null;
case FhirPackage.CAPABILITY_STATEMENT_DOCUMENT__PROFILE:
return profile != null;
}
return super.eIsSet(featureID);
}
} //CapabilityStatementDocumentImpl