| /******************************************************************************* |
| * 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.EObjectResolvingEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| import org.eclipse.mdht.uml.fhir.core.datatype.Code; |
| import org.eclipse.mdht.uml.fhir.core.datatype.Uri; |
| |
| 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.ImplementationGuidePage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Implementation Guide Page</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ImplementationGuidePageImpl#getSource <em>Source</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ImplementationGuidePageImpl#getName <em>Name</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ImplementationGuidePageImpl#getKind <em>Kind</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ImplementationGuidePageImpl#getTypes <em>Type</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ImplementationGuidePageImpl#getPackages <em>Package</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ImplementationGuidePageImpl#getFormat <em>Format</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ImplementationGuidePageImpl#getPages <em>Page</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ImplementationGuidePageImpl extends BackboneElementImpl implements ImplementationGuidePage { |
| /** |
| * The cached value of the '{@link #getSource() <em>Source</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSource() |
| * @generated |
| * @ordered |
| */ |
| protected Uri source; |
| |
| /** |
| * 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 #getKind() <em>Kind</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getKind() |
| * @generated |
| * @ordered |
| */ |
| protected Code kind; |
| |
| /** |
| * The cached value of the '{@link #getTypes() <em>Type</em>}' reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTypes() |
| * @generated |
| * @ordered |
| */ |
| protected EList<Code> types; |
| |
| /** |
| * The cached value of the '{@link #getPackages() <em>Package</em>}' reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPackages() |
| * @generated |
| * @ordered |
| */ |
| protected EList<org.eclipse.mdht.uml.fhir.core.datatype.String> packages; |
| |
| /** |
| * The cached value of the '{@link #getFormat() <em>Format</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getFormat() |
| * @generated |
| * @ordered |
| */ |
| protected Code format; |
| |
| /** |
| * The cached value of the '{@link #getPages() <em>Page</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPages() |
| * @generated |
| * @ordered |
| */ |
| protected EList<ImplementationGuidePage> pages; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ImplementationGuidePageImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirResourcePackage.eINSTANCE.getImplementationGuidePage(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Uri getSource() { |
| if (source != null && source.eIsProxy()) { |
| InternalEObject oldSource = (InternalEObject)source; |
| source = (Uri)eResolveProxy(oldSource); |
| if (source != oldSource) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__SOURCE, oldSource, source)); |
| } |
| } |
| return source; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Uri basicGetSource() { |
| return source; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setSource(Uri newSource) { |
| Uri oldSource = source; |
| source = newSource; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__SOURCE, oldSource, source)); |
| } |
| |
| /** |
| * <!-- 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.IMPLEMENTATION_GUIDE_PAGE__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.IMPLEMENTATION_GUIDE_PAGE__NAME, oldName, name)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code getKind() { |
| if (kind != null && kind.eIsProxy()) { |
| InternalEObject oldKind = (InternalEObject)kind; |
| kind = (Code)eResolveProxy(oldKind); |
| if (kind != oldKind) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__KIND, oldKind, kind)); |
| } |
| } |
| return kind; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code basicGetKind() { |
| return kind; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setKind(Code newKind) { |
| Code oldKind = kind; |
| kind = newKind; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__KIND, oldKind, kind)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<Code> getTypes() { |
| if (types == null) { |
| types = new EObjectResolvingEList<Code>(Code.class, this, FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__TYPE); |
| } |
| return types; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<org.eclipse.mdht.uml.fhir.core.datatype.String> getPackages() { |
| if (packages == null) { |
| packages = new EObjectResolvingEList<org.eclipse.mdht.uml.fhir.core.datatype.String>(org.eclipse.mdht.uml.fhir.core.datatype.String.class, this, FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__PACKAGE); |
| } |
| return packages; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code getFormat() { |
| if (format != null && format.eIsProxy()) { |
| InternalEObject oldFormat = (InternalEObject)format; |
| format = (Code)eResolveProxy(oldFormat); |
| if (format != oldFormat) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__FORMAT, oldFormat, format)); |
| } |
| } |
| return format; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code basicGetFormat() { |
| return format; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setFormat(Code newFormat) { |
| Code oldFormat = format; |
| format = newFormat; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__FORMAT, oldFormat, format)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<ImplementationGuidePage> getPages() { |
| if (pages == null) { |
| pages = new EObjectContainmentEList<ImplementationGuidePage>(ImplementationGuidePage.class, this, FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__PAGE); |
| } |
| return pages; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__PAGE: |
| return ((InternalEList<?>)getPages()).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.IMPLEMENTATION_GUIDE_PAGE__SOURCE: |
| if (resolve) return getSource(); |
| return basicGetSource(); |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__NAME: |
| if (resolve) return getName(); |
| return basicGetName(); |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__KIND: |
| if (resolve) return getKind(); |
| return basicGetKind(); |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__TYPE: |
| return getTypes(); |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__PACKAGE: |
| return getPackages(); |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__FORMAT: |
| if (resolve) return getFormat(); |
| return basicGetFormat(); |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__PAGE: |
| return getPages(); |
| } |
| 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.IMPLEMENTATION_GUIDE_PAGE__SOURCE: |
| setSource((Uri)newValue); |
| return; |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__NAME: |
| setName((org.eclipse.mdht.uml.fhir.core.datatype.String)newValue); |
| return; |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__KIND: |
| setKind((Code)newValue); |
| return; |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__TYPE: |
| getTypes().clear(); |
| getTypes().addAll((Collection<? extends Code>)newValue); |
| return; |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__PACKAGE: |
| getPackages().clear(); |
| getPackages().addAll((Collection<? extends org.eclipse.mdht.uml.fhir.core.datatype.String>)newValue); |
| return; |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__FORMAT: |
| setFormat((Code)newValue); |
| return; |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__PAGE: |
| getPages().clear(); |
| getPages().addAll((Collection<? extends ImplementationGuidePage>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__SOURCE: |
| setSource((Uri)null); |
| return; |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__NAME: |
| setName((org.eclipse.mdht.uml.fhir.core.datatype.String)null); |
| return; |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__KIND: |
| setKind((Code)null); |
| return; |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__TYPE: |
| getTypes().clear(); |
| return; |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__PACKAGE: |
| getPackages().clear(); |
| return; |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__FORMAT: |
| setFormat((Code)null); |
| return; |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__PAGE: |
| getPages().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__SOURCE: |
| return source != null; |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__NAME: |
| return name != null; |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__KIND: |
| return kind != null; |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__TYPE: |
| return types != null && !types.isEmpty(); |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__PACKAGE: |
| return packages != null && !packages.isEmpty(); |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__FORMAT: |
| return format != null; |
| case FhirResourcePackage.IMPLEMENTATION_GUIDE_PAGE__PAGE: |
| return pages != null && !pages.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //ImplementationGuidePageImpl |