/** */ package Taxation.impl; import Taxation.FromLaw; import Taxation.Tax_Payer; import Taxation.TaxationPackage; 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; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; import org.eclipse.emf.ecore.util.EcoreUtil; /** * * An implementation of the model object 'From Law'. * *

* The following features are implemented: *

* * * @generated */ public class FromLawImpl extends MinimalEObjectImpl.Container implements FromLaw { /** * The default value of the '{@link #getId() Id}' attribute. * * * @see #getId() * @generated * @ordered */ protected static final String ID_EDEFAULT = null; /** * The cached value of the '{@link #getId() Id}' attribute. * * * @see #getId() * @generated * @ordered */ protected String id = ID_EDEFAULT; /** * * * @generated */ protected FromLawImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return TaxationPackage.Literals.FROM_LAW; } /** * * * @generated */ @Override public String getId() { return id; } /** * * * @generated */ @Override public void setId(String newId) { String oldId = id; id = newId; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, TaxationPackage.FROM_LAW__ID, oldId, id)); } /** * * * @generated */ @Override public Tax_Payer getTaxPayer() { if (eContainerFeatureID() != TaxationPackage.FROM_LAW__TAX_PAYER) return null; return (Tax_Payer)eInternalContainer(); } /** * * * @generated */ public NotificationChain basicSetTaxPayer(Tax_Payer newTaxPayer, NotificationChain msgs) { msgs = eBasicSetContainer((InternalEObject)newTaxPayer, TaxationPackage.FROM_LAW__TAX_PAYER, msgs); return msgs; } /** * * * @generated */ @Override public void setTaxPayer(Tax_Payer newTaxPayer) { if (newTaxPayer != eInternalContainer() || (eContainerFeatureID() != TaxationPackage.FROM_LAW__TAX_PAYER && newTaxPayer != null)) { if (EcoreUtil.isAncestor(this, newTaxPayer)) throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); NotificationChain msgs = null; if (eInternalContainer() != null) msgs = eBasicRemoveFromContainer(msgs); if (newTaxPayer != null) msgs = ((InternalEObject)newTaxPayer).eInverseAdd(this, TaxationPackage.TAX_PAYER__FROM_LAW, Tax_Payer.class, msgs); msgs = basicSetTaxPayer(newTaxPayer, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, TaxationPackage.FROM_LAW__TAX_PAYER, newTaxPayer, newTaxPayer)); } /** * * * @generated */ @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case TaxationPackage.FROM_LAW__TAX_PAYER: if (eInternalContainer() != null) msgs = eBasicRemoveFromContainer(msgs); return basicSetTaxPayer((Tax_Payer)otherEnd, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case TaxationPackage.FROM_LAW__TAX_PAYER: return basicSetTaxPayer(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { switch (eContainerFeatureID()) { case TaxationPackage.FROM_LAW__TAX_PAYER: return eInternalContainer().eInverseRemove(this, TaxationPackage.TAX_PAYER__FROM_LAW, Tax_Payer.class, msgs); } return super.eBasicRemoveFromContainerFeature(msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case TaxationPackage.FROM_LAW__ID: return getId(); case TaxationPackage.FROM_LAW__TAX_PAYER: return getTaxPayer(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case TaxationPackage.FROM_LAW__ID: setId((String)newValue); return; case TaxationPackage.FROM_LAW__TAX_PAYER: setTaxPayer((Tax_Payer)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case TaxationPackage.FROM_LAW__ID: setId(ID_EDEFAULT); return; case TaxationPackage.FROM_LAW__TAX_PAYER: setTaxPayer((Tax_Payer)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case TaxationPackage.FROM_LAW__ID: return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); case TaxationPackage.FROM_LAW__TAX_PAYER: return getTaxPayer() != null; } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (id: "); result.append(id); result.append(')'); return result.toString(); } } //FromLawImpl