blob: 154e38e7d3c0c811c97915d13f9da80d943ccb07 [file] [log] [blame]
/**
*/
package org.eclipse.papyrus.bpmn.BPMNProfile.impl;
import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.DiagnosticChain;
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.plugin.EcorePlugin;
import org.eclipse.emf.ecore.util.EObjectValidator;
import org.eclipse.papyrus.bpmn.BPMNProfile.BPMNMessage;
import org.eclipse.papyrus.bpmn.BPMNProfile.BPMNProfilePackage;
import org.eclipse.papyrus.bpmn.BPMNProfile.InteractionNode;
import org.eclipse.papyrus.bpmn.BPMNProfile.MessageFlow;
import org.eclipse.papyrus.bpmn.BPMNProfile.util.BPMNProfileValidator;
import org.eclipse.uml2.uml.InformationFlow;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Message Flow</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.MessageFlowImpl#getBase_InformationFlow <em>Base Information Flow</em>}</li>
* <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.MessageFlowImpl#getSourceRef <em>Source Ref</em>}</li>
* <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.MessageFlowImpl#getTargetRef <em>Target Ref</em>}</li>
* <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.MessageFlowImpl#getMessageRef <em>Message Ref</em>}</li>
* </ul>
*
* @generated
*/
public class MessageFlowImpl extends BaseElementImpl implements MessageFlow {
/**
* The cached value of the '{@link #getBase_InformationFlow() <em>Base Information Flow</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBase_InformationFlow()
* @generated
* @ordered
*/
protected InformationFlow base_InformationFlow;
/**
* The cached value of the '{@link #getSourceRef() <em>Source Ref</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSourceRef()
* @generated
* @ordered
*/
protected InteractionNode sourceRef;
/**
* The cached value of the '{@link #getTargetRef() <em>Target Ref</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTargetRef()
* @generated
* @ordered
*/
protected InteractionNode targetRef;
/**
* The cached value of the '{@link #getMessageRef() <em>Message Ref</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMessageRef()
* @generated
* @ordered
*/
protected BPMNMessage messageRef;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected MessageFlowImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return BPMNProfilePackage.eINSTANCE.getMessageFlow();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public InformationFlow getBase_InformationFlow() {
if (base_InformationFlow != null && base_InformationFlow.eIsProxy()) {
InternalEObject oldBase_InformationFlow = (InternalEObject)base_InformationFlow;
base_InformationFlow = (InformationFlow)eResolveProxy(oldBase_InformationFlow);
if (base_InformationFlow != oldBase_InformationFlow) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, BPMNProfilePackage.MESSAGE_FLOW__BASE_INFORMATION_FLOW, oldBase_InformationFlow, base_InformationFlow));
}
}
return base_InformationFlow;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public InformationFlow basicGetBase_InformationFlow() {
return base_InformationFlow;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBase_InformationFlow(InformationFlow newBase_InformationFlow) {
InformationFlow oldBase_InformationFlow = base_InformationFlow;
base_InformationFlow = newBase_InformationFlow;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BPMNProfilePackage.MESSAGE_FLOW__BASE_INFORMATION_FLOW, oldBase_InformationFlow, base_InformationFlow));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public InteractionNode getSourceRef() {
if (sourceRef != null && sourceRef.eIsProxy()) {
InternalEObject oldSourceRef = (InternalEObject)sourceRef;
sourceRef = (InteractionNode)eResolveProxy(oldSourceRef);
if (sourceRef != oldSourceRef) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, BPMNProfilePackage.MESSAGE_FLOW__SOURCE_REF, oldSourceRef, sourceRef));
}
}
return sourceRef;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public InteractionNode basicGetSourceRef() {
return sourceRef;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSourceRef(InteractionNode newSourceRef) {
InteractionNode oldSourceRef = sourceRef;
sourceRef = newSourceRef;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BPMNProfilePackage.MESSAGE_FLOW__SOURCE_REF, oldSourceRef, sourceRef));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public InteractionNode getTargetRef() {
if (targetRef != null && targetRef.eIsProxy()) {
InternalEObject oldTargetRef = (InternalEObject)targetRef;
targetRef = (InteractionNode)eResolveProxy(oldTargetRef);
if (targetRef != oldTargetRef) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, BPMNProfilePackage.MESSAGE_FLOW__TARGET_REF, oldTargetRef, targetRef));
}
}
return targetRef;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public InteractionNode basicGetTargetRef() {
return targetRef;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTargetRef(InteractionNode newTargetRef) {
InteractionNode oldTargetRef = targetRef;
targetRef = newTargetRef;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BPMNProfilePackage.MESSAGE_FLOW__TARGET_REF, oldTargetRef, targetRef));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public BPMNMessage getMessageRef() {
if (messageRef != null && messageRef.eIsProxy()) {
InternalEObject oldMessageRef = (InternalEObject)messageRef;
messageRef = (BPMNMessage)eResolveProxy(oldMessageRef);
if (messageRef != oldMessageRef) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, BPMNProfilePackage.MESSAGE_FLOW__MESSAGE_REF, oldMessageRef, messageRef));
}
}
return messageRef;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public BPMNMessage basicGetMessageRef() {
return messageRef;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMessageRef(BPMNMessage newMessageRef) {
BPMNMessage oldMessageRef = messageRef;
messageRef = newMessageRef;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BPMNProfilePackage.MESSAGE_FLOW__MESSAGE_REF, oldMessageRef, messageRef));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean MessageFlowsourceRef(DiagnosticChain diagnostics, Map<Object, Object> context) {
// TODO: implement this method
// -> specify the condition that violates the invariant
// -> verify the details of the diagnostic, including severity and message
// Ensure that you remove @generated or mark it @generated NOT
if (false) {
if (diagnostics != null) {
diagnostics.add
(new BasicDiagnostic
(Diagnostic.ERROR,
BPMNProfileValidator.DIAGNOSTIC_SOURCE,
BPMNProfileValidator.MESSAGE_FLOW__MESSAGE_FLOWSOURCE_REF,
EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "MessageFlowsourceRef", EObjectValidator.getObjectLabel(this, context) }),
new Object [] { this }));
}
return false;
}
return true;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean MessageFlowtargetRef(DiagnosticChain diagnostics, Map<Object, Object> context) {
// TODO: implement this method
// -> specify the condition that violates the invariant
// -> verify the details of the diagnostic, including severity and message
// Ensure that you remove @generated or mark it @generated NOT
if (false) {
if (diagnostics != null) {
diagnostics.add
(new BasicDiagnostic
(Diagnostic.ERROR,
BPMNProfileValidator.DIAGNOSTIC_SOURCE,
BPMNProfileValidator.MESSAGE_FLOW__MESSAGE_FLOWTARGET_REF,
EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "MessageFlowtargetRef", EObjectValidator.getObjectLabel(this, context) }),
new Object [] { this }));
}
return false;
}
return true;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean MessageFlowmessageRef(DiagnosticChain diagnostics, Map<Object, Object> context) {
// TODO: implement this method
// -> specify the condition that violates the invariant
// -> verify the details of the diagnostic, including severity and message
// Ensure that you remove @generated or mark it @generated NOT
if (false) {
if (diagnostics != null) {
diagnostics.add
(new BasicDiagnostic
(Diagnostic.ERROR,
BPMNProfileValidator.DIAGNOSTIC_SOURCE,
BPMNProfileValidator.MESSAGE_FLOW__MESSAGE_FLOWMESSAGE_REF,
EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "MessageFlowmessageRef", EObjectValidator.getObjectLabel(this, context) }),
new Object [] { this }));
}
return false;
}
return true;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case BPMNProfilePackage.MESSAGE_FLOW__BASE_INFORMATION_FLOW:
if (resolve) return getBase_InformationFlow();
return basicGetBase_InformationFlow();
case BPMNProfilePackage.MESSAGE_FLOW__SOURCE_REF:
if (resolve) return getSourceRef();
return basicGetSourceRef();
case BPMNProfilePackage.MESSAGE_FLOW__TARGET_REF:
if (resolve) return getTargetRef();
return basicGetTargetRef();
case BPMNProfilePackage.MESSAGE_FLOW__MESSAGE_REF:
if (resolve) return getMessageRef();
return basicGetMessageRef();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case BPMNProfilePackage.MESSAGE_FLOW__BASE_INFORMATION_FLOW:
setBase_InformationFlow((InformationFlow)newValue);
return;
case BPMNProfilePackage.MESSAGE_FLOW__SOURCE_REF:
setSourceRef((InteractionNode)newValue);
return;
case BPMNProfilePackage.MESSAGE_FLOW__TARGET_REF:
setTargetRef((InteractionNode)newValue);
return;
case BPMNProfilePackage.MESSAGE_FLOW__MESSAGE_REF:
setMessageRef((BPMNMessage)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BPMNProfilePackage.MESSAGE_FLOW__BASE_INFORMATION_FLOW:
setBase_InformationFlow((InformationFlow)null);
return;
case BPMNProfilePackage.MESSAGE_FLOW__SOURCE_REF:
setSourceRef((InteractionNode)null);
return;
case BPMNProfilePackage.MESSAGE_FLOW__TARGET_REF:
setTargetRef((InteractionNode)null);
return;
case BPMNProfilePackage.MESSAGE_FLOW__MESSAGE_REF:
setMessageRef((BPMNMessage)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BPMNProfilePackage.MESSAGE_FLOW__BASE_INFORMATION_FLOW:
return base_InformationFlow != null;
case BPMNProfilePackage.MESSAGE_FLOW__SOURCE_REF:
return sourceRef != null;
case BPMNProfilePackage.MESSAGE_FLOW__TARGET_REF:
return targetRef != null;
case BPMNProfilePackage.MESSAGE_FLOW__MESSAGE_REF:
return messageRef != null;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@SuppressWarnings("unchecked")
public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
switch (operationID) {
case BPMNProfilePackage.MESSAGE_FLOW___MESSAGE_FLOWSOURCE_REF__DIAGNOSTICCHAIN_MAP:
return MessageFlowsourceRef((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1));
case BPMNProfilePackage.MESSAGE_FLOW___MESSAGE_FLOWTARGET_REF__DIAGNOSTICCHAIN_MAP:
return MessageFlowtargetRef((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1));
case BPMNProfilePackage.MESSAGE_FLOW___MESSAGE_FLOWMESSAGE_REF__DIAGNOSTICCHAIN_MAP:
return MessageFlowmessageRef((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1));
}
return super.eInvoke(operationID, arguments);
}
} //MessageFlowImpl