| /** |
| */ |
| package org.eclipse.upr.bpmnprof.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.uml2.uml.InformationFlow; |
| |
| import org.eclipse.upr.bpmnprof.BPMNMessage; |
| import org.eclipse.upr.bpmnprof.BpmnprofPackage; |
| import org.eclipse.upr.bpmnprof.InteractionNode; |
| import org.eclipse.upr.bpmnprof.MessageFlow; |
| |
| import org.eclipse.upr.bpmnprof.util.BpmnprofValidator; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Message Flow</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.upr.bpmnprof.impl.MessageFlowImpl#getBase_InformationFlow <em>Base Information Flow</em>}</li> |
| * <li>{@link org.eclipse.upr.bpmnprof.impl.MessageFlowImpl#getSourceRef <em>Source Ref</em>}</li> |
| * <li>{@link org.eclipse.upr.bpmnprof.impl.MessageFlowImpl#getTargetRef <em>Target Ref</em>}</li> |
| * <li>{@link org.eclipse.upr.bpmnprof.impl.MessageFlowImpl#getMessageRef <em>Message Ref</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @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; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected MessageFlowImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return BpmnprofPackage.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, BpmnprofPackage.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, BpmnprofPackage.MESSAGE_FLOW__BASE_INFORMATION_FLOW, oldBase_InformationFlow, base_InformationFlow)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public InteractionNode getSourceRef() { |
| InteractionNode sourceRef = basicGetSourceRef(); |
| return sourceRef != null && sourceRef.eIsProxy() ? (InteractionNode)eResolveProxy((InternalEObject)sourceRef) : sourceRef; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public InteractionNode basicGetSourceRef() { |
| // TODO: implement this method to return the 'Source Ref' reference |
| // -> do not perform proxy resolution |
| // Ensure that you remove @generated or mark it @generated NOT |
| throw new UnsupportedOperationException(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setSourceRef(InteractionNode newSourceRef) { |
| // TODO: implement this method to set the 'Source Ref' reference |
| // Ensure that you remove @generated or mark it @generated NOT |
| throw new UnsupportedOperationException(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public InteractionNode getTargetRef() { |
| InteractionNode targetRef = basicGetTargetRef(); |
| return targetRef != null && targetRef.eIsProxy() ? (InteractionNode)eResolveProxy((InternalEObject)targetRef) : targetRef; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public InteractionNode basicGetTargetRef() { |
| // TODO: implement this method to return the 'Target Ref' reference |
| // -> do not perform proxy resolution |
| // Ensure that you remove @generated or mark it @generated NOT |
| throw new UnsupportedOperationException(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setTargetRef(InteractionNode newTargetRef) { |
| // TODO: implement this method to set the 'Target Ref' reference |
| // Ensure that you remove @generated or mark it @generated NOT |
| throw new UnsupportedOperationException(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public BPMNMessage getMessageRef() { |
| BPMNMessage messageRef = basicGetMessageRef(); |
| return messageRef != null && messageRef.eIsProxy() ? (BPMNMessage)eResolveProxy((InternalEObject)messageRef) : messageRef; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public BPMNMessage basicGetMessageRef() { |
| // TODO: implement this method to return the 'Message Ref' reference |
| // -> do not perform proxy resolution |
| // Ensure that you remove @generated or mark it @generated NOT |
| throw new UnsupportedOperationException(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setMessageRef(BPMNMessage newMessageRef) { |
| // TODO: implement this method to set the 'Message Ref' reference |
| // Ensure that you remove @generated or mark it @generated NOT |
| throw new UnsupportedOperationException(); |
| } |
| |
| /** |
| * <!-- 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, |
| BpmnprofValidator.DIAGNOSTIC_SOURCE, |
| BpmnprofValidator.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, |
| BpmnprofValidator.DIAGNOSTIC_SOURCE, |
| BpmnprofValidator.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, |
| BpmnprofValidator.DIAGNOSTIC_SOURCE, |
| BpmnprofValidator.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 BpmnprofPackage.MESSAGE_FLOW__BASE_INFORMATION_FLOW: |
| if (resolve) return getBase_InformationFlow(); |
| return basicGetBase_InformationFlow(); |
| case BpmnprofPackage.MESSAGE_FLOW__SOURCE_REF: |
| if (resolve) return getSourceRef(); |
| return basicGetSourceRef(); |
| case BpmnprofPackage.MESSAGE_FLOW__TARGET_REF: |
| if (resolve) return getTargetRef(); |
| return basicGetTargetRef(); |
| case BpmnprofPackage.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 BpmnprofPackage.MESSAGE_FLOW__BASE_INFORMATION_FLOW: |
| setBase_InformationFlow((InformationFlow)newValue); |
| return; |
| case BpmnprofPackage.MESSAGE_FLOW__SOURCE_REF: |
| setSourceRef((InteractionNode)newValue); |
| return; |
| case BpmnprofPackage.MESSAGE_FLOW__TARGET_REF: |
| setTargetRef((InteractionNode)newValue); |
| return; |
| case BpmnprofPackage.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 BpmnprofPackage.MESSAGE_FLOW__BASE_INFORMATION_FLOW: |
| setBase_InformationFlow((InformationFlow)null); |
| return; |
| case BpmnprofPackage.MESSAGE_FLOW__SOURCE_REF: |
| setSourceRef((InteractionNode)null); |
| return; |
| case BpmnprofPackage.MESSAGE_FLOW__TARGET_REF: |
| setTargetRef((InteractionNode)null); |
| return; |
| case BpmnprofPackage.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 BpmnprofPackage.MESSAGE_FLOW__BASE_INFORMATION_FLOW: |
| return base_InformationFlow != null; |
| case BpmnprofPackage.MESSAGE_FLOW__SOURCE_REF: |
| return basicGetSourceRef() != null; |
| case BpmnprofPackage.MESSAGE_FLOW__TARGET_REF: |
| return basicGetTargetRef() != null; |
| case BpmnprofPackage.MESSAGE_FLOW__MESSAGE_REF: |
| return basicGetMessageRef() != 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 BpmnprofPackage.MESSAGE_FLOW___MESSAGE_FLOWSOURCE_REF__DIAGNOSTICCHAIN_MAP: |
| return MessageFlowsourceRef((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); |
| case BpmnprofPackage.MESSAGE_FLOW___MESSAGE_FLOWTARGET_REF__DIAGNOSTICCHAIN_MAP: |
| return MessageFlowtargetRef((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); |
| case BpmnprofPackage.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 |