| /** |
| * Copyright (c) 2014 Fraunhofer FOKUS |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Max Bureck |
| */ |
| 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.Slot; |
| |
| import org.eclipse.upr.bpmnprof.BPMNExpression; |
| import org.eclipse.upr.bpmnprof.BpmnprofPackage; |
| import org.eclipse.upr.bpmnprof.ResourceParameter; |
| import org.eclipse.upr.bpmnprof.ResourceParameterBinding; |
| |
| import org.eclipse.upr.bpmnprof.util.BpmnprofValidator; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Resource Parameter Binding</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.upr.bpmnprof.impl.ResourceParameterBindingImpl#getBase_Slot <em>Base Slot</em>}</li> |
| * <li>{@link org.eclipse.upr.bpmnprof.impl.ResourceParameterBindingImpl#getParameterRef <em>Parameter Ref</em>}</li> |
| * <li>{@link org.eclipse.upr.bpmnprof.impl.ResourceParameterBindingImpl#getExpression <em>Expression</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class ResourceParameterBindingImpl extends BaseElementImpl implements ResourceParameterBinding { |
| /** |
| * The cached value of the '{@link #getBase_Slot() <em>Base Slot</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getBase_Slot() |
| * @generated |
| * @ordered |
| */ |
| protected Slot base_Slot; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ResourceParameterBindingImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return BpmnprofPackage.eINSTANCE.getResourceParameterBinding(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Slot getBase_Slot() { |
| if (base_Slot != null && base_Slot.eIsProxy()) { |
| InternalEObject oldBase_Slot = (InternalEObject)base_Slot; |
| base_Slot = (Slot)eResolveProxy(oldBase_Slot); |
| if (base_Slot != oldBase_Slot) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, BpmnprofPackage.RESOURCE_PARAMETER_BINDING__BASE_SLOT, oldBase_Slot, base_Slot)); |
| } |
| } |
| return base_Slot; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Slot basicGetBase_Slot() { |
| return base_Slot; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setBase_Slot(Slot newBase_Slot) { |
| Slot oldBase_Slot = base_Slot; |
| base_Slot = newBase_Slot; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, BpmnprofPackage.RESOURCE_PARAMETER_BINDING__BASE_SLOT, oldBase_Slot, base_Slot)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ResourceParameter getParameterRef() { |
| ResourceParameter parameterRef = basicGetParameterRef(); |
| return parameterRef != null && parameterRef.eIsProxy() ? (ResourceParameter)eResolveProxy((InternalEObject)parameterRef) : parameterRef; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ResourceParameter basicGetParameterRef() { |
| // TODO: implement this method to return the 'Parameter 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 setParameterRef(ResourceParameter newParameterRef) { |
| // TODO: implement this method to set the 'Parameter Ref' reference |
| // Ensure that you remove @generated or mark it @generated NOT |
| throw new UnsupportedOperationException(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public BPMNExpression getExpression() { |
| BPMNExpression expression = basicGetExpression(); |
| return expression != null && expression.eIsProxy() ? (BPMNExpression)eResolveProxy((InternalEObject)expression) : expression; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public BPMNExpression basicGetExpression() { |
| // TODO: implement this method to return the 'Expression' 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 setExpression(BPMNExpression newExpression) { |
| // TODO: implement this method to set the 'Expression' reference |
| // Ensure that you remove @generated or mark it @generated NOT |
| throw new UnsupportedOperationException(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean ResourceParameterBindingexpression(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.RESOURCE_PARAMETER_BINDING__RESOURCE_PARAMETER_BINDINGEXPRESSION, |
| EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "ResourceParameterBindingexpression", EObjectValidator.getObjectLabel(this, context) }), |
| new Object [] { this })); |
| } |
| return false; |
| } |
| return true; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean ResourceParameterBindingparameterRef(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.RESOURCE_PARAMETER_BINDING__RESOURCE_PARAMETER_BINDINGPARAMETER_REF, |
| EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "ResourceParameterBindingparameterRef", 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.RESOURCE_PARAMETER_BINDING__BASE_SLOT: |
| if (resolve) return getBase_Slot(); |
| return basicGetBase_Slot(); |
| case BpmnprofPackage.RESOURCE_PARAMETER_BINDING__PARAMETER_REF: |
| if (resolve) return getParameterRef(); |
| return basicGetParameterRef(); |
| case BpmnprofPackage.RESOURCE_PARAMETER_BINDING__EXPRESSION: |
| if (resolve) return getExpression(); |
| return basicGetExpression(); |
| } |
| 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.RESOURCE_PARAMETER_BINDING__BASE_SLOT: |
| setBase_Slot((Slot)newValue); |
| return; |
| case BpmnprofPackage.RESOURCE_PARAMETER_BINDING__PARAMETER_REF: |
| setParameterRef((ResourceParameter)newValue); |
| return; |
| case BpmnprofPackage.RESOURCE_PARAMETER_BINDING__EXPRESSION: |
| setExpression((BPMNExpression)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case BpmnprofPackage.RESOURCE_PARAMETER_BINDING__BASE_SLOT: |
| setBase_Slot((Slot)null); |
| return; |
| case BpmnprofPackage.RESOURCE_PARAMETER_BINDING__PARAMETER_REF: |
| setParameterRef((ResourceParameter)null); |
| return; |
| case BpmnprofPackage.RESOURCE_PARAMETER_BINDING__EXPRESSION: |
| setExpression((BPMNExpression)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case BpmnprofPackage.RESOURCE_PARAMETER_BINDING__BASE_SLOT: |
| return base_Slot != null; |
| case BpmnprofPackage.RESOURCE_PARAMETER_BINDING__PARAMETER_REF: |
| return basicGetParameterRef() != null; |
| case BpmnprofPackage.RESOURCE_PARAMETER_BINDING__EXPRESSION: |
| return basicGetExpression() != 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.RESOURCE_PARAMETER_BINDING___RESOURCE_PARAMETER_BINDINGEXPRESSION__DIAGNOSTICCHAIN_MAP: |
| return ResourceParameterBindingexpression((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); |
| case BpmnprofPackage.RESOURCE_PARAMETER_BINDING___RESOURCE_PARAMETER_BINDINGPARAMETER_REF__DIAGNOSTICCHAIN_MAP: |
| return ResourceParameterBindingparameterRef((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); |
| } |
| return super.eInvoke(operationID, arguments); |
| } |
| |
| } //ResourceParameterBindingImpl |