| /******************************************************************************* |
| * Copyright (c) 2015 David Carlson and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * David Carlson (Clinical Cloud Solutions, LLC) - initial API and implementation |
| *******************************************************************************/ |
| /** |
| */ |
| package org.eclipse.mdht.uml.fhir.core.datatype.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.common.util.EList; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.emf.ecore.util.EObjectResolvingEList; |
| |
| import org.eclipse.mdht.uml.fhir.core.datatype.Code; |
| import org.eclipse.mdht.uml.fhir.core.datatype.ElementDefinitionSlicing; |
| import org.eclipse.mdht.uml.fhir.core.datatype.FhirDatatypePackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Element Definition Slicing</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.datatype.impl.ElementDefinitionSlicingImpl#getDiscriminators <em>Discriminator</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.datatype.impl.ElementDefinitionSlicingImpl#getDescription <em>Description</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.datatype.impl.ElementDefinitionSlicingImpl#getOrdered <em>Ordered</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.datatype.impl.ElementDefinitionSlicingImpl#getRules <em>Rules</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ElementDefinitionSlicingImpl extends BackboneElementImpl implements ElementDefinitionSlicing { |
| /** |
| * The cached value of the '{@link #getDiscriminators() <em>Discriminator</em>}' reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDiscriminators() |
| * @generated |
| * @ordered |
| */ |
| protected EList<org.eclipse.mdht.uml.fhir.core.datatype.String> discriminators; |
| |
| /** |
| * The cached value of the '{@link #getDescription() <em>Description</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDescription() |
| * @generated |
| * @ordered |
| */ |
| protected org.eclipse.mdht.uml.fhir.core.datatype.String description; |
| |
| /** |
| * The cached value of the '{@link #getOrdered() <em>Ordered</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOrdered() |
| * @generated |
| * @ordered |
| */ |
| protected org.eclipse.mdht.uml.fhir.core.datatype.Boolean ordered; |
| |
| /** |
| * The cached value of the '{@link #getRules() <em>Rules</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRules() |
| * @generated |
| * @ordered |
| */ |
| protected Code rules; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ElementDefinitionSlicingImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirDatatypePackage.Literals.ELEMENT_DEFINITION_SLICING; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<org.eclipse.mdht.uml.fhir.core.datatype.String> getDiscriminators() { |
| if (discriminators == null) { |
| discriminators = new EObjectResolvingEList<org.eclipse.mdht.uml.fhir.core.datatype.String>(org.eclipse.mdht.uml.fhir.core.datatype.String.class, this, FhirDatatypePackage.ELEMENT_DEFINITION_SLICING__DISCRIMINATOR); |
| } |
| return discriminators; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String getDescription() { |
| if (description != null && description.eIsProxy()) { |
| InternalEObject oldDescription = (InternalEObject)description; |
| description = (org.eclipse.mdht.uml.fhir.core.datatype.String)eResolveProxy(oldDescription); |
| if (description != oldDescription) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirDatatypePackage.ELEMENT_DEFINITION_SLICING__DESCRIPTION, oldDescription, description)); |
| } |
| } |
| return description; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String basicGetDescription() { |
| return description; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDescription(org.eclipse.mdht.uml.fhir.core.datatype.String newDescription) { |
| org.eclipse.mdht.uml.fhir.core.datatype.String oldDescription = description; |
| description = newDescription; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirDatatypePackage.ELEMENT_DEFINITION_SLICING__DESCRIPTION, oldDescription, description)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.Boolean getOrdered() { |
| if (ordered != null && ordered.eIsProxy()) { |
| InternalEObject oldOrdered = (InternalEObject)ordered; |
| ordered = (org.eclipse.mdht.uml.fhir.core.datatype.Boolean)eResolveProxy(oldOrdered); |
| if (ordered != oldOrdered) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirDatatypePackage.ELEMENT_DEFINITION_SLICING__ORDERED, oldOrdered, ordered)); |
| } |
| } |
| return ordered; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.Boolean basicGetOrdered() { |
| return ordered; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setOrdered(org.eclipse.mdht.uml.fhir.core.datatype.Boolean newOrdered) { |
| org.eclipse.mdht.uml.fhir.core.datatype.Boolean oldOrdered = ordered; |
| ordered = newOrdered; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirDatatypePackage.ELEMENT_DEFINITION_SLICING__ORDERED, oldOrdered, ordered)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code getRules() { |
| if (rules != null && rules.eIsProxy()) { |
| InternalEObject oldRules = (InternalEObject)rules; |
| rules = (Code)eResolveProxy(oldRules); |
| if (rules != oldRules) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirDatatypePackage.ELEMENT_DEFINITION_SLICING__RULES, oldRules, rules)); |
| } |
| } |
| return rules; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code basicGetRules() { |
| return rules; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setRules(Code newRules) { |
| Code oldRules = rules; |
| rules = newRules; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirDatatypePackage.ELEMENT_DEFINITION_SLICING__RULES, oldRules, rules)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case FhirDatatypePackage.ELEMENT_DEFINITION_SLICING__DISCRIMINATOR: |
| return getDiscriminators(); |
| case FhirDatatypePackage.ELEMENT_DEFINITION_SLICING__DESCRIPTION: |
| if (resolve) return getDescription(); |
| return basicGetDescription(); |
| case FhirDatatypePackage.ELEMENT_DEFINITION_SLICING__ORDERED: |
| if (resolve) return getOrdered(); |
| return basicGetOrdered(); |
| case FhirDatatypePackage.ELEMENT_DEFINITION_SLICING__RULES: |
| if (resolve) return getRules(); |
| return basicGetRules(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case FhirDatatypePackage.ELEMENT_DEFINITION_SLICING__DISCRIMINATOR: |
| getDiscriminators().clear(); |
| getDiscriminators().addAll((Collection<? extends org.eclipse.mdht.uml.fhir.core.datatype.String>)newValue); |
| return; |
| case FhirDatatypePackage.ELEMENT_DEFINITION_SLICING__DESCRIPTION: |
| setDescription((org.eclipse.mdht.uml.fhir.core.datatype.String)newValue); |
| return; |
| case FhirDatatypePackage.ELEMENT_DEFINITION_SLICING__ORDERED: |
| setOrdered((org.eclipse.mdht.uml.fhir.core.datatype.Boolean)newValue); |
| return; |
| case FhirDatatypePackage.ELEMENT_DEFINITION_SLICING__RULES: |
| setRules((Code)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirDatatypePackage.ELEMENT_DEFINITION_SLICING__DISCRIMINATOR: |
| getDiscriminators().clear(); |
| return; |
| case FhirDatatypePackage.ELEMENT_DEFINITION_SLICING__DESCRIPTION: |
| setDescription((org.eclipse.mdht.uml.fhir.core.datatype.String)null); |
| return; |
| case FhirDatatypePackage.ELEMENT_DEFINITION_SLICING__ORDERED: |
| setOrdered((org.eclipse.mdht.uml.fhir.core.datatype.Boolean)null); |
| return; |
| case FhirDatatypePackage.ELEMENT_DEFINITION_SLICING__RULES: |
| setRules((Code)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirDatatypePackage.ELEMENT_DEFINITION_SLICING__DISCRIMINATOR: |
| return discriminators != null && !discriminators.isEmpty(); |
| case FhirDatatypePackage.ELEMENT_DEFINITION_SLICING__DESCRIPTION: |
| return description != null; |
| case FhirDatatypePackage.ELEMENT_DEFINITION_SLICING__ORDERED: |
| return ordered != null; |
| case FhirDatatypePackage.ELEMENT_DEFINITION_SLICING__RULES: |
| return rules != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //ElementDefinitionSlicingImpl |