| /** |
| * 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 |
| * |
| * Based on ideas from Xtext, Xtend, Xcore |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.messagedsl.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; |
| |
| import org.eclipse.osbp.xtext.messagedsl.MessageDSLPackage; |
| import org.eclipse.osbp.xtext.messagedsl.MessageParameter; |
| import org.eclipse.osbp.xtext.messagedsl.ParameterTypeEnum; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Message Parameter</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.messagedsl.impl.MessageParameterImpl#getName <em>Name</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.messagedsl.impl.MessageParameterImpl#getOftype <em>Oftype</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class MessageParameterImpl extends MinimalEObjectImpl.Container implements MessageParameter { |
| /** |
| * 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 #getOftype() <em>Oftype</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOftype() |
| * @generated |
| * @ordered |
| */ |
| protected static final ParameterTypeEnum OFTYPE_EDEFAULT = ParameterTypeEnum.BOOLEAN; |
| |
| /** |
| * The cached value of the '{@link #getOftype() <em>Oftype</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOftype() |
| * @generated |
| * @ordered |
| */ |
| protected ParameterTypeEnum oftype = OFTYPE_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected MessageParameterImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return MessageDSLPackage.Literals.MESSAGE_PARAMETER; |
| } |
| |
| /** |
| * <!-- 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, MessageDSLPackage.MESSAGE_PARAMETER__NAME, oldName, name)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ParameterTypeEnum getOftype() { |
| return oftype; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setOftype(ParameterTypeEnum newOftype) { |
| ParameterTypeEnum oldOftype = oftype; |
| oftype = newOftype == null ? OFTYPE_EDEFAULT : newOftype; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, MessageDSLPackage.MESSAGE_PARAMETER__OFTYPE, oldOftype, oftype)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case MessageDSLPackage.MESSAGE_PARAMETER__NAME: |
| return getName(); |
| case MessageDSLPackage.MESSAGE_PARAMETER__OFTYPE: |
| return getOftype(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case MessageDSLPackage.MESSAGE_PARAMETER__NAME: |
| setName((String)newValue); |
| return; |
| case MessageDSLPackage.MESSAGE_PARAMETER__OFTYPE: |
| setOftype((ParameterTypeEnum)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case MessageDSLPackage.MESSAGE_PARAMETER__NAME: |
| setName(NAME_EDEFAULT); |
| return; |
| case MessageDSLPackage.MESSAGE_PARAMETER__OFTYPE: |
| setOftype(OFTYPE_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case MessageDSLPackage.MESSAGE_PARAMETER__NAME: |
| return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); |
| case MessageDSLPackage.MESSAGE_PARAMETER__OFTYPE: |
| return oftype != OFTYPE_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(", oftype: "); |
| result.append(oftype); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //MessageParameterImpl |