blob: d1c3958dc19a9602e606a314d35ccad13c61fd64 [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.ConstraintSeverity;
import org.hl7.fhir.ElementDefinitionConstraint;
import org.hl7.fhir.FhirPackage;
import org.hl7.fhir.Id;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Element Definition Constraint</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.impl.ElementDefinitionConstraintImpl#getKey <em>Key</em>}</li>
* <li>{@link org.hl7.fhir.impl.ElementDefinitionConstraintImpl#getRequirements <em>Requirements</em>}</li>
* <li>{@link org.hl7.fhir.impl.ElementDefinitionConstraintImpl#getSeverity <em>Severity</em>}</li>
* <li>{@link org.hl7.fhir.impl.ElementDefinitionConstraintImpl#getHuman <em>Human</em>}</li>
* <li>{@link org.hl7.fhir.impl.ElementDefinitionConstraintImpl#getXpath <em>Xpath</em>}</li>
* </ul>
*
* @generated
*/
public class ElementDefinitionConstraintImpl extends ElementImpl implements ElementDefinitionConstraint {
/**
* The cached value of the '{@link #getKey() <em>Key</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getKey()
* @generated
* @ordered
*/
protected Id key;
/**
* The cached value of the '{@link #getRequirements() <em>Requirements</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRequirements()
* @generated
* @ordered
*/
protected org.hl7.fhir.String requirements;
/**
* The cached value of the '{@link #getSeverity() <em>Severity</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSeverity()
* @generated
* @ordered
*/
protected ConstraintSeverity severity;
/**
* The cached value of the '{@link #getHuman() <em>Human</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getHuman()
* @generated
* @ordered
*/
protected org.hl7.fhir.String human;
/**
* The cached value of the '{@link #getXpath() <em>Xpath</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getXpath()
* @generated
* @ordered
*/
protected org.hl7.fhir.String xpath;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ElementDefinitionConstraintImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getElementDefinitionConstraint();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Id getKey() {
return key;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetKey(Id newKey, NotificationChain msgs) {
Id oldKey = key;
key = newKey;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__KEY, oldKey, newKey);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setKey(Id newKey) {
if (newKey != key) {
NotificationChain msgs = null;
if (key != null)
msgs = ((InternalEObject)key).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__KEY, null, msgs);
if (newKey != null)
msgs = ((InternalEObject)newKey).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__KEY, null, msgs);
msgs = basicSetKey(newKey, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__KEY, newKey, newKey));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.hl7.fhir.String getRequirements() {
return requirements;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetRequirements(org.hl7.fhir.String newRequirements, NotificationChain msgs) {
org.hl7.fhir.String oldRequirements = requirements;
requirements = newRequirements;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__REQUIREMENTS, oldRequirements, newRequirements);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRequirements(org.hl7.fhir.String newRequirements) {
if (newRequirements != requirements) {
NotificationChain msgs = null;
if (requirements != null)
msgs = ((InternalEObject)requirements).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__REQUIREMENTS, null, msgs);
if (newRequirements != null)
msgs = ((InternalEObject)newRequirements).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__REQUIREMENTS, null, msgs);
msgs = basicSetRequirements(newRequirements, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__REQUIREMENTS, newRequirements, newRequirements));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ConstraintSeverity getSeverity() {
return severity;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetSeverity(ConstraintSeverity newSeverity, NotificationChain msgs) {
ConstraintSeverity oldSeverity = severity;
severity = newSeverity;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__SEVERITY, oldSeverity, newSeverity);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSeverity(ConstraintSeverity newSeverity) {
if (newSeverity != severity) {
NotificationChain msgs = null;
if (severity != null)
msgs = ((InternalEObject)severity).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__SEVERITY, null, msgs);
if (newSeverity != null)
msgs = ((InternalEObject)newSeverity).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__SEVERITY, null, msgs);
msgs = basicSetSeverity(newSeverity, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__SEVERITY, newSeverity, newSeverity));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.hl7.fhir.String getHuman() {
return human;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetHuman(org.hl7.fhir.String newHuman, NotificationChain msgs) {
org.hl7.fhir.String oldHuman = human;
human = newHuman;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__HUMAN, oldHuman, newHuman);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setHuman(org.hl7.fhir.String newHuman) {
if (newHuman != human) {
NotificationChain msgs = null;
if (human != null)
msgs = ((InternalEObject)human).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__HUMAN, null, msgs);
if (newHuman != null)
msgs = ((InternalEObject)newHuman).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__HUMAN, null, msgs);
msgs = basicSetHuman(newHuman, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__HUMAN, newHuman, newHuman));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.hl7.fhir.String getXpath() {
return xpath;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetXpath(org.hl7.fhir.String newXpath, NotificationChain msgs) {
org.hl7.fhir.String oldXpath = xpath;
xpath = newXpath;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__XPATH, oldXpath, newXpath);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setXpath(org.hl7.fhir.String newXpath) {
if (newXpath != xpath) {
NotificationChain msgs = null;
if (xpath != null)
msgs = ((InternalEObject)xpath).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__XPATH, null, msgs);
if (newXpath != null)
msgs = ((InternalEObject)newXpath).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__XPATH, null, msgs);
msgs = basicSetXpath(newXpath, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__XPATH, newXpath, newXpath));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__KEY:
return basicSetKey(null, msgs);
case FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__REQUIREMENTS:
return basicSetRequirements(null, msgs);
case FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__SEVERITY:
return basicSetSeverity(null, msgs);
case FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__HUMAN:
return basicSetHuman(null, msgs);
case FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__XPATH:
return basicSetXpath(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.ELEMENT_DEFINITION_CONSTRAINT__KEY:
return getKey();
case FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__REQUIREMENTS:
return getRequirements();
case FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__SEVERITY:
return getSeverity();
case FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__HUMAN:
return getHuman();
case FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__XPATH:
return getXpath();
}
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.ELEMENT_DEFINITION_CONSTRAINT__KEY:
setKey((Id)newValue);
return;
case FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__REQUIREMENTS:
setRequirements((org.hl7.fhir.String)newValue);
return;
case FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__SEVERITY:
setSeverity((ConstraintSeverity)newValue);
return;
case FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__HUMAN:
setHuman((org.hl7.fhir.String)newValue);
return;
case FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__XPATH:
setXpath((org.hl7.fhir.String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__KEY:
setKey((Id)null);
return;
case FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__REQUIREMENTS:
setRequirements((org.hl7.fhir.String)null);
return;
case FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__SEVERITY:
setSeverity((ConstraintSeverity)null);
return;
case FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__HUMAN:
setHuman((org.hl7.fhir.String)null);
return;
case FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__XPATH:
setXpath((org.hl7.fhir.String)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__KEY:
return key != null;
case FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__REQUIREMENTS:
return requirements != null;
case FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__SEVERITY:
return severity != null;
case FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__HUMAN:
return human != null;
case FhirPackage.ELEMENT_DEFINITION_CONSTRAINT__XPATH:
return xpath != null;
}
return super.eIsSet(featureID);
}
} //ElementDefinitionConstraintImpl