| /** |
| * 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: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.entitymock.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.emf.ecore.impl.MinimalEObjectImpl; |
| |
| import org.eclipse.osbp.xtext.entitymock.EntityMockDSLPackage; |
| import org.eclipse.osbp.xtext.entitymock.EntityMockObjectFunctionParameter; |
| import org.eclipse.osbp.xtext.entitymock.IEntityMockObjectUsable; |
| |
| import org.eclipse.xtext.common.types.JvmTypeReference; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Entity Mock Object Function Parameter</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.entitymock.impl.EntityMockObjectFunctionParameterImpl#getParameterType <em>Parameter Type</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.entitymock.impl.EntityMockObjectFunctionParameterImpl#getName <em>Name</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class EntityMockObjectFunctionParameterImpl extends MinimalEObjectImpl.Container implements EntityMockObjectFunctionParameter { |
| /** |
| * The cached value of the '{@link #getParameterType() <em>Parameter Type</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getParameterType() |
| * @generated |
| * @ordered |
| */ |
| protected JvmTypeReference parameterType; |
| |
| /** |
| * The cached value of the '{@link #getName() <em>Name</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected IEntityMockObjectUsable name; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected EntityMockObjectFunctionParameterImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return EntityMockDSLPackage.Literals.ENTITY_MOCK_OBJECT_FUNCTION_PARAMETER; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public JvmTypeReference getParameterType() { |
| return parameterType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetParameterType(JvmTypeReference newParameterType, NotificationChain msgs) { |
| JvmTypeReference oldParameterType = parameterType; |
| parameterType = newParameterType; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.ENTITY_MOCK_OBJECT_FUNCTION_PARAMETER__PARAMETER_TYPE, oldParameterType, newParameterType); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setParameterType(JvmTypeReference newParameterType) { |
| if (newParameterType != parameterType) { |
| NotificationChain msgs = null; |
| if (parameterType != null) |
| msgs = ((InternalEObject)parameterType).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EntityMockDSLPackage.ENTITY_MOCK_OBJECT_FUNCTION_PARAMETER__PARAMETER_TYPE, null, msgs); |
| if (newParameterType != null) |
| msgs = ((InternalEObject)newParameterType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EntityMockDSLPackage.ENTITY_MOCK_OBJECT_FUNCTION_PARAMETER__PARAMETER_TYPE, null, msgs); |
| msgs = basicSetParameterType(newParameterType, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.ENTITY_MOCK_OBJECT_FUNCTION_PARAMETER__PARAMETER_TYPE, newParameterType, newParameterType)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public IEntityMockObjectUsable getName() { |
| if (name != null && name.eIsProxy()) { |
| InternalEObject oldName = (InternalEObject)name; |
| name = (IEntityMockObjectUsable)eResolveProxy(oldName); |
| if (name != oldName) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, EntityMockDSLPackage.ENTITY_MOCK_OBJECT_FUNCTION_PARAMETER__NAME, oldName, name)); |
| } |
| } |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public IEntityMockObjectUsable basicGetName() { |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setName(IEntityMockObjectUsable newName) { |
| IEntityMockObjectUsable oldName = name; |
| name = newName; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.ENTITY_MOCK_OBJECT_FUNCTION_PARAMETER__NAME, oldName, name)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case EntityMockDSLPackage.ENTITY_MOCK_OBJECT_FUNCTION_PARAMETER__PARAMETER_TYPE: |
| return basicSetParameterType(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 EntityMockDSLPackage.ENTITY_MOCK_OBJECT_FUNCTION_PARAMETER__PARAMETER_TYPE: |
| return getParameterType(); |
| case EntityMockDSLPackage.ENTITY_MOCK_OBJECT_FUNCTION_PARAMETER__NAME: |
| if (resolve) return getName(); |
| return basicGetName(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case EntityMockDSLPackage.ENTITY_MOCK_OBJECT_FUNCTION_PARAMETER__PARAMETER_TYPE: |
| setParameterType((JvmTypeReference)newValue); |
| return; |
| case EntityMockDSLPackage.ENTITY_MOCK_OBJECT_FUNCTION_PARAMETER__NAME: |
| setName((IEntityMockObjectUsable)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case EntityMockDSLPackage.ENTITY_MOCK_OBJECT_FUNCTION_PARAMETER__PARAMETER_TYPE: |
| setParameterType((JvmTypeReference)null); |
| return; |
| case EntityMockDSLPackage.ENTITY_MOCK_OBJECT_FUNCTION_PARAMETER__NAME: |
| setName((IEntityMockObjectUsable)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case EntityMockDSLPackage.ENTITY_MOCK_OBJECT_FUNCTION_PARAMETER__PARAMETER_TYPE: |
| return parameterType != null; |
| case EntityMockDSLPackage.ENTITY_MOCK_OBJECT_FUNCTION_PARAMETER__NAME: |
| return name != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //EntityMockObjectFunctionParameterImpl |