blob: 5bcc4769c950b0ef7c37ba30060ca12fc8eedba9 [file] [log] [blame]
/**
* 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.LEntity;
import org.eclipse.osbp.xtext.datainterchange.DataDSLPackage;
import org.eclipse.osbp.xtext.datainterchange.DataInterchangeJoin;
import org.eclipse.osbp.xtext.datainterchange.DataInterchangeJoinAttr;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Data Interchange Join</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.datainterchange.impl.DataInterchangeJoinImpl#getBeanAttr1 <em>Bean Attr1</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.datainterchange.impl.DataInterchangeJoinImpl#getJoinEntity <em>Join Entity</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.datainterchange.impl.DataInterchangeJoinImpl#getBeanAttr2 <em>Bean Attr2</em>}</li>
* </ul>
*
* @generated
*/
public class DataInterchangeJoinImpl extends DataInterchangeLazyResolverImpl implements DataInterchangeJoin {
/**
* The cached value of the '{@link #getBeanAttr1() <em>Bean Attr1</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBeanAttr1()
* @generated
* @ordered
*/
protected DataInterchangeJoinAttr beanAttr1;
/**
* The cached value of the '{@link #getJoinEntity() <em>Join Entity</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getJoinEntity()
* @generated
* @ordered
*/
protected LEntity joinEntity;
/**
* The cached value of the '{@link #getBeanAttr2() <em>Bean Attr2</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBeanAttr2()
* @generated
* @ordered
*/
protected DataInterchangeJoinAttr beanAttr2;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DataInterchangeJoinImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return DataDSLPackage.Literals.DATA_INTERCHANGE_JOIN;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DataInterchangeJoinAttr getBeanAttr1() {
return beanAttr1;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetBeanAttr1(DataInterchangeJoinAttr newBeanAttr1, NotificationChain msgs) {
DataInterchangeJoinAttr oldBeanAttr1 = beanAttr1;
beanAttr1 = newBeanAttr1;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DataDSLPackage.DATA_INTERCHANGE_JOIN__BEAN_ATTR1, oldBeanAttr1, newBeanAttr1);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBeanAttr1(DataInterchangeJoinAttr newBeanAttr1) {
if (newBeanAttr1 != beanAttr1) {
NotificationChain msgs = null;
if (beanAttr1 != null)
msgs = ((InternalEObject)beanAttr1).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DataDSLPackage.DATA_INTERCHANGE_JOIN__BEAN_ATTR1, null, msgs);
if (newBeanAttr1 != null)
msgs = ((InternalEObject)newBeanAttr1).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DataDSLPackage.DATA_INTERCHANGE_JOIN__BEAN_ATTR1, null, msgs);
msgs = basicSetBeanAttr1(newBeanAttr1, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DataDSLPackage.DATA_INTERCHANGE_JOIN__BEAN_ATTR1, newBeanAttr1, newBeanAttr1));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public LEntity getJoinEntity() {
if (joinEntity != null && joinEntity.eIsProxy()) {
InternalEObject oldJoinEntity = (InternalEObject)joinEntity;
joinEntity = (LEntity)eResolveProxy(oldJoinEntity);
if (joinEntity != oldJoinEntity) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, DataDSLPackage.DATA_INTERCHANGE_JOIN__JOIN_ENTITY, oldJoinEntity, joinEntity));
}
}
return joinEntity;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public LEntity basicGetJoinEntity() {
return joinEntity;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setJoinEntity(LEntity newJoinEntity) {
LEntity oldJoinEntity = joinEntity;
joinEntity = newJoinEntity;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DataDSLPackage.DATA_INTERCHANGE_JOIN__JOIN_ENTITY, oldJoinEntity, joinEntity));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DataInterchangeJoinAttr getBeanAttr2() {
return beanAttr2;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetBeanAttr2(DataInterchangeJoinAttr newBeanAttr2, NotificationChain msgs) {
DataInterchangeJoinAttr oldBeanAttr2 = beanAttr2;
beanAttr2 = newBeanAttr2;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DataDSLPackage.DATA_INTERCHANGE_JOIN__BEAN_ATTR2, oldBeanAttr2, newBeanAttr2);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBeanAttr2(DataInterchangeJoinAttr newBeanAttr2) {
if (newBeanAttr2 != beanAttr2) {
NotificationChain msgs = null;
if (beanAttr2 != null)
msgs = ((InternalEObject)beanAttr2).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DataDSLPackage.DATA_INTERCHANGE_JOIN__BEAN_ATTR2, null, msgs);
if (newBeanAttr2 != null)
msgs = ((InternalEObject)newBeanAttr2).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DataDSLPackage.DATA_INTERCHANGE_JOIN__BEAN_ATTR2, null, msgs);
msgs = basicSetBeanAttr2(newBeanAttr2, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DataDSLPackage.DATA_INTERCHANGE_JOIN__BEAN_ATTR2, newBeanAttr2, newBeanAttr2));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case DataDSLPackage.DATA_INTERCHANGE_JOIN__BEAN_ATTR1:
return basicSetBeanAttr1(null, msgs);
case DataDSLPackage.DATA_INTERCHANGE_JOIN__BEAN_ATTR2:
return basicSetBeanAttr2(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_JOIN__BEAN_ATTR1:
return getBeanAttr1();
case DataDSLPackage.DATA_INTERCHANGE_JOIN__JOIN_ENTITY:
if (resolve) return getJoinEntity();
return basicGetJoinEntity();
case DataDSLPackage.DATA_INTERCHANGE_JOIN__BEAN_ATTR2:
return getBeanAttr2();
}
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_JOIN__BEAN_ATTR1:
setBeanAttr1((DataInterchangeJoinAttr)newValue);
return;
case DataDSLPackage.DATA_INTERCHANGE_JOIN__JOIN_ENTITY:
setJoinEntity((LEntity)newValue);
return;
case DataDSLPackage.DATA_INTERCHANGE_JOIN__BEAN_ATTR2:
setBeanAttr2((DataInterchangeJoinAttr)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_JOIN__BEAN_ATTR1:
setBeanAttr1((DataInterchangeJoinAttr)null);
return;
case DataDSLPackage.DATA_INTERCHANGE_JOIN__JOIN_ENTITY:
setJoinEntity((LEntity)null);
return;
case DataDSLPackage.DATA_INTERCHANGE_JOIN__BEAN_ATTR2:
setBeanAttr2((DataInterchangeJoinAttr)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DataDSLPackage.DATA_INTERCHANGE_JOIN__BEAN_ATTR1:
return beanAttr1 != null;
case DataDSLPackage.DATA_INTERCHANGE_JOIN__JOIN_ENTITY:
return joinEntity != null;
case DataDSLPackage.DATA_INTERCHANGE_JOIN__BEAN_ATTR2:
return beanAttr2 != null;
}
return super.eIsSet(featureID);
}
} //DataInterchangeJoinImpl