| /** |
| * Copyright (c) 2011, 2018 - 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 |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| * |
| * generated from SignalDSL.xcore |
| * |
| * |
| */ |
| package org.eclipse.osbp.xtext.signal.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.signal.DataTransfer; |
| import org.eclipse.osbp.xtext.signal.SignalDSLPackage; |
| import org.eclipse.osbp.xtext.signal.SignalExecutionTypeEnum; |
| import org.eclipse.osbp.xtext.signal.SignalHandler; |
| import org.eclipse.osbp.xtext.signal.SignalHandlerTypeEnum; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Signal Handler</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.signal.impl.SignalHandlerImpl#getName <em>Name</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.signal.impl.SignalHandlerImpl#getActionType <em>Action Type</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.signal.impl.SignalHandlerImpl#getFilemask <em>Filemask</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.signal.impl.SignalHandlerImpl#getData <em>Data</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.signal.impl.SignalHandlerImpl#getExecutiontype <em>Executiontype</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class SignalHandlerImpl extends SignalLazyResolverImpl implements SignalHandler { |
| /** |
| * The default value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected static final String NAME_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected String name = NAME_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getActionType() <em>Action Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getActionType() |
| * @generated |
| * @ordered |
| */ |
| protected static final SignalHandlerTypeEnum ACTION_TYPE_EDEFAULT = SignalHandlerTypeEnum.DOAFTER; |
| |
| /** |
| * The cached value of the '{@link #getActionType() <em>Action Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getActionType() |
| * @generated |
| * @ordered |
| */ |
| protected SignalHandlerTypeEnum actionType = ACTION_TYPE_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getFilemask() <em>Filemask</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getFilemask() |
| * @generated |
| * @ordered |
| */ |
| protected static final String FILEMASK_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getFilemask() <em>Filemask</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getFilemask() |
| * @generated |
| * @ordered |
| */ |
| protected String filemask = FILEMASK_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getData() <em>Data</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getData() |
| * @generated |
| * @ordered |
| */ |
| protected DataTransfer data; |
| |
| /** |
| * The default value of the '{@link #getExecutiontype() <em>Executiontype</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getExecutiontype() |
| * @generated |
| * @ordered |
| */ |
| protected static final SignalExecutionTypeEnum EXECUTIONTYPE_EDEFAULT = SignalExecutionTypeEnum.SYNC; |
| |
| /** |
| * The cached value of the '{@link #getExecutiontype() <em>Executiontype</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getExecutiontype() |
| * @generated |
| * @ordered |
| */ |
| protected SignalExecutionTypeEnum executiontype = EXECUTIONTYPE_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected SignalHandlerImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return SignalDSLPackage.Literals.SIGNAL_HANDLER; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getName() { |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setName(String newName) { |
| String oldName = name; |
| name = newName; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, SignalDSLPackage.SIGNAL_HANDLER__NAME, oldName, name)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public SignalHandlerTypeEnum getActionType() { |
| return actionType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setActionType(SignalHandlerTypeEnum newActionType) { |
| SignalHandlerTypeEnum oldActionType = actionType; |
| actionType = newActionType == null ? ACTION_TYPE_EDEFAULT : newActionType; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, SignalDSLPackage.SIGNAL_HANDLER__ACTION_TYPE, oldActionType, actionType)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getFilemask() { |
| return filemask; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setFilemask(String newFilemask) { |
| String oldFilemask = filemask; |
| filemask = newFilemask; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, SignalDSLPackage.SIGNAL_HANDLER__FILEMASK, oldFilemask, filemask)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DataTransfer getData() { |
| return data; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetData(DataTransfer newData, NotificationChain msgs) { |
| DataTransfer oldData = data; |
| data = newData; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SignalDSLPackage.SIGNAL_HANDLER__DATA, oldData, newData); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setData(DataTransfer newData) { |
| if (newData != data) { |
| NotificationChain msgs = null; |
| if (data != null) |
| msgs = ((InternalEObject)data).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SignalDSLPackage.SIGNAL_HANDLER__DATA, null, msgs); |
| if (newData != null) |
| msgs = ((InternalEObject)newData).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SignalDSLPackage.SIGNAL_HANDLER__DATA, null, msgs); |
| msgs = basicSetData(newData, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, SignalDSLPackage.SIGNAL_HANDLER__DATA, newData, newData)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public SignalExecutionTypeEnum getExecutiontype() { |
| return executiontype; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setExecutiontype(SignalExecutionTypeEnum newExecutiontype) { |
| SignalExecutionTypeEnum oldExecutiontype = executiontype; |
| executiontype = newExecutiontype == null ? EXECUTIONTYPE_EDEFAULT : newExecutiontype; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, SignalDSLPackage.SIGNAL_HANDLER__EXECUTIONTYPE, oldExecutiontype, executiontype)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case SignalDSLPackage.SIGNAL_HANDLER__DATA: |
| return basicSetData(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 SignalDSLPackage.SIGNAL_HANDLER__NAME: |
| return getName(); |
| case SignalDSLPackage.SIGNAL_HANDLER__ACTION_TYPE: |
| return getActionType(); |
| case SignalDSLPackage.SIGNAL_HANDLER__FILEMASK: |
| return getFilemask(); |
| case SignalDSLPackage.SIGNAL_HANDLER__DATA: |
| return getData(); |
| case SignalDSLPackage.SIGNAL_HANDLER__EXECUTIONTYPE: |
| return getExecutiontype(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case SignalDSLPackage.SIGNAL_HANDLER__NAME: |
| setName((String)newValue); |
| return; |
| case SignalDSLPackage.SIGNAL_HANDLER__ACTION_TYPE: |
| setActionType((SignalHandlerTypeEnum)newValue); |
| return; |
| case SignalDSLPackage.SIGNAL_HANDLER__FILEMASK: |
| setFilemask((String)newValue); |
| return; |
| case SignalDSLPackage.SIGNAL_HANDLER__DATA: |
| setData((DataTransfer)newValue); |
| return; |
| case SignalDSLPackage.SIGNAL_HANDLER__EXECUTIONTYPE: |
| setExecutiontype((SignalExecutionTypeEnum)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case SignalDSLPackage.SIGNAL_HANDLER__NAME: |
| setName(NAME_EDEFAULT); |
| return; |
| case SignalDSLPackage.SIGNAL_HANDLER__ACTION_TYPE: |
| setActionType(ACTION_TYPE_EDEFAULT); |
| return; |
| case SignalDSLPackage.SIGNAL_HANDLER__FILEMASK: |
| setFilemask(FILEMASK_EDEFAULT); |
| return; |
| case SignalDSLPackage.SIGNAL_HANDLER__DATA: |
| setData((DataTransfer)null); |
| return; |
| case SignalDSLPackage.SIGNAL_HANDLER__EXECUTIONTYPE: |
| setExecutiontype(EXECUTIONTYPE_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case SignalDSLPackage.SIGNAL_HANDLER__NAME: |
| return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); |
| case SignalDSLPackage.SIGNAL_HANDLER__ACTION_TYPE: |
| return actionType != ACTION_TYPE_EDEFAULT; |
| case SignalDSLPackage.SIGNAL_HANDLER__FILEMASK: |
| return FILEMASK_EDEFAULT == null ? filemask != null : !FILEMASK_EDEFAULT.equals(filemask); |
| case SignalDSLPackage.SIGNAL_HANDLER__DATA: |
| return data != null; |
| case SignalDSLPackage.SIGNAL_HANDLER__EXECUTIONTYPE: |
| return executiontype != EXECUTIONTYPE_EDEFAULT; |
| } |
| 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(" (name: "); |
| result.append(name); |
| result.append(", actionType: "); |
| result.append(actionType); |
| result.append(", filemask: "); |
| result.append(filemask); |
| result.append(", executiontype: "); |
| result.append(executiontype); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //SignalHandlerImpl |