/** */ package de.gebit.integrity.dsl.impl; import de.gebit.integrity.dsl.DslPackage; import de.gebit.integrity.dsl.JavaClassReference; import de.gebit.integrity.dsl.OperationDefinition; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Operation Definition</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link de.gebit.integrity.dsl.impl.OperationDefinitionImpl#getName <em>Name</em>}</li> * <li>{@link de.gebit.integrity.dsl.impl.OperationDefinitionImpl#getOperationType <em>Operation Type</em>}</li> * </ul> * * @generated */ public class OperationDefinitionImpl extends PackageStatementImpl implements OperationDefinition { /** * The default value of the '{@link #getName() <em>Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getName() * @generated * @ordered */ protected static final String NAME_EDEFAULT = null; /** * The cached value of the '{@link #getName() <em>Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getName() * @generated * @ordered */ protected String name = NAME_EDEFAULT; /** * The cached value of the '{@link #getOperationType() <em>Operation Type</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getOperationType() * @generated * @ordered */ protected JavaClassReference operationType; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected OperationDefinitionImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return DslPackage.Literals.OPERATION_DEFINITION; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getName() { return name; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setName(String newName) { String oldName = name; name = newName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DslPackage.OPERATION_DEFINITION__NAME, oldName, name)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public JavaClassReference getOperationType() { return operationType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetOperationType(JavaClassReference newOperationType, NotificationChain msgs) { JavaClassReference oldOperationType = operationType; operationType = newOperationType; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DslPackage.OPERATION_DEFINITION__OPERATION_TYPE, oldOperationType, newOperationType); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setOperationType(JavaClassReference newOperationType) { if (newOperationType != operationType) { NotificationChain msgs = null; if (operationType != null) msgs = ((InternalEObject)operationType).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DslPackage.OPERATION_DEFINITION__OPERATION_TYPE, null, msgs); if (newOperationType != null) msgs = ((InternalEObject)newOperationType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DslPackage.OPERATION_DEFINITION__OPERATION_TYPE, null, msgs); msgs = basicSetOperationType(newOperationType, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DslPackage.OPERATION_DEFINITION__OPERATION_TYPE, newOperationType, newOperationType)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case DslPackage.OPERATION_DEFINITION__OPERATION_TYPE: return basicSetOperationType(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case DslPackage.OPERATION_DEFINITION__NAME: return getName(); case DslPackage.OPERATION_DEFINITION__OPERATION_TYPE: return getOperationType(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case DslPackage.OPERATION_DEFINITION__NAME: setName((String)newValue); return; case DslPackage.OPERATION_DEFINITION__OPERATION_TYPE: setOperationType((JavaClassReference)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case DslPackage.OPERATION_DEFINITION__NAME: setName(NAME_EDEFAULT); return; case DslPackage.OPERATION_DEFINITION__OPERATION_TYPE: setOperationType((JavaClassReference)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case DslPackage.OPERATION_DEFINITION__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case DslPackage.OPERATION_DEFINITION__OPERATION_TYPE: return operationType != null; } 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(" (name: "); result.append(name); result.append(')'); return result.toString(); } } //OperationDefinitionImpl