blob: ed11330ad0543ea363b78c03a24bf05482dbc953 [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.ScriptTask;
import org.eclipse.papyrus.bpmn.BPMNProfile.util.BPMNProfileValidator;
import org.eclipse.uml2.uml.OpaqueAction;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Script Task</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.ScriptTaskImpl#getBase_OpaqueAction <em>Base Opaque Action</em>}</li>
* <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.ScriptTaskImpl#getScriptFormat <em>Script Format</em>}</li>
* <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.ScriptTaskImpl#getScript <em>Script</em>}</li>
* </ul>
*
* @generated
*/
public class ScriptTaskImpl extends TaskImpl implements ScriptTask {
/**
* The cached value of the '{@link #getBase_OpaqueAction() <em>Base Opaque Action</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBase_OpaqueAction()
* @generated
* @ordered
*/
protected OpaqueAction base_OpaqueAction;
/**
* The default value of the '{@link #getScriptFormat() <em>Script Format</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getScriptFormat()
* @generated
* @ordered
*/
protected static final String SCRIPT_FORMAT_EDEFAULT = null;
/**
* The cached value of the '{@link #getScriptFormat() <em>Script Format</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getScriptFormat()
* @generated
* @ordered
*/
protected String scriptFormat = SCRIPT_FORMAT_EDEFAULT;
/**
* The default value of the '{@link #getScript() <em>Script</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getScript()
* @generated
* @ordered
*/
protected static final String SCRIPT_EDEFAULT = null;
/**
* The cached value of the '{@link #getScript() <em>Script</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getScript()
* @generated
* @ordered
*/
protected String script = SCRIPT_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ScriptTaskImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return BPMNProfilePackage.eINSTANCE.getScriptTask();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public OpaqueAction getBase_OpaqueAction() {
if (base_OpaqueAction != null && base_OpaqueAction.eIsProxy()) {
InternalEObject oldBase_OpaqueAction = (InternalEObject)base_OpaqueAction;
base_OpaqueAction = (OpaqueAction)eResolveProxy(oldBase_OpaqueAction);
if (base_OpaqueAction != oldBase_OpaqueAction) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, BPMNProfilePackage.SCRIPT_TASK__BASE_OPAQUE_ACTION, oldBase_OpaqueAction, base_OpaqueAction));
}
}
return base_OpaqueAction;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public OpaqueAction basicGetBase_OpaqueAction() {
return base_OpaqueAction;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBase_OpaqueAction(OpaqueAction newBase_OpaqueAction) {
OpaqueAction oldBase_OpaqueAction = base_OpaqueAction;
base_OpaqueAction = newBase_OpaqueAction;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BPMNProfilePackage.SCRIPT_TASK__BASE_OPAQUE_ACTION, oldBase_OpaqueAction, base_OpaqueAction));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getScriptFormat() {
return scriptFormat;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setScriptFormat(String newScriptFormat) {
String oldScriptFormat = scriptFormat;
scriptFormat = newScriptFormat;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BPMNProfilePackage.SCRIPT_TASK__SCRIPT_FORMAT, oldScriptFormat, scriptFormat));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getScript() {
return script;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setScript(String newScript) {
String oldScript = script;
script = newScript;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BPMNProfilePackage.SCRIPT_TASK__SCRIPT, oldScript, script));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean ScriptTaskscriptFormat(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.SCRIPT_TASK__SCRIPT_TASKSCRIPT_FORMAT,
EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "ScriptTaskscriptFormat", EObjectValidator.getObjectLabel(this, context) }),
new Object [] { this }));
}
return false;
}
return true;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean ScriptTaskscript(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.SCRIPT_TASK__SCRIPT_TASKSCRIPT,
EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "ScriptTaskscript", 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.SCRIPT_TASK__BASE_OPAQUE_ACTION:
if (resolve) return getBase_OpaqueAction();
return basicGetBase_OpaqueAction();
case BPMNProfilePackage.SCRIPT_TASK__SCRIPT_FORMAT:
return getScriptFormat();
case BPMNProfilePackage.SCRIPT_TASK__SCRIPT:
return getScript();
}
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.SCRIPT_TASK__BASE_OPAQUE_ACTION:
setBase_OpaqueAction((OpaqueAction)newValue);
return;
case BPMNProfilePackage.SCRIPT_TASK__SCRIPT_FORMAT:
setScriptFormat((String)newValue);
return;
case BPMNProfilePackage.SCRIPT_TASK__SCRIPT:
setScript((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BPMNProfilePackage.SCRIPT_TASK__BASE_OPAQUE_ACTION:
setBase_OpaqueAction((OpaqueAction)null);
return;
case BPMNProfilePackage.SCRIPT_TASK__SCRIPT_FORMAT:
setScriptFormat(SCRIPT_FORMAT_EDEFAULT);
return;
case BPMNProfilePackage.SCRIPT_TASK__SCRIPT:
setScript(SCRIPT_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BPMNProfilePackage.SCRIPT_TASK__BASE_OPAQUE_ACTION:
return base_OpaqueAction != null;
case BPMNProfilePackage.SCRIPT_TASK__SCRIPT_FORMAT:
return SCRIPT_FORMAT_EDEFAULT == null ? scriptFormat != null : !SCRIPT_FORMAT_EDEFAULT.equals(scriptFormat);
case BPMNProfilePackage.SCRIPT_TASK__SCRIPT:
return SCRIPT_EDEFAULT == null ? script != null : !SCRIPT_EDEFAULT.equals(script);
}
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.SCRIPT_TASK___SCRIPT_TASKSCRIPT_FORMAT__DIAGNOSTICCHAIN_MAP:
return ScriptTaskscriptFormat((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1));
case BPMNProfilePackage.SCRIPT_TASK___SCRIPT_TASKSCRIPT__DIAGNOSTICCHAIN_MAP:
return ScriptTaskscript((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1));
}
return super.eInvoke(operationID, arguments);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (scriptFormat: ");
result.append(scriptFormat);
result.append(", script: ");
result.append(script);
result.append(')');
return result.toString();
}
} //ScriptTaskImpl