| /******************************************************************************* |
| * Copyright (c) 2016 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.resource.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| |
| 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.EObjectContainmentEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| import org.eclipse.mdht.uml.fhir.core.datatype.DataType; |
| |
| import org.eclipse.mdht.uml.fhir.core.datatype.impl.BackboneElementImpl; |
| |
| import org.eclipse.mdht.uml.fhir.core.resource.FhirResourcePackage; |
| import org.eclipse.mdht.uml.fhir.core.resource.ParametersParameter; |
| import org.eclipse.mdht.uml.fhir.core.resource.Resource; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Parameters Parameter</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ParametersParameterImpl#getName <em>Name</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ParametersParameterImpl#getValuex <em>Valuex</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ParametersParameterImpl#getResource <em>Resource</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ParametersParameterImpl#getParts <em>Part</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ParametersParameterImpl extends BackboneElementImpl implements ParametersParameter { |
| /** |
| * The cached value of the '{@link #getName() <em>Name</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected org.eclipse.mdht.uml.fhir.core.datatype.String name; |
| |
| /** |
| * The cached value of the '{@link #getValuex() <em>Valuex</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getValuex() |
| * @generated |
| * @ordered |
| */ |
| protected DataType valuex; |
| |
| /** |
| * The cached value of the '{@link #getResource() <em>Resource</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getResource() |
| * @generated |
| * @ordered |
| */ |
| protected Resource resource; |
| |
| /** |
| * The cached value of the '{@link #getParts() <em>Part</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getParts() |
| * @generated |
| * @ordered |
| */ |
| protected EList<ParametersParameter> parts; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ParametersParameterImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirResourcePackage.eINSTANCE.getParametersParameter(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String getName() { |
| if (name != null && name.eIsProxy()) { |
| InternalEObject oldName = (InternalEObject)name; |
| name = (org.eclipse.mdht.uml.fhir.core.datatype.String)eResolveProxy(oldName); |
| if (name != oldName) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.PARAMETERS_PARAMETER__NAME, oldName, name)); |
| } |
| } |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String basicGetName() { |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setName(org.eclipse.mdht.uml.fhir.core.datatype.String newName) { |
| org.eclipse.mdht.uml.fhir.core.datatype.String oldName = name; |
| name = newName; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.PARAMETERS_PARAMETER__NAME, oldName, name)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DataType getValuex() { |
| if (valuex != null && valuex.eIsProxy()) { |
| InternalEObject oldValuex = (InternalEObject)valuex; |
| valuex = (DataType)eResolveProxy(oldValuex); |
| if (valuex != oldValuex) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.PARAMETERS_PARAMETER__VALUEX, oldValuex, valuex)); |
| } |
| } |
| return valuex; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DataType basicGetValuex() { |
| return valuex; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setValuex(DataType newValuex) { |
| DataType oldValuex = valuex; |
| valuex = newValuex; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.PARAMETERS_PARAMETER__VALUEX, oldValuex, valuex)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Resource getResource() { |
| if (resource != null && resource.eIsProxy()) { |
| InternalEObject oldResource = (InternalEObject)resource; |
| resource = (Resource)eResolveProxy(oldResource); |
| if (resource != oldResource) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.PARAMETERS_PARAMETER__RESOURCE, oldResource, resource)); |
| } |
| } |
| return resource; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Resource basicGetResource() { |
| return resource; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setResource(Resource newResource) { |
| Resource oldResource = resource; |
| resource = newResource; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.PARAMETERS_PARAMETER__RESOURCE, oldResource, resource)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<ParametersParameter> getParts() { |
| if (parts == null) { |
| parts = new EObjectContainmentEList<ParametersParameter>(ParametersParameter.class, this, FhirResourcePackage.PARAMETERS_PARAMETER__PART); |
| } |
| return parts; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case FhirResourcePackage.PARAMETERS_PARAMETER__PART: |
| return ((InternalEList<?>)getParts()).basicRemove(otherEnd, 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 FhirResourcePackage.PARAMETERS_PARAMETER__NAME: |
| if (resolve) return getName(); |
| return basicGetName(); |
| case FhirResourcePackage.PARAMETERS_PARAMETER__VALUEX: |
| if (resolve) return getValuex(); |
| return basicGetValuex(); |
| case FhirResourcePackage.PARAMETERS_PARAMETER__RESOURCE: |
| if (resolve) return getResource(); |
| return basicGetResource(); |
| case FhirResourcePackage.PARAMETERS_PARAMETER__PART: |
| return getParts(); |
| } |
| 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 FhirResourcePackage.PARAMETERS_PARAMETER__NAME: |
| setName((org.eclipse.mdht.uml.fhir.core.datatype.String)newValue); |
| return; |
| case FhirResourcePackage.PARAMETERS_PARAMETER__VALUEX: |
| setValuex((DataType)newValue); |
| return; |
| case FhirResourcePackage.PARAMETERS_PARAMETER__RESOURCE: |
| setResource((Resource)newValue); |
| return; |
| case FhirResourcePackage.PARAMETERS_PARAMETER__PART: |
| getParts().clear(); |
| getParts().addAll((Collection<? extends ParametersParameter>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.PARAMETERS_PARAMETER__NAME: |
| setName((org.eclipse.mdht.uml.fhir.core.datatype.String)null); |
| return; |
| case FhirResourcePackage.PARAMETERS_PARAMETER__VALUEX: |
| setValuex((DataType)null); |
| return; |
| case FhirResourcePackage.PARAMETERS_PARAMETER__RESOURCE: |
| setResource((Resource)null); |
| return; |
| case FhirResourcePackage.PARAMETERS_PARAMETER__PART: |
| getParts().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.PARAMETERS_PARAMETER__NAME: |
| return name != null; |
| case FhirResourcePackage.PARAMETERS_PARAMETER__VALUEX: |
| return valuex != null; |
| case FhirResourcePackage.PARAMETERS_PARAMETER__RESOURCE: |
| return resource != null; |
| case FhirResourcePackage.PARAMETERS_PARAMETER__PART: |
| return parts != null && !parts.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //ParametersParameterImpl |