| /** |
| * Copyright (c) 2014, 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 |
| * |
| * Based on ideas from Xtext, Xtend, Xcore |
| * |
| * Contributors: |
| * Loetz GmbH&Co.KG - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.blip.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.bpmn2.Gateway; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| |
| import org.eclipse.emf.common.util.EList; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| import org.eclipse.osbp.xtext.blip.BlipDSLPackage; |
| import org.eclipse.osbp.xtext.blip.BlipOutGoing; |
| import org.eclipse.osbp.xtext.blip.BlipSplitGateway; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Blip Split Gateway</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.blip.impl.BlipSplitGatewayImpl#getGateway <em>Gateway</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.blip.impl.BlipSplitGatewayImpl#getOutgoings <em>Outgoings</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class BlipSplitGatewayImpl extends BlipItemImpl implements BlipSplitGateway { |
| /** |
| * The cached value of the '{@link #getGateway() <em>Gateway</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getGateway() |
| * @generated |
| * @ordered |
| */ |
| protected Gateway gateway; |
| |
| /** |
| * The cached value of the '{@link #getOutgoings() <em>Outgoings</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOutgoings() |
| * @generated |
| * @ordered |
| */ |
| protected EList<BlipOutGoing> outgoings; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected BlipSplitGatewayImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return BlipDSLPackage.Literals.BLIP_SPLIT_GATEWAY; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Gateway getGateway() { |
| if (gateway != null && gateway.eIsProxy()) { |
| InternalEObject oldGateway = (InternalEObject)gateway; |
| gateway = (Gateway)eResolveProxy(oldGateway); |
| if (gateway != oldGateway) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, BlipDSLPackage.BLIP_SPLIT_GATEWAY__GATEWAY, oldGateway, gateway)); |
| } |
| } |
| return gateway; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Gateway basicGetGateway() { |
| return gateway; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setGateway(Gateway newGateway) { |
| Gateway oldGateway = gateway; |
| gateway = newGateway; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, BlipDSLPackage.BLIP_SPLIT_GATEWAY__GATEWAY, oldGateway, gateway)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<BlipOutGoing> getOutgoings() { |
| if (outgoings == null) { |
| outgoings = new EObjectContainmentEList<BlipOutGoing>(BlipOutGoing.class, this, BlipDSLPackage.BLIP_SPLIT_GATEWAY__OUTGOINGS); |
| } |
| return outgoings; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case BlipDSLPackage.BLIP_SPLIT_GATEWAY__OUTGOINGS: |
| return ((InternalEList<?>)getOutgoings()).basicRemove(otherEnd, 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 BlipDSLPackage.BLIP_SPLIT_GATEWAY__GATEWAY: |
| if (resolve) return getGateway(); |
| return basicGetGateway(); |
| case BlipDSLPackage.BLIP_SPLIT_GATEWAY__OUTGOINGS: |
| return getOutgoings(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case BlipDSLPackage.BLIP_SPLIT_GATEWAY__GATEWAY: |
| setGateway((Gateway)newValue); |
| return; |
| case BlipDSLPackage.BLIP_SPLIT_GATEWAY__OUTGOINGS: |
| getOutgoings().clear(); |
| getOutgoings().addAll((Collection<? extends BlipOutGoing>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case BlipDSLPackage.BLIP_SPLIT_GATEWAY__GATEWAY: |
| setGateway((Gateway)null); |
| return; |
| case BlipDSLPackage.BLIP_SPLIT_GATEWAY__OUTGOINGS: |
| getOutgoings().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case BlipDSLPackage.BLIP_SPLIT_GATEWAY__GATEWAY: |
| return gateway != null; |
| case BlipDSLPackage.BLIP_SPLIT_GATEWAY__OUTGOINGS: |
| return outgoings != null && !outgoings.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //BlipSplitGatewayImpl |