blob: a9f3534966e44a27e72264b3b66972adc7f6ada3 [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.BPMNProfilePackage;
import org.eclipse.papyrus.bpmn.BPMNProfile.Participant;
import org.eclipse.papyrus.bpmn.BPMNProfile.ParticipantAssociation;
import org.eclipse.papyrus.bpmn.BPMNProfile.util.BPMNProfileValidator;
import org.eclipse.uml2.uml.Dependency;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Participant Association</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.ParticipantAssociationImpl#getBase_Dependency <em>Base Dependency</em>}</li>
* <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.ParticipantAssociationImpl#getInnerParticipantRef <em>Inner Participant Ref</em>}</li>
* <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.ParticipantAssociationImpl#getOuterParticipantRef <em>Outer Participant Ref</em>}</li>
* </ul>
*
* @generated
*/
public class ParticipantAssociationImpl extends BaseElementImpl implements ParticipantAssociation {
/**
* The cached value of the '{@link #getBase_Dependency() <em>Base Dependency</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBase_Dependency()
* @generated
* @ordered
*/
protected Dependency base_Dependency;
/**
* The cached value of the '{@link #getInnerParticipantRef() <em>Inner Participant Ref</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInnerParticipantRef()
* @generated
* @ordered
*/
protected Participant innerParticipantRef;
/**
* The cached value of the '{@link #getOuterParticipantRef() <em>Outer Participant Ref</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOuterParticipantRef()
* @generated
* @ordered
*/
protected Participant outerParticipantRef;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ParticipantAssociationImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return BPMNProfilePackage.eINSTANCE.getParticipantAssociation();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Dependency getBase_Dependency() {
if (base_Dependency != null && base_Dependency.eIsProxy()) {
InternalEObject oldBase_Dependency = (InternalEObject)base_Dependency;
base_Dependency = (Dependency)eResolveProxy(oldBase_Dependency);
if (base_Dependency != oldBase_Dependency) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, BPMNProfilePackage.PARTICIPANT_ASSOCIATION__BASE_DEPENDENCY, oldBase_Dependency, base_Dependency));
}
}
return base_Dependency;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Dependency basicGetBase_Dependency() {
return base_Dependency;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBase_Dependency(Dependency newBase_Dependency) {
Dependency oldBase_Dependency = base_Dependency;
base_Dependency = newBase_Dependency;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BPMNProfilePackage.PARTICIPANT_ASSOCIATION__BASE_DEPENDENCY, oldBase_Dependency, base_Dependency));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Participant getInnerParticipantRef() {
if (innerParticipantRef != null && innerParticipantRef.eIsProxy()) {
InternalEObject oldInnerParticipantRef = (InternalEObject)innerParticipantRef;
innerParticipantRef = (Participant)eResolveProxy(oldInnerParticipantRef);
if (innerParticipantRef != oldInnerParticipantRef) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, BPMNProfilePackage.PARTICIPANT_ASSOCIATION__INNER_PARTICIPANT_REF, oldInnerParticipantRef, innerParticipantRef));
}
}
return innerParticipantRef;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Participant basicGetInnerParticipantRef() {
return innerParticipantRef;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setInnerParticipantRef(Participant newInnerParticipantRef) {
Participant oldInnerParticipantRef = innerParticipantRef;
innerParticipantRef = newInnerParticipantRef;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BPMNProfilePackage.PARTICIPANT_ASSOCIATION__INNER_PARTICIPANT_REF, oldInnerParticipantRef, innerParticipantRef));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Participant getOuterParticipantRef() {
if (outerParticipantRef != null && outerParticipantRef.eIsProxy()) {
InternalEObject oldOuterParticipantRef = (InternalEObject)outerParticipantRef;
outerParticipantRef = (Participant)eResolveProxy(oldOuterParticipantRef);
if (outerParticipantRef != oldOuterParticipantRef) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, BPMNProfilePackage.PARTICIPANT_ASSOCIATION__OUTER_PARTICIPANT_REF, oldOuterParticipantRef, outerParticipantRef));
}
}
return outerParticipantRef;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Participant basicGetOuterParticipantRef() {
return outerParticipantRef;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOuterParticipantRef(Participant newOuterParticipantRef) {
Participant oldOuterParticipantRef = outerParticipantRef;
outerParticipantRef = newOuterParticipantRef;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BPMNProfilePackage.PARTICIPANT_ASSOCIATION__OUTER_PARTICIPANT_REF, oldOuterParticipantRef, outerParticipantRef));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean ParticipantAssociationinnerParticipantRef(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.PARTICIPANT_ASSOCIATION__PARTICIPANT_ASSOCIATIONINNER_PARTICIPANT_REF,
EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "ParticipantAssociationinnerParticipantRef", EObjectValidator.getObjectLabel(this, context) }),
new Object [] { this }));
}
return false;
}
return true;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean ParticipantAssociationouterParticipantRef(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.PARTICIPANT_ASSOCIATION__PARTICIPANT_ASSOCIATIONOUTER_PARTICIPANT_REF,
EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "ParticipantAssociationouterParticipantRef", 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.PARTICIPANT_ASSOCIATION__BASE_DEPENDENCY:
if (resolve) return getBase_Dependency();
return basicGetBase_Dependency();
case BPMNProfilePackage.PARTICIPANT_ASSOCIATION__INNER_PARTICIPANT_REF:
if (resolve) return getInnerParticipantRef();
return basicGetInnerParticipantRef();
case BPMNProfilePackage.PARTICIPANT_ASSOCIATION__OUTER_PARTICIPANT_REF:
if (resolve) return getOuterParticipantRef();
return basicGetOuterParticipantRef();
}
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.PARTICIPANT_ASSOCIATION__BASE_DEPENDENCY:
setBase_Dependency((Dependency)newValue);
return;
case BPMNProfilePackage.PARTICIPANT_ASSOCIATION__INNER_PARTICIPANT_REF:
setInnerParticipantRef((Participant)newValue);
return;
case BPMNProfilePackage.PARTICIPANT_ASSOCIATION__OUTER_PARTICIPANT_REF:
setOuterParticipantRef((Participant)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BPMNProfilePackage.PARTICIPANT_ASSOCIATION__BASE_DEPENDENCY:
setBase_Dependency((Dependency)null);
return;
case BPMNProfilePackage.PARTICIPANT_ASSOCIATION__INNER_PARTICIPANT_REF:
setInnerParticipantRef((Participant)null);
return;
case BPMNProfilePackage.PARTICIPANT_ASSOCIATION__OUTER_PARTICIPANT_REF:
setOuterParticipantRef((Participant)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BPMNProfilePackage.PARTICIPANT_ASSOCIATION__BASE_DEPENDENCY:
return base_Dependency != null;
case BPMNProfilePackage.PARTICIPANT_ASSOCIATION__INNER_PARTICIPANT_REF:
return innerParticipantRef != null;
case BPMNProfilePackage.PARTICIPANT_ASSOCIATION__OUTER_PARTICIPANT_REF:
return outerParticipantRef != 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.PARTICIPANT_ASSOCIATION___PARTICIPANT_ASSOCIATIONINNER_PARTICIPANT_REF__DIAGNOSTICCHAIN_MAP:
return ParticipantAssociationinnerParticipantRef((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1));
case BPMNProfilePackage.PARTICIPANT_ASSOCIATION___PARTICIPANT_ASSOCIATIONOUTER_PARTICIPANT_REF__DIAGNOSTICCHAIN_MAP:
return ParticipantAssociationouterParticipantRef((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1));
}
return super.eInvoke(operationID, arguments);
}
} //ParticipantAssociationImpl