blob: 9efe81888c2c46a301975d1e779f8f5b191ecbae [file] [log] [blame]
/**
* 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 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
*
* generated from ActionDSL.xcore
*
*
*/
package org.eclipse.osbp.xtext.action.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.osbp.xtext.action.ActionDSLPackage;
import org.eclipse.osbp.xtext.action.ActionDatainterchange;
import org.eclipse.osbp.xtext.action.DatainterchangeActionEnum;
import org.eclipse.osbp.xtext.datainterchange.DataInterchange;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Action Datainterchange</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.action.impl.ActionDatainterchangeImpl#getAction <em>Action</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.action.impl.ActionDatainterchangeImpl#getDataRef <em>Data Ref</em>}</li>
* </ul>
*
* @generated
*/
public class ActionDatainterchangeImpl extends ActionLazyResolverImpl implements ActionDatainterchange {
/**
* The default value of the '{@link #getAction() <em>Action</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAction()
* @generated
* @ordered
*/
protected static final DatainterchangeActionEnum ACTION_EDEFAULT = DatainterchangeActionEnum.DATAINTERCHANGE_ACTION_IMPORT;
/**
* The cached value of the '{@link #getAction() <em>Action</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAction()
* @generated
* @ordered
*/
protected DatainterchangeActionEnum action = ACTION_EDEFAULT;
/**
* The cached value of the '{@link #getDataRef() <em>Data Ref</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDataRef()
* @generated
* @ordered
*/
protected DataInterchange dataRef;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ActionDatainterchangeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ActionDSLPackage.Literals.ACTION_DATAINTERCHANGE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DatainterchangeActionEnum getAction() {
return action;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAction(DatainterchangeActionEnum newAction) {
DatainterchangeActionEnum oldAction = action;
action = newAction == null ? ACTION_EDEFAULT : newAction;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ActionDSLPackage.ACTION_DATAINTERCHANGE__ACTION, oldAction, action));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DataInterchange getDataRef() {
if (dataRef != null && dataRef.eIsProxy()) {
InternalEObject oldDataRef = (InternalEObject)dataRef;
dataRef = (DataInterchange)eResolveProxy(oldDataRef);
if (dataRef != oldDataRef) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ActionDSLPackage.ACTION_DATAINTERCHANGE__DATA_REF, oldDataRef, dataRef));
}
}
return dataRef;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DataInterchange basicGetDataRef() {
return dataRef;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDataRef(DataInterchange newDataRef) {
DataInterchange oldDataRef = dataRef;
dataRef = newDataRef;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ActionDSLPackage.ACTION_DATAINTERCHANGE__DATA_REF, oldDataRef, dataRef));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ActionDSLPackage.ACTION_DATAINTERCHANGE__ACTION:
return getAction();
case ActionDSLPackage.ACTION_DATAINTERCHANGE__DATA_REF:
if (resolve) return getDataRef();
return basicGetDataRef();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ActionDSLPackage.ACTION_DATAINTERCHANGE__ACTION:
setAction((DatainterchangeActionEnum)newValue);
return;
case ActionDSLPackage.ACTION_DATAINTERCHANGE__DATA_REF:
setDataRef((DataInterchange)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ActionDSLPackage.ACTION_DATAINTERCHANGE__ACTION:
setAction(ACTION_EDEFAULT);
return;
case ActionDSLPackage.ACTION_DATAINTERCHANGE__DATA_REF:
setDataRef((DataInterchange)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ActionDSLPackage.ACTION_DATAINTERCHANGE__ACTION:
return action != ACTION_EDEFAULT;
case ActionDSLPackage.ACTION_DATAINTERCHANGE__DATA_REF:
return dataRef != null;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (action: ");
result.append(action);
result.append(')');
return result.toString();
}
} //ActionDatainterchangeImpl