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

org.omg.bpmn.bpmn2.impl.ParticipantImpl Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 2012 - 2024 Data In Motion 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 is available at https://www.eclipse.org/legal/epl-2.0/
 * 
 * SPDX-License-Identifier: EPL-2.0
 * 
 * Contributors:
 *      Mark Hoffmann - initial API and implementation
 */
package org.omg.bpmn.bpmn2.impl;

import java.util.Collection;

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.EObjectResolvingEList;

import org.omg.bpmn.bpmn2.Bpmn2Package;
import org.omg.bpmn.bpmn2.ConversationLink;
import org.omg.bpmn.bpmn2.EndPoint;
import org.omg.bpmn.bpmn2.InteractionNode;
import org.omg.bpmn.bpmn2.Interface;
import org.omg.bpmn.bpmn2.Participant;
import org.omg.bpmn.bpmn2.ParticipantMultiplicity;

/**
 * 
 * An implementation of the model object 'Participant'.
 * 
 * 

* The following features are implemented: *

*
    *
  • {@link org.omg.bpmn.bpmn2.impl.ParticipantImpl#getIncomingConversationLinks Incoming Conversation Links}
  • *
  • {@link org.omg.bpmn.bpmn2.impl.ParticipantImpl#getOutgoingConversationLinks Outgoing Conversation Links}
  • *
  • {@link org.omg.bpmn.bpmn2.impl.ParticipantImpl#getInterfaceRefs Interface Refs}
  • *
  • {@link org.omg.bpmn.bpmn2.impl.ParticipantImpl#getEndPointRefs End Point Refs}
  • *
  • {@link org.omg.bpmn.bpmn2.impl.ParticipantImpl#getParticipantMultiplicity Participant Multiplicity}
  • *
  • {@link org.omg.bpmn.bpmn2.impl.ParticipantImpl#getName Name}
  • *
  • {@link org.omg.bpmn.bpmn2.impl.ParticipantImpl#getProcessRef Process Ref}
  • *
* * @generated */ public class ParticipantImpl extends BaseElementImpl implements Participant { /** * The cached value of the '{@link #getInterfaceRefs() Interface Refs}' reference list. * * * @see #getInterfaceRefs() * @generated * @ordered */ protected EList interfaceRefs; /** * The cached value of the '{@link #getEndPointRefs() End Point Refs}' reference list. * * * @see #getEndPointRefs() * @generated * @ordered */ protected EList endPointRefs; /** * The cached value of the '{@link #getParticipantMultiplicity() Participant Multiplicity}' containment reference. * * * @see #getParticipantMultiplicity() * @generated * @ordered */ protected ParticipantMultiplicity participantMultiplicity; /** * 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 */ protected String name = NAME_EDEFAULT; /** * The cached value of the '{@link #getProcessRef() Process Ref}' reference. * * * @see #getProcessRef() * @generated * @ordered */ protected org.omg.bpmn.bpmn2.Process processRef; /** * * * @generated */ protected ParticipantImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return Bpmn2Package.eINSTANCE.getParticipant(); } /** * * * @generated */ @Override public EList getIncomingConversationLinks() { // TODO: implement this method to return the 'Incoming Conversation Links' reference list // Ensure that you remove @generated or mark it @generated NOT // The list is expected to implement org.eclipse.emf.ecore.util.InternalEList and org.eclipse.emf.ecore.EStructuralFeature.Setting // so it's likely that an appropriate subclass of org.eclipse.emf.ecore.util.EcoreEList should be used. throw new UnsupportedOperationException(); } /** * * * @generated */ @Override public EList getOutgoingConversationLinks() { // TODO: implement this method to return the 'Outgoing Conversation Links' reference list // Ensure that you remove @generated or mark it @generated NOT // The list is expected to implement org.eclipse.emf.ecore.util.InternalEList and org.eclipse.emf.ecore.EStructuralFeature.Setting // so it's likely that an appropriate subclass of org.eclipse.emf.ecore.util.EcoreEList should be used. throw new UnsupportedOperationException(); } /** * * * @generated */ @Override public EList getInterfaceRefs() { if (interfaceRefs == null) { interfaceRefs = new EObjectResolvingEList(Interface.class, this, Bpmn2Package.PARTICIPANT__INTERFACE_REFS); } return interfaceRefs; } /** * * * @generated */ @Override public EList getEndPointRefs() { if (endPointRefs == null) { endPointRefs = new EObjectResolvingEList(EndPoint.class, this, Bpmn2Package.PARTICIPANT__END_POINT_REFS); } return endPointRefs; } /** * * * @generated */ @Override public ParticipantMultiplicity getParticipantMultiplicity() { return participantMultiplicity; } /** * * * @generated */ public NotificationChain basicSetParticipantMultiplicity(ParticipantMultiplicity newParticipantMultiplicity, NotificationChain msgs) { ParticipantMultiplicity oldParticipantMultiplicity = participantMultiplicity; participantMultiplicity = newParticipantMultiplicity; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Bpmn2Package.PARTICIPANT__PARTICIPANT_MULTIPLICITY, oldParticipantMultiplicity, newParticipantMultiplicity); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setParticipantMultiplicity(ParticipantMultiplicity newParticipantMultiplicity) { if (newParticipantMultiplicity != participantMultiplicity) { NotificationChain msgs = null; if (participantMultiplicity != null) msgs = ((InternalEObject)participantMultiplicity).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - Bpmn2Package.PARTICIPANT__PARTICIPANT_MULTIPLICITY, null, msgs); if (newParticipantMultiplicity != null) msgs = ((InternalEObject)newParticipantMultiplicity).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - Bpmn2Package.PARTICIPANT__PARTICIPANT_MULTIPLICITY, null, msgs); msgs = basicSetParticipantMultiplicity(newParticipantMultiplicity, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.PARTICIPANT__PARTICIPANT_MULTIPLICITY, newParticipantMultiplicity, newParticipantMultiplicity)); } /** * * * @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.PARTICIPANT__NAME, oldName, name)); } /** * * * @generated */ @Override public org.omg.bpmn.bpmn2.Process getProcessRef() { if (processRef != null && processRef.eIsProxy()) { InternalEObject oldProcessRef = (InternalEObject)processRef; processRef = (org.omg.bpmn.bpmn2.Process)eResolveProxy(oldProcessRef); if (processRef != oldProcessRef) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.PARTICIPANT__PROCESS_REF, oldProcessRef, processRef)); } } return processRef; } /** * * * @generated */ public org.omg.bpmn.bpmn2.Process basicGetProcessRef() { return processRef; } /** * * * @generated */ @Override public void setProcessRef(org.omg.bpmn.bpmn2.Process newProcessRef) { org.omg.bpmn.bpmn2.Process oldProcessRef = processRef; processRef = newProcessRef; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.PARTICIPANT__PROCESS_REF, oldProcessRef, processRef)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case Bpmn2Package.PARTICIPANT__PARTICIPANT_MULTIPLICITY: return basicSetParticipantMultiplicity(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case Bpmn2Package.PARTICIPANT__INCOMING_CONVERSATION_LINKS: return getIncomingConversationLinks(); case Bpmn2Package.PARTICIPANT__OUTGOING_CONVERSATION_LINKS: return getOutgoingConversationLinks(); case Bpmn2Package.PARTICIPANT__INTERFACE_REFS: return getInterfaceRefs(); case Bpmn2Package.PARTICIPANT__END_POINT_REFS: return getEndPointRefs(); case Bpmn2Package.PARTICIPANT__PARTICIPANT_MULTIPLICITY: return getParticipantMultiplicity(); case Bpmn2Package.PARTICIPANT__NAME: return getName(); case Bpmn2Package.PARTICIPANT__PROCESS_REF: if (resolve) return getProcessRef(); return basicGetProcessRef(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case Bpmn2Package.PARTICIPANT__INTERFACE_REFS: getInterfaceRefs().clear(); getInterfaceRefs().addAll((Collection)newValue); return; case Bpmn2Package.PARTICIPANT__END_POINT_REFS: getEndPointRefs().clear(); getEndPointRefs().addAll((Collection)newValue); return; case Bpmn2Package.PARTICIPANT__PARTICIPANT_MULTIPLICITY: setParticipantMultiplicity((ParticipantMultiplicity)newValue); return; case Bpmn2Package.PARTICIPANT__NAME: setName((String)newValue); return; case Bpmn2Package.PARTICIPANT__PROCESS_REF: setProcessRef((org.omg.bpmn.bpmn2.Process)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case Bpmn2Package.PARTICIPANT__INTERFACE_REFS: getInterfaceRefs().clear(); return; case Bpmn2Package.PARTICIPANT__END_POINT_REFS: getEndPointRefs().clear(); return; case Bpmn2Package.PARTICIPANT__PARTICIPANT_MULTIPLICITY: setParticipantMultiplicity((ParticipantMultiplicity)null); return; case Bpmn2Package.PARTICIPANT__NAME: setName(NAME_EDEFAULT); return; case Bpmn2Package.PARTICIPANT__PROCESS_REF: setProcessRef((org.omg.bpmn.bpmn2.Process)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case Bpmn2Package.PARTICIPANT__INCOMING_CONVERSATION_LINKS: return !getIncomingConversationLinks().isEmpty(); case Bpmn2Package.PARTICIPANT__OUTGOING_CONVERSATION_LINKS: return !getOutgoingConversationLinks().isEmpty(); case Bpmn2Package.PARTICIPANT__INTERFACE_REFS: return interfaceRefs != null && !interfaceRefs.isEmpty(); case Bpmn2Package.PARTICIPANT__END_POINT_REFS: return endPointRefs != null && !endPointRefs.isEmpty(); case Bpmn2Package.PARTICIPANT__PARTICIPANT_MULTIPLICITY: return participantMultiplicity != null; case Bpmn2Package.PARTICIPANT__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case Bpmn2Package.PARTICIPANT__PROCESS_REF: return processRef != null; } return super.eIsSet(featureID); } /** * * * @generated */ @Override public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { if (baseClass == InteractionNode.class) { switch (derivedFeatureID) { case Bpmn2Package.PARTICIPANT__INCOMING_CONVERSATION_LINKS: return Bpmn2Package.INTERACTION_NODE__INCOMING_CONVERSATION_LINKS; case Bpmn2Package.PARTICIPANT__OUTGOING_CONVERSATION_LINKS: return Bpmn2Package.INTERACTION_NODE__OUTGOING_CONVERSATION_LINKS; default: return -1; } } return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); } /** * * * @generated */ @Override public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { if (baseClass == InteractionNode.class) { switch (baseFeatureID) { case Bpmn2Package.INTERACTION_NODE__INCOMING_CONVERSATION_LINKS: return Bpmn2Package.PARTICIPANT__INCOMING_CONVERSATION_LINKS; case Bpmn2Package.INTERACTION_NODE__OUTGOING_CONVERSATION_LINKS: return Bpmn2Package.PARTICIPANT__OUTGOING_CONVERSATION_LINKS; default: return -1; } } return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); } /** * * * @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(); } } //ParticipantImpl




© 2015 - 2024 Weber Informatics LLC | Privacy Policy