| /** |
| */ |
| package org.eclipse.papyrus.bpmn.BPMNProfile.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.papyrus.bpmn.BPMNProfile.BPMNProfilePackage; |
| import org.eclipse.uml2.uml.Element; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Error</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.ErrorImpl#getErrorCode <em>Error Code</em>}</li> |
| * <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.ErrorImpl#getStructureRef <em>Structure Ref</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ErrorImpl extends ItemDefinitionImpl implements org.eclipse.papyrus.bpmn.BPMNProfile.Error { |
| /** |
| * The default value of the '{@link #getErrorCode() <em>Error Code</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getErrorCode() |
| * @generated |
| * @ordered |
| */ |
| protected static final String ERROR_CODE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getErrorCode() <em>Error Code</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getErrorCode() |
| * @generated |
| * @ordered |
| */ |
| protected String errorCode = ERROR_CODE_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ErrorImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return BPMNProfilePackage.eINSTANCE.getError(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getErrorCode() { |
| return errorCode; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setErrorCode(String newErrorCode) { |
| String oldErrorCode = errorCode; |
| errorCode = newErrorCode; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, BPMNProfilePackage.ERROR__ERROR_CODE, oldErrorCode, errorCode)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Element getStructureRef() { |
| if (structureRef != null && structureRef.eIsProxy()) { |
| InternalEObject oldStructureRef = (InternalEObject)structureRef; |
| structureRef = (Element)eResolveProxy(oldStructureRef); |
| if (structureRef != oldStructureRef) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, BPMNProfilePackage.ERROR__STRUCTURE_REF, oldStructureRef, structureRef)); |
| } |
| } |
| return structureRef; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Element basicGetStructureRef() { |
| return structureRef; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setStructureRef(Element newStructureRef) { |
| if (newStructureRef != null && !(newStructureRef instanceof org.eclipse.uml2.uml.Class)) { |
| throw new IllegalArgumentException("newStructureRef must be an instance of org.eclipse.uml2.uml.Class"); |
| } |
| Element oldStructureRef = structureRef; |
| structureRef = newStructureRef; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, BPMNProfilePackage.ERROR__STRUCTURE_REF, oldStructureRef, structureRef)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isSetStructureRef() { |
| return structureRef != null; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case BPMNProfilePackage.ERROR__ERROR_CODE: |
| return getErrorCode(); |
| } |
| 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.ERROR__ERROR_CODE: |
| setErrorCode((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case BPMNProfilePackage.ERROR__ERROR_CODE: |
| setErrorCode(ERROR_CODE_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case BPMNProfilePackage.ERROR__ERROR_CODE: |
| return ERROR_CODE_EDEFAULT == null ? errorCode != null : !ERROR_CODE_EDEFAULT.equals(errorCode); |
| case BPMNProfilePackage.ERROR__STRUCTURE_REF: |
| return isSetStructureRef(); |
| } |
| 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(" (errorCode: "); |
| result.append(errorCode); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //ErrorImpl |