blob: 12700d25022f669420c0bee907a338b06389b807 [file] [log] [blame]
/**
* Copyright (c) 2000-2009, Intalio Inc.
* 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:
* Intalio Inc. - initial API and implementation
*
*/
package org.eclipse.mdt.bpmn.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.mdt.bpmn.BpmnPackage;
import org.eclipse.mdt.bpmn.Transaction;
import org.eclipse.mdt.bpmn.TransactionMethod;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Transaction</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.mdt.bpmn.impl.TransactionImpl#getMethod <em>Method</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class TransactionImpl extends ActivityImpl implements Transaction {
/**
* The default value of the '{@link #getMethod() <em>Method</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMethod()
* @generated
* @ordered
*/
protected static final TransactionMethod METHOD_EDEFAULT = TransactionMethod.COMPENSATE;
/**
* The cached value of the '{@link #getMethod() <em>Method</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMethod()
* @generated
* @ordered
*/
protected TransactionMethod method = METHOD_EDEFAULT;
/**
* This is true if the Method attribute has been set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
protected boolean methodESet;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TransactionImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return BpmnPackage.eINSTANCE.getTransaction();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TransactionMethod getMethod() {
return method;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMethod(TransactionMethod newMethod) {
TransactionMethod oldMethod = method;
method = newMethod == null ? METHOD_EDEFAULT : newMethod;
boolean oldMethodESet = methodESet;
methodESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
BpmnPackage.TRANSACTION__METHOD, oldMethod, method,
!oldMethodESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void unsetMethod() {
TransactionMethod oldMethod = method;
boolean oldMethodESet = methodESet;
method = METHOD_EDEFAULT;
methodESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET,
BpmnPackage.TRANSACTION__METHOD, oldMethod,
METHOD_EDEFAULT, oldMethodESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isSetMethod() {
return methodESet;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case BpmnPackage.TRANSACTION__METHOD:
return getMethod();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case BpmnPackage.TRANSACTION__METHOD:
setMethod((TransactionMethod) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BpmnPackage.TRANSACTION__METHOD:
unsetMethod();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BpmnPackage.TRANSACTION__METHOD:
return isSetMethod();
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy())
return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (method: "); //$NON-NLS-1$
if (methodESet)
result.append(method);
else
result.append("<unset>"); //$NON-NLS-1$
result.append(')');
return result.toString();
}
} //TransactionImpl