| /** |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * 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 |
| * |
| * Based on ideas from Xtext, Xtend, Xcore |
| * |
| * Contributors: |
| * Joerg Riegel - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.datamartdsl.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.xtext.datamartdsl.DatamartDSLPackage; |
| import org.eclipse.osbp.xtext.datamartdsl.DatamartEntity; |
| import org.eclipse.osbp.xtext.datamartdsl.DatamartNavigation; |
| import org.eclipse.osbp.xtext.datamartdsl.DatamartReference; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Datamart Navigation</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartNavigationImpl#getJoinRef <em>Join Ref</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartNavigationImpl#getDatamartEntity <em>Datamart Entity</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DatamartNavigationImpl extends DatamartLazyResolverImpl implements DatamartNavigation { |
| /** |
| * The cached value of the '{@link #getJoinRef() <em>Join Ref</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getJoinRef() |
| * @generated |
| * @ordered |
| */ |
| protected DatamartReference joinRef; |
| |
| /** |
| * The cached value of the '{@link #getDatamartEntity() <em>Datamart Entity</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDatamartEntity() |
| * @generated |
| * @ordered |
| */ |
| protected DatamartEntity datamartEntity; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DatamartNavigationImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return DatamartDSLPackage.Literals.DATAMART_NAVIGATION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DatamartReference getJoinRef() { |
| return joinRef; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetJoinRef(DatamartReference newJoinRef, NotificationChain msgs) { |
| DatamartReference oldJoinRef = joinRef; |
| joinRef = newJoinRef; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_NAVIGATION__JOIN_REF, oldJoinRef, newJoinRef); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setJoinRef(DatamartReference newJoinRef) { |
| if (newJoinRef != joinRef) { |
| NotificationChain msgs = null; |
| if (joinRef != null) |
| msgs = ((InternalEObject)joinRef).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DatamartDSLPackage.DATAMART_NAVIGATION__JOIN_REF, null, msgs); |
| if (newJoinRef != null) |
| msgs = ((InternalEObject)newJoinRef).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DatamartDSLPackage.DATAMART_NAVIGATION__JOIN_REF, null, msgs); |
| msgs = basicSetJoinRef(newJoinRef, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_NAVIGATION__JOIN_REF, newJoinRef, newJoinRef)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DatamartEntity getDatamartEntity() { |
| return datamartEntity; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetDatamartEntity(DatamartEntity newDatamartEntity, NotificationChain msgs) { |
| DatamartEntity oldDatamartEntity = datamartEntity; |
| datamartEntity = newDatamartEntity; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_NAVIGATION__DATAMART_ENTITY, oldDatamartEntity, newDatamartEntity); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDatamartEntity(DatamartEntity newDatamartEntity) { |
| if (newDatamartEntity != datamartEntity) { |
| NotificationChain msgs = null; |
| if (datamartEntity != null) |
| msgs = ((InternalEObject)datamartEntity).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DatamartDSLPackage.DATAMART_NAVIGATION__DATAMART_ENTITY, null, msgs); |
| if (newDatamartEntity != null) |
| msgs = ((InternalEObject)newDatamartEntity).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DatamartDSLPackage.DATAMART_NAVIGATION__DATAMART_ENTITY, null, msgs); |
| msgs = basicSetDatamartEntity(newDatamartEntity, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_NAVIGATION__DATAMART_ENTITY, newDatamartEntity, newDatamartEntity)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case DatamartDSLPackage.DATAMART_NAVIGATION__JOIN_REF: |
| return basicSetJoinRef(null, msgs); |
| case DatamartDSLPackage.DATAMART_NAVIGATION__DATAMART_ENTITY: |
| return basicSetDatamartEntity(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 DatamartDSLPackage.DATAMART_NAVIGATION__JOIN_REF: |
| return getJoinRef(); |
| case DatamartDSLPackage.DATAMART_NAVIGATION__DATAMART_ENTITY: |
| return getDatamartEntity(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case DatamartDSLPackage.DATAMART_NAVIGATION__JOIN_REF: |
| setJoinRef((DatamartReference)newValue); |
| return; |
| case DatamartDSLPackage.DATAMART_NAVIGATION__DATAMART_ENTITY: |
| setDatamartEntity((DatamartEntity)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case DatamartDSLPackage.DATAMART_NAVIGATION__JOIN_REF: |
| setJoinRef((DatamartReference)null); |
| return; |
| case DatamartDSLPackage.DATAMART_NAVIGATION__DATAMART_ENTITY: |
| setDatamartEntity((DatamartEntity)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case DatamartDSLPackage.DATAMART_NAVIGATION__JOIN_REF: |
| return joinRef != null; |
| case DatamartDSLPackage.DATAMART_NAVIGATION__DATAMART_ENTITY: |
| return datamartEntity != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //DatamartNavigationImpl |