| /******************************************************************************* |
| * 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.datatype.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.mdht.uml.fhir.core.datatype.Annotation; |
| import org.eclipse.mdht.uml.fhir.core.datatype.Base; |
| import org.eclipse.mdht.uml.fhir.core.datatype.DateTime; |
| import org.eclipse.mdht.uml.fhir.core.datatype.FhirDatatypePackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Annotation</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.datatype.impl.AnnotationImpl#getAuthorx <em>Authorx</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.datatype.impl.AnnotationImpl#getTime <em>Time</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.datatype.impl.AnnotationImpl#getText <em>Text</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class AnnotationImpl extends DataTypeImpl implements Annotation { |
| /** |
| * The cached value of the '{@link #getAuthorx() <em>Authorx</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAuthorx() |
| * @generated |
| * @ordered |
| */ |
| protected Base authorx; |
| |
| /** |
| * The cached value of the '{@link #getTime() <em>Time</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTime() |
| * @generated |
| * @ordered |
| */ |
| protected DateTime time; |
| |
| /** |
| * The cached value of the '{@link #getText() <em>Text</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getText() |
| * @generated |
| * @ordered |
| */ |
| protected org.eclipse.mdht.uml.fhir.core.datatype.String text; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected AnnotationImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirDatatypePackage.Literals.ANNOTATION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Base getAuthorx() { |
| if (authorx != null && authorx.eIsProxy()) { |
| InternalEObject oldAuthorx = (InternalEObject)authorx; |
| authorx = (Base)eResolveProxy(oldAuthorx); |
| if (authorx != oldAuthorx) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirDatatypePackage.ANNOTATION__AUTHORX, oldAuthorx, authorx)); |
| } |
| } |
| return authorx; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Base basicGetAuthorx() { |
| return authorx; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setAuthorx(Base newAuthorx) { |
| Base oldAuthorx = authorx; |
| authorx = newAuthorx; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirDatatypePackage.ANNOTATION__AUTHORX, oldAuthorx, authorx)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DateTime getTime() { |
| if (time != null && time.eIsProxy()) { |
| InternalEObject oldTime = (InternalEObject)time; |
| time = (DateTime)eResolveProxy(oldTime); |
| if (time != oldTime) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirDatatypePackage.ANNOTATION__TIME, oldTime, time)); |
| } |
| } |
| return time; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DateTime basicGetTime() { |
| return time; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setTime(DateTime newTime) { |
| DateTime oldTime = time; |
| time = newTime; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirDatatypePackage.ANNOTATION__TIME, oldTime, time)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String getText() { |
| if (text != null && text.eIsProxy()) { |
| InternalEObject oldText = (InternalEObject)text; |
| text = (org.eclipse.mdht.uml.fhir.core.datatype.String)eResolveProxy(oldText); |
| if (text != oldText) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirDatatypePackage.ANNOTATION__TEXT, oldText, text)); |
| } |
| } |
| return text; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String basicGetText() { |
| return text; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setText(org.eclipse.mdht.uml.fhir.core.datatype.String newText) { |
| org.eclipse.mdht.uml.fhir.core.datatype.String oldText = text; |
| text = newText; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirDatatypePackage.ANNOTATION__TEXT, oldText, text)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case FhirDatatypePackage.ANNOTATION__AUTHORX: |
| if (resolve) return getAuthorx(); |
| return basicGetAuthorx(); |
| case FhirDatatypePackage.ANNOTATION__TIME: |
| if (resolve) return getTime(); |
| return basicGetTime(); |
| case FhirDatatypePackage.ANNOTATION__TEXT: |
| if (resolve) return getText(); |
| return basicGetText(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case FhirDatatypePackage.ANNOTATION__AUTHORX: |
| setAuthorx((Base)newValue); |
| return; |
| case FhirDatatypePackage.ANNOTATION__TIME: |
| setTime((DateTime)newValue); |
| return; |
| case FhirDatatypePackage.ANNOTATION__TEXT: |
| setText((org.eclipse.mdht.uml.fhir.core.datatype.String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirDatatypePackage.ANNOTATION__AUTHORX: |
| setAuthorx((Base)null); |
| return; |
| case FhirDatatypePackage.ANNOTATION__TIME: |
| setTime((DateTime)null); |
| return; |
| case FhirDatatypePackage.ANNOTATION__TEXT: |
| setText((org.eclipse.mdht.uml.fhir.core.datatype.String)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirDatatypePackage.ANNOTATION__AUTHORX: |
| return authorx != null; |
| case FhirDatatypePackage.ANNOTATION__TIME: |
| return time != null; |
| case FhirDatatypePackage.ANNOTATION__TEXT: |
| return text != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //AnnotationImpl |