| /** |
| * <copyright> |
| * Copyright (c) 2005 IBM Corporation and others. |
| * 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: |
| * IBM Corporation - initial API and implementation |
| * </copyright> |
| * |
| * $Id: CompensationHandlerImpl.java,v 1.9 2011/03/30 18:54:25 rbrodt Exp $ |
| */ |
| package org.eclipse.bpel.model.impl; |
| |
| import org.eclipse.bpel.model.Activity; |
| import org.eclipse.bpel.model.BPELPackage; |
| import org.eclipse.bpel.model.CompensationHandler; |
| import org.eclipse.bpel.model.util.ReconciliationHelper; |
| 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; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Compensation Handler</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.bpel.model.impl.CompensationHandlerImpl#getActivity <em>Activity</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class CompensationHandlerImpl extends BPELExtensibleElementImpl |
| implements CompensationHandler { |
| /** |
| * The cached value of the '{@link #getActivity() <em>Activity</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getActivity() |
| * @generated |
| * @ordered |
| */ |
| protected Activity activity; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected CompensationHandlerImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return BPELPackage.Literals.COMPENSATION_HANDLER; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Activity getActivity() { |
| return activity; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| */ |
| public NotificationChain basicSetActivity(Activity newActivity, |
| NotificationChain msgs) { |
| Activity oldActivity = activity; |
| if (!isReconciling) { |
| ReconciliationHelper.replaceChild(this, oldActivity, newActivity); |
| } |
| activity = newActivity; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, |
| Notification.SET, |
| BPELPackage.COMPENSATION_HANDLER__ACTIVITY, oldActivity, |
| newActivity); |
| if (msgs == null) |
| msgs = notification; |
| else |
| msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setActivity(Activity newActivity) { |
| if (newActivity != activity) { |
| NotificationChain msgs = null; |
| if (activity != null) |
| msgs = ((InternalEObject) activity).eInverseRemove(this, |
| EOPPOSITE_FEATURE_BASE |
| - BPELPackage.COMPENSATION_HANDLER__ACTIVITY, |
| null, msgs); |
| if (newActivity != null) |
| msgs = ((InternalEObject) newActivity).eInverseAdd(this, |
| EOPPOSITE_FEATURE_BASE |
| - BPELPackage.COMPENSATION_HANDLER__ACTIVITY, |
| null, msgs); |
| msgs = basicSetActivity(newActivity, msgs); |
| if (msgs != null) |
| msgs.dispatch(); |
| } else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, |
| BPELPackage.COMPENSATION_HANDLER__ACTIVITY, newActivity, |
| newActivity)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, |
| int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case BPELPackage.COMPENSATION_HANDLER__ACTIVITY: |
| return basicSetActivity(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 BPELPackage.COMPENSATION_HANDLER__ACTIVITY: |
| return getActivity(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case BPELPackage.COMPENSATION_HANDLER__ACTIVITY: |
| setActivity((Activity) newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case BPELPackage.COMPENSATION_HANDLER__ACTIVITY: |
| setActivity((Activity) null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case BPELPackage.COMPENSATION_HANDLER__ACTIVITY: |
| return activity != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //CompensationHandlerImpl |