All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.bpmn2.impl.LinkEventDefinitionImpl Maven / Gradle / Ivy

There is a newer version: 7.54.0.Final
Show newest version
/**
 * 
 * 
 * Copyright (c) 2010 SAP AG.
 * 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:
 *    Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation
 * 
 * 
 */
package org.eclipse.bpmn2.impl;

import com.google.gwt.user.client.rpc.GwtTransient;

import java.util.Collection;

import org.eclipse.bpmn2.Bpmn2Package;
import org.eclipse.bpmn2.LinkEventDefinition;

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.EObjectWithInverseResolvingEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * 
 * An implementation of the model object 'Link Event Definition'.
 * 
 * 

* The following features are implemented: *

*
    *
  • {@link org.eclipse.bpmn2.impl.LinkEventDefinitionImpl#getSource Source}
  • *
  • {@link org.eclipse.bpmn2.impl.LinkEventDefinitionImpl#getTarget Target}
  • *
  • {@link org.eclipse.bpmn2.impl.LinkEventDefinitionImpl#getName Name}
  • *
* * @generated */ public class LinkEventDefinitionImpl extends EventDefinitionImpl implements LinkEventDefinition { /** * The cached value of the '{@link #getSource() Source}' reference list. * * * @see #getSource() * @generated * @ordered */ @GwtTransient protected EList source; /** * The cached value of the '{@link #getTarget() Target}' reference. * * * @see #getTarget() * @generated * @ordered */ @GwtTransient protected LinkEventDefinition target; /** * The default value of the '{@link #getName() Name}' attribute. * * * @see #getName() * @generated * @ordered */ protected static final String NAME_EDEFAULT = null; /** * The cached value of the '{@link #getName() Name}' attribute. * * * @see #getName() * @generated * @ordered */ @GwtTransient protected String name = NAME_EDEFAULT; /** * * * @generated */ protected LinkEventDefinitionImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return Bpmn2Package.Literals.LINK_EVENT_DEFINITION; } /** * * * @generated */ @Override public EList getSource() { if (source == null) { source = new EObjectWithInverseResolvingEList(LinkEventDefinition.class, this, Bpmn2Package.LINK_EVENT_DEFINITION__SOURCE, Bpmn2Package.LINK_EVENT_DEFINITION__TARGET); } return source; } /** * * * @generated */ @Override public LinkEventDefinition getTarget() { if (target != null && target.eIsProxy()) { InternalEObject oldTarget = (InternalEObject) target; target = (LinkEventDefinition) eResolveProxy(oldTarget); if (target != oldTarget) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.LINK_EVENT_DEFINITION__TARGET, oldTarget, target)); } } return target; } /** * * * @generated */ public LinkEventDefinition basicGetTarget() { return target; } /** * * * @generated */ public NotificationChain basicSetTarget(LinkEventDefinition newTarget, NotificationChain msgs) { LinkEventDefinition oldTarget = target; target = newTarget; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Bpmn2Package.LINK_EVENT_DEFINITION__TARGET, oldTarget, newTarget); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setTarget(LinkEventDefinition newTarget) { if (newTarget != target) { NotificationChain msgs = null; if (target != null) msgs = ((InternalEObject) target).eInverseRemove(this, Bpmn2Package.LINK_EVENT_DEFINITION__SOURCE, LinkEventDefinition.class, msgs); if (newTarget != null) msgs = ((InternalEObject) newTarget).eInverseAdd(this, Bpmn2Package.LINK_EVENT_DEFINITION__SOURCE, LinkEventDefinition.class, msgs); msgs = basicSetTarget(newTarget, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.LINK_EVENT_DEFINITION__TARGET, newTarget, newTarget)); } /** * * * @generated */ @Override public String getName() { return name; } /** * * * @generated */ @Override public void setName(String newName) { String oldName = name; name = newName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.LINK_EVENT_DEFINITION__NAME, oldName, name)); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case Bpmn2Package.LINK_EVENT_DEFINITION__SOURCE: return ((InternalEList) (InternalEList) getSource()).basicAdd(otherEnd, msgs); case Bpmn2Package.LINK_EVENT_DEFINITION__TARGET: if (target != null) msgs = ((InternalEObject) target).eInverseRemove(this, Bpmn2Package.LINK_EVENT_DEFINITION__SOURCE, LinkEventDefinition.class, msgs); return basicSetTarget((LinkEventDefinition) otherEnd, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case Bpmn2Package.LINK_EVENT_DEFINITION__SOURCE: return ((InternalEList) getSource()).basicRemove(otherEnd, msgs); case Bpmn2Package.LINK_EVENT_DEFINITION__TARGET: return basicSetTarget(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case Bpmn2Package.LINK_EVENT_DEFINITION__SOURCE: return getSource(); case Bpmn2Package.LINK_EVENT_DEFINITION__TARGET: if (resolve) return getTarget(); return basicGetTarget(); case Bpmn2Package.LINK_EVENT_DEFINITION__NAME: return getName(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case Bpmn2Package.LINK_EVENT_DEFINITION__SOURCE: getSource().clear(); getSource().addAll((Collection) newValue); return; case Bpmn2Package.LINK_EVENT_DEFINITION__TARGET: setTarget((LinkEventDefinition) newValue); return; case Bpmn2Package.LINK_EVENT_DEFINITION__NAME: setName((String) newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case Bpmn2Package.LINK_EVENT_DEFINITION__SOURCE: getSource().clear(); return; case Bpmn2Package.LINK_EVENT_DEFINITION__TARGET: setTarget((LinkEventDefinition) null); return; case Bpmn2Package.LINK_EVENT_DEFINITION__NAME: setName(NAME_EDEFAULT); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case Bpmn2Package.LINK_EVENT_DEFINITION__SOURCE: return source != null && !source.isEmpty(); case Bpmn2Package.LINK_EVENT_DEFINITION__TARGET: return target != null; case Bpmn2Package.LINK_EVENT_DEFINITION__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (name: "); result.append(name); result.append(')'); return result.toString(); } } //LinkEventDefinitionImpl




© 2015 - 2025 Weber Informatics LLC | Privacy Policy