| /** |
| * Copyright (c) 2011, 2016 - Lunifera GmbH (Gross Enzersdorf), 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 v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Florian Pirchner - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.dsl.semantic.dto.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.common.types.LMultiplicity; |
| import org.eclipse.osbp.dsl.semantic.common.types.LReference; |
| |
| import org.eclipse.osbp.dsl.semantic.dto.LDtoInheritedReference; |
| import org.eclipse.osbp.dsl.semantic.dto.OSBPDtoPackage; |
| |
| import org.eclipse.xtext.common.types.JvmTypeReference; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>LDto Inherited Reference</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.osbp.dsl.semantic.dto.impl.LDtoInheritedReferenceImpl#getInheritedFeature <em>Inherited Feature</em>}</li> |
| * <li>{@link org.eclipse.osbp.dsl.semantic.dto.impl.LDtoInheritedReferenceImpl#getInheritedFeatureTypeJvm <em>Inherited Feature Type Jvm</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class LDtoInheritedReferenceImpl extends LDtoAbstractReferenceImpl implements LDtoInheritedReference { |
| /** |
| * The cached value of the '{@link #getInheritedFeature() <em>Inherited Feature</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getInheritedFeature() |
| * @generated |
| * @ordered |
| */ |
| protected LReference inheritedFeature; |
| |
| /** |
| * The cached value of the '{@link #getInheritedFeatureTypeJvm() <em>Inherited Feature Type Jvm</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getInheritedFeatureTypeJvm() |
| * @generated |
| * @ordered |
| */ |
| protected JvmTypeReference inheritedFeatureTypeJvm; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected LDtoInheritedReferenceImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return OSBPDtoPackage.Literals.LDTO_INHERITED_REFERENCE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LReference getInheritedFeature() { |
| if (inheritedFeature != null && inheritedFeature.eIsProxy()) { |
| InternalEObject oldInheritedFeature = (InternalEObject)inheritedFeature; |
| inheritedFeature = (LReference)eResolveProxy(oldInheritedFeature); |
| if (inheritedFeature != oldInheritedFeature) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, OSBPDtoPackage.LDTO_INHERITED_REFERENCE__INHERITED_FEATURE, oldInheritedFeature, inheritedFeature)); |
| } |
| } |
| return inheritedFeature; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LReference basicGetInheritedFeature() { |
| return inheritedFeature; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setInheritedFeature(LReference newInheritedFeature) { |
| LReference oldInheritedFeature = inheritedFeature; |
| inheritedFeature = newInheritedFeature; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, OSBPDtoPackage.LDTO_INHERITED_REFERENCE__INHERITED_FEATURE, oldInheritedFeature, inheritedFeature)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public JvmTypeReference getInheritedFeatureTypeJvm() { |
| return inheritedFeatureTypeJvm; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetInheritedFeatureTypeJvm(JvmTypeReference newInheritedFeatureTypeJvm, NotificationChain msgs) { |
| JvmTypeReference oldInheritedFeatureTypeJvm = inheritedFeatureTypeJvm; |
| inheritedFeatureTypeJvm = newInheritedFeatureTypeJvm; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OSBPDtoPackage.LDTO_INHERITED_REFERENCE__INHERITED_FEATURE_TYPE_JVM, oldInheritedFeatureTypeJvm, newInheritedFeatureTypeJvm); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setInheritedFeatureTypeJvm(JvmTypeReference newInheritedFeatureTypeJvm) { |
| if (newInheritedFeatureTypeJvm != inheritedFeatureTypeJvm) { |
| NotificationChain msgs = null; |
| if (inheritedFeatureTypeJvm != null) |
| msgs = ((InternalEObject)inheritedFeatureTypeJvm).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OSBPDtoPackage.LDTO_INHERITED_REFERENCE__INHERITED_FEATURE_TYPE_JVM, null, msgs); |
| if (newInheritedFeatureTypeJvm != null) |
| msgs = ((InternalEObject)newInheritedFeatureTypeJvm).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OSBPDtoPackage.LDTO_INHERITED_REFERENCE__INHERITED_FEATURE_TYPE_JVM, null, msgs); |
| msgs = basicSetInheritedFeatureTypeJvm(newInheritedFeatureTypeJvm, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, OSBPDtoPackage.LDTO_INHERITED_REFERENCE__INHERITED_FEATURE_TYPE_JVM, newInheritedFeatureTypeJvm, newInheritedFeatureTypeJvm)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LMultiplicity getInheritedMultiplicity() { |
| LReference _inheritedFeature = this.getInheritedFeature(); |
| return _inheritedFeature.getMultiplicity(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case OSBPDtoPackage.LDTO_INHERITED_REFERENCE__INHERITED_FEATURE_TYPE_JVM: |
| return basicSetInheritedFeatureTypeJvm(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 OSBPDtoPackage.LDTO_INHERITED_REFERENCE__INHERITED_FEATURE: |
| if (resolve) return getInheritedFeature(); |
| return basicGetInheritedFeature(); |
| case OSBPDtoPackage.LDTO_INHERITED_REFERENCE__INHERITED_FEATURE_TYPE_JVM: |
| return getInheritedFeatureTypeJvm(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case OSBPDtoPackage.LDTO_INHERITED_REFERENCE__INHERITED_FEATURE: |
| setInheritedFeature((LReference)newValue); |
| return; |
| case OSBPDtoPackage.LDTO_INHERITED_REFERENCE__INHERITED_FEATURE_TYPE_JVM: |
| setInheritedFeatureTypeJvm((JvmTypeReference)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case OSBPDtoPackage.LDTO_INHERITED_REFERENCE__INHERITED_FEATURE: |
| setInheritedFeature((LReference)null); |
| return; |
| case OSBPDtoPackage.LDTO_INHERITED_REFERENCE__INHERITED_FEATURE_TYPE_JVM: |
| setInheritedFeatureTypeJvm((JvmTypeReference)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case OSBPDtoPackage.LDTO_INHERITED_REFERENCE__INHERITED_FEATURE: |
| return inheritedFeature != null; |
| case OSBPDtoPackage.LDTO_INHERITED_REFERENCE__INHERITED_FEATURE_TYPE_JVM: |
| return inheritedFeatureTypeJvm != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //LDtoInheritedReferenceImpl |