| /** |
| * Copyright (c) 2014, Loetz GmbH&Co.KG (Heidelberg) |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Based on ideas from Xtext, Xtend, Xcore |
| * |
| * Contributors: |
| * Joerg Riegel - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.datainterchange.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.eclipse.osbp.dsl.semantic.entity.LEntityAttribute; |
| import org.eclipse.osbp.dsl.semantic.entity.LEntityReference; |
| |
| import org.eclipse.osbp.xtext.datainterchange.DataDSLPackage; |
| import org.eclipse.osbp.xtext.datainterchange.DataInterchangeExpose; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Data Interchange Expose</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.datainterchange.impl.DataInterchangeExposeImpl#getRefEntity <em>Ref Entity</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datainterchange.impl.DataInterchangeExposeImpl#getRefProperty <em>Ref Property</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datainterchange.impl.DataInterchangeExposeImpl#getSubExpose <em>Sub Expose</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DataInterchangeExposeImpl extends DataInterchangeLazyResolverImpl implements DataInterchangeExpose { |
| /** |
| * The cached value of the '{@link #getRefEntity() <em>Ref Entity</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRefEntity() |
| * @generated |
| * @ordered |
| */ |
| protected LEntityReference refEntity; |
| |
| /** |
| * The cached value of the '{@link #getRefProperty() <em>Ref Property</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRefProperty() |
| * @generated |
| * @ordered |
| */ |
| protected LEntityAttribute refProperty; |
| |
| /** |
| * The cached value of the '{@link #getSubExpose() <em>Sub Expose</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSubExpose() |
| * @generated |
| * @ordered |
| */ |
| protected DataInterchangeExpose subExpose; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DataInterchangeExposeImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return DataDSLPackage.Literals.DATA_INTERCHANGE_EXPOSE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LEntityReference getRefEntity() { |
| if (refEntity != null && refEntity.eIsProxy()) { |
| InternalEObject oldRefEntity = (InternalEObject)refEntity; |
| refEntity = (LEntityReference)eResolveProxy(oldRefEntity); |
| if (refEntity != oldRefEntity) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, DataDSLPackage.DATA_INTERCHANGE_EXPOSE__REF_ENTITY, oldRefEntity, refEntity)); |
| } |
| } |
| return refEntity; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LEntityReference basicGetRefEntity() { |
| return refEntity; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setRefEntity(LEntityReference newRefEntity) { |
| LEntityReference oldRefEntity = refEntity; |
| refEntity = newRefEntity; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DataDSLPackage.DATA_INTERCHANGE_EXPOSE__REF_ENTITY, oldRefEntity, refEntity)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LEntityAttribute getRefProperty() { |
| if (refProperty != null && refProperty.eIsProxy()) { |
| InternalEObject oldRefProperty = (InternalEObject)refProperty; |
| refProperty = (LEntityAttribute)eResolveProxy(oldRefProperty); |
| if (refProperty != oldRefProperty) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, DataDSLPackage.DATA_INTERCHANGE_EXPOSE__REF_PROPERTY, oldRefProperty, refProperty)); |
| } |
| } |
| return refProperty; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LEntityAttribute basicGetRefProperty() { |
| return refProperty; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setRefProperty(LEntityAttribute newRefProperty) { |
| LEntityAttribute oldRefProperty = refProperty; |
| refProperty = newRefProperty; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DataDSLPackage.DATA_INTERCHANGE_EXPOSE__REF_PROPERTY, oldRefProperty, refProperty)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DataInterchangeExpose getSubExpose() { |
| return subExpose; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetSubExpose(DataInterchangeExpose newSubExpose, NotificationChain msgs) { |
| DataInterchangeExpose oldSubExpose = subExpose; |
| subExpose = newSubExpose; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DataDSLPackage.DATA_INTERCHANGE_EXPOSE__SUB_EXPOSE, oldSubExpose, newSubExpose); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setSubExpose(DataInterchangeExpose newSubExpose) { |
| if (newSubExpose != subExpose) { |
| NotificationChain msgs = null; |
| if (subExpose != null) |
| msgs = ((InternalEObject)subExpose).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DataDSLPackage.DATA_INTERCHANGE_EXPOSE__SUB_EXPOSE, null, msgs); |
| if (newSubExpose != null) |
| msgs = ((InternalEObject)newSubExpose).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DataDSLPackage.DATA_INTERCHANGE_EXPOSE__SUB_EXPOSE, null, msgs); |
| msgs = basicSetSubExpose(newSubExpose, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DataDSLPackage.DATA_INTERCHANGE_EXPOSE__SUB_EXPOSE, newSubExpose, newSubExpose)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case DataDSLPackage.DATA_INTERCHANGE_EXPOSE__SUB_EXPOSE: |
| return basicSetSubExpose(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 DataDSLPackage.DATA_INTERCHANGE_EXPOSE__REF_ENTITY: |
| if (resolve) return getRefEntity(); |
| return basicGetRefEntity(); |
| case DataDSLPackage.DATA_INTERCHANGE_EXPOSE__REF_PROPERTY: |
| if (resolve) return getRefProperty(); |
| return basicGetRefProperty(); |
| case DataDSLPackage.DATA_INTERCHANGE_EXPOSE__SUB_EXPOSE: |
| return getSubExpose(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case DataDSLPackage.DATA_INTERCHANGE_EXPOSE__REF_ENTITY: |
| setRefEntity((LEntityReference)newValue); |
| return; |
| case DataDSLPackage.DATA_INTERCHANGE_EXPOSE__REF_PROPERTY: |
| setRefProperty((LEntityAttribute)newValue); |
| return; |
| case DataDSLPackage.DATA_INTERCHANGE_EXPOSE__SUB_EXPOSE: |
| setSubExpose((DataInterchangeExpose)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case DataDSLPackage.DATA_INTERCHANGE_EXPOSE__REF_ENTITY: |
| setRefEntity((LEntityReference)null); |
| return; |
| case DataDSLPackage.DATA_INTERCHANGE_EXPOSE__REF_PROPERTY: |
| setRefProperty((LEntityAttribute)null); |
| return; |
| case DataDSLPackage.DATA_INTERCHANGE_EXPOSE__SUB_EXPOSE: |
| setSubExpose((DataInterchangeExpose)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case DataDSLPackage.DATA_INTERCHANGE_EXPOSE__REF_ENTITY: |
| return refEntity != null; |
| case DataDSLPackage.DATA_INTERCHANGE_EXPOSE__REF_PROPERTY: |
| return refProperty != null; |
| case DataDSLPackage.DATA_INTERCHANGE_EXPOSE__SUB_EXPOSE: |
| return subExpose != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //DataInterchangeExposeImpl |