diff options
Diffstat (limited to 'extraplugins/bpmn/org.eclipse.papyrus.bpmn/src/org/eclipse/papyrus/bpmn/BPMNProfile/impl/BPMNInterfaceImpl.java')
-rw-r--r-- | extraplugins/bpmn/org.eclipse.papyrus.bpmn/src/org/eclipse/papyrus/bpmn/BPMNProfile/impl/BPMNInterfaceImpl.java | 427 |
1 files changed, 427 insertions, 0 deletions
diff --git a/extraplugins/bpmn/org.eclipse.papyrus.bpmn/src/org/eclipse/papyrus/bpmn/BPMNProfile/impl/BPMNInterfaceImpl.java b/extraplugins/bpmn/org.eclipse.papyrus.bpmn/src/org/eclipse/papyrus/bpmn/BPMNProfile/impl/BPMNInterfaceImpl.java new file mode 100644 index 00000000000..57db7f373c7 --- /dev/null +++ b/extraplugins/bpmn/org.eclipse.papyrus.bpmn/src/org/eclipse/papyrus/bpmn/BPMNProfile/impl/BPMNInterfaceImpl.java @@ -0,0 +1,427 @@ +/** + */ +package org.eclipse.papyrus.bpmn.BPMNProfile.impl; + +import java.lang.reflect.InvocationTargetException; + +import java.util.Collection; +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.EObjectResolvingEList; +import org.eclipse.emf.ecore.util.EObjectValidator; + +import org.eclipse.papyrus.bpmn.BPMNProfile.BPMNInterface; +import org.eclipse.papyrus.bpmn.BPMNProfile.BPMNOperation; +import org.eclipse.papyrus.bpmn.BPMNProfile.BPMNProfilePackage; +import org.eclipse.papyrus.bpmn.BPMNProfile.CallableElement; + +import org.eclipse.papyrus.bpmn.BPMNProfile.util.BPMNProfileValidator; + +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Interface; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>BPMN Interface</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.BPMNInterfaceImpl#getBase_Interface <em>Base Interface</em>}</li> + * <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.BPMNInterfaceImpl#getImplementationRef <em>Implementation Ref</em>}</li> + * <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.BPMNInterfaceImpl#getOperations <em>Operations</em>}</li> + * <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.BPMNInterfaceImpl#getCallableElements <em>Callable Elements</em>}</li> + * </ul> + * + * @generated + */ +public class BPMNInterfaceImpl extends RootElementImpl implements BPMNInterface { + /** + * The cached value of the '{@link #getBase_Interface() <em>Base Interface</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getBase_Interface() + * @generated + * @ordered + */ + protected Interface base_Interface; + + /** + * The cached value of the '{@link #getImplementationRef() <em>Implementation Ref</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getImplementationRef() + * @generated + * @ordered + */ + protected Element implementationRef; + + /** + * The cached value of the '{@link #getOperations() <em>Operations</em>}' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getOperations() + * @generated + * @ordered + */ + protected EList<BPMNOperation> operations; + + /** + * The cached value of the '{@link #getCallableElements() <em>Callable Elements</em>}' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getCallableElements() + * @generated + * @ordered + */ + protected EList<CallableElement> callableElements; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected BPMNInterfaceImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return BPMNProfilePackage.eINSTANCE.getBPMNInterface(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Interface getBase_Interface() { + if (base_Interface != null && base_Interface.eIsProxy()) { + InternalEObject oldBase_Interface = (InternalEObject)base_Interface; + base_Interface = (Interface)eResolveProxy(oldBase_Interface); + if (base_Interface != oldBase_Interface) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, BPMNProfilePackage.BPMN_INTERFACE__BASE_INTERFACE, oldBase_Interface, base_Interface)); + } + } + return base_Interface; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Interface basicGetBase_Interface() { + return base_Interface; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setBase_Interface(Interface newBase_Interface) { + Interface oldBase_Interface = base_Interface; + base_Interface = newBase_Interface; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BPMNProfilePackage.BPMN_INTERFACE__BASE_INTERFACE, oldBase_Interface, base_Interface)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Element getImplementationRef() { + if (implementationRef != null && implementationRef.eIsProxy()) { + InternalEObject oldImplementationRef = (InternalEObject)implementationRef; + implementationRef = (Element)eResolveProxy(oldImplementationRef); + if (implementationRef != oldImplementationRef) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, BPMNProfilePackage.BPMN_INTERFACE__IMPLEMENTATION_REF, oldImplementationRef, implementationRef)); + } + } + return implementationRef; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Element basicGetImplementationRef() { + return implementationRef; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setImplementationRef(Element newImplementationRef) { + Element oldImplementationRef = implementationRef; + implementationRef = newImplementationRef; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BPMNProfilePackage.BPMN_INTERFACE__IMPLEMENTATION_REF, oldImplementationRef, implementationRef)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<BPMNOperation> getOperations() { + if (operations == null) { + operations = new EObjectResolvingEList<BPMNOperation>(BPMNOperation.class, this, BPMNProfilePackage.BPMN_INTERFACE__OPERATIONS); + } + return operations; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<CallableElement> getCallableElements() { + if (callableElements == null) { + callableElements = new EObjectResolvingEList<CallableElement>(CallableElement.class, this, BPMNProfilePackage.BPMN_INTERFACE__CALLABLE_ELEMENTS); + } + return callableElements; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean Interfaceoperationmultiplicity(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.BPMN_INTERFACE__INTERFACEOPERATIONMULTIPLICITY, + EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "Interfaceoperationmultiplicity", EObjectValidator.getObjectLabel(this, context) }), + new Object [] { this })); + } + return false; + } + return true; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean InterfaceownedOperation(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.BPMN_INTERFACE__INTERFACEOWNED_OPERATION, + EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "InterfaceownedOperation", EObjectValidator.getObjectLabel(this, context) }), + new Object [] { this })); + } + return false; + } + return true; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean BPMNInterfacecallableElements(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.BPMN_INTERFACE__BPMN_INTERFACECALLABLE_ELEMENTS, + EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "BPMNInterfacecallableElements", EObjectValidator.getObjectLabel(this, context) }), + new Object [] { this })); + } + return false; + } + return true; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean BPMNInterfaceoperations(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.BPMN_INTERFACE__BPMN_INTERFACEOPERATIONS, + EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "BPMNInterfaceoperations", 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.BPMN_INTERFACE__BASE_INTERFACE: + if (resolve) return getBase_Interface(); + return basicGetBase_Interface(); + case BPMNProfilePackage.BPMN_INTERFACE__IMPLEMENTATION_REF: + if (resolve) return getImplementationRef(); + return basicGetImplementationRef(); + case BPMNProfilePackage.BPMN_INTERFACE__OPERATIONS: + return getOperations(); + case BPMNProfilePackage.BPMN_INTERFACE__CALLABLE_ELEMENTS: + return getCallableElements(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BPMNProfilePackage.BPMN_INTERFACE__BASE_INTERFACE: + setBase_Interface((Interface)newValue); + return; + case BPMNProfilePackage.BPMN_INTERFACE__IMPLEMENTATION_REF: + setImplementationRef((Element)newValue); + return; + case BPMNProfilePackage.BPMN_INTERFACE__OPERATIONS: + getOperations().clear(); + getOperations().addAll((Collection<? extends BPMNOperation>)newValue); + return; + case BPMNProfilePackage.BPMN_INTERFACE__CALLABLE_ELEMENTS: + getCallableElements().clear(); + getCallableElements().addAll((Collection<? extends CallableElement>)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BPMNProfilePackage.BPMN_INTERFACE__BASE_INTERFACE: + setBase_Interface((Interface)null); + return; + case BPMNProfilePackage.BPMN_INTERFACE__IMPLEMENTATION_REF: + setImplementationRef((Element)null); + return; + case BPMNProfilePackage.BPMN_INTERFACE__OPERATIONS: + getOperations().clear(); + return; + case BPMNProfilePackage.BPMN_INTERFACE__CALLABLE_ELEMENTS: + getCallableElements().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BPMNProfilePackage.BPMN_INTERFACE__BASE_INTERFACE: + return base_Interface != null; + case BPMNProfilePackage.BPMN_INTERFACE__IMPLEMENTATION_REF: + return implementationRef != null; + case BPMNProfilePackage.BPMN_INTERFACE__OPERATIONS: + return operations != null && !operations.isEmpty(); + case BPMNProfilePackage.BPMN_INTERFACE__CALLABLE_ELEMENTS: + return callableElements != null && !callableElements.isEmpty(); + } + 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.BPMN_INTERFACE___INTERFACEOPERATIONMULTIPLICITY__DIAGNOSTICCHAIN_MAP: + return Interfaceoperationmultiplicity((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); + case BPMNProfilePackage.BPMN_INTERFACE___INTERFACEOWNED_OPERATION__DIAGNOSTICCHAIN_MAP: + return InterfaceownedOperation((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); + case BPMNProfilePackage.BPMN_INTERFACE___BPMN_INTERFACECALLABLE_ELEMENTS__DIAGNOSTICCHAIN_MAP: + return BPMNInterfacecallableElements((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); + case BPMNProfilePackage.BPMN_INTERFACE___BPMN_INTERFACEOPERATIONS__DIAGNOSTICCHAIN_MAP: + return BPMNInterfaceoperations((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); + } + return super.eInvoke(operationID, arguments); + } + +} //BPMNInterfaceImpl |