/** * <copyright> * </copyright> * * $Id: DescendantAccessExpressionImpl.java,v 1.3 2011/04/18 08:29:42 apanchenk Exp $ */ package org.eclipse.dltk.javascript.core.dom.impl; import org.eclipse.dltk.javascript.core.dom.DescendantAccessExpression; import org.eclipse.dltk.javascript.core.dom.DomPackage; import org.eclipse.dltk.javascript.core.dom.Expression; import org.eclipse.dltk.javascript.core.dom.IProperty; 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>Descendant Access Expression</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.dltk.javascript.core.dom.impl.DescendantAccessExpressionImpl#getObject <em>Object</em>}</li> * <li>{@link org.eclipse.dltk.javascript.core.dom.impl.DescendantAccessExpressionImpl#getProperty <em>Property</em>}</li> * </ul> * </p> * * @generated */ public class DescendantAccessExpressionImpl extends ExpressionImpl implements DescendantAccessExpression { /** * The cached value of the '{@link #getObject() <em>Object</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getObject() * @generated * @ordered */ protected Expression object; /** * The cached value of the '{@link #getProperty() <em>Property</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getProperty() * @generated * @ordered */ protected IProperty property; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected DescendantAccessExpressionImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return DomPackage.Literals.DESCENDANT_ACCESS_EXPRESSION; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Expression getObject() { return object; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetObject(Expression newObject, NotificationChain msgs) { Expression oldObject = object; object = newObject; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DomPackage.DESCENDANT_ACCESS_EXPRESSION__OBJECT, oldObject, newObject); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setObject(Expression newObject) { if (newObject != object) { NotificationChain msgs = null; if (object != null) msgs = ((InternalEObject)object).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DomPackage.DESCENDANT_ACCESS_EXPRESSION__OBJECT, null, msgs); if (newObject != null) msgs = ((InternalEObject)newObject).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DomPackage.DESCENDANT_ACCESS_EXPRESSION__OBJECT, null, msgs); msgs = basicSetObject(newObject, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.DESCENDANT_ACCESS_EXPRESSION__OBJECT, newObject, newObject)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public IProperty getProperty() { return property; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetProperty(IProperty newProperty, NotificationChain msgs) { IProperty oldProperty = property; property = newProperty; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DomPackage.DESCENDANT_ACCESS_EXPRESSION__PROPERTY, oldProperty, newProperty); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setProperty(IProperty newProperty) { if (newProperty != property) { NotificationChain msgs = null; if (property != null) msgs = ((InternalEObject)property).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DomPackage.DESCENDANT_ACCESS_EXPRESSION__PROPERTY, null, msgs); if (newProperty != null) msgs = ((InternalEObject)newProperty).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DomPackage.DESCENDANT_ACCESS_EXPRESSION__PROPERTY, null, msgs); msgs = basicSetProperty(newProperty, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.DESCENDANT_ACCESS_EXPRESSION__PROPERTY, newProperty, newProperty)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case DomPackage.DESCENDANT_ACCESS_EXPRESSION__OBJECT: return basicSetObject(null, msgs); case DomPackage.DESCENDANT_ACCESS_EXPRESSION__PROPERTY: return basicSetProperty(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 DomPackage.DESCENDANT_ACCESS_EXPRESSION__OBJECT: return getObject(); case DomPackage.DESCENDANT_ACCESS_EXPRESSION__PROPERTY: return getProperty(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case DomPackage.DESCENDANT_ACCESS_EXPRESSION__OBJECT: setObject((Expression)newValue); return; case DomPackage.DESCENDANT_ACCESS_EXPRESSION__PROPERTY: setProperty((IProperty)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case DomPackage.DESCENDANT_ACCESS_EXPRESSION__OBJECT: setObject((Expression)null); return; case DomPackage.DESCENDANT_ACCESS_EXPRESSION__PROPERTY: setProperty((IProperty)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case DomPackage.DESCENDANT_ACCESS_EXPRESSION__OBJECT: return object != null; case DomPackage.DESCENDANT_ACCESS_EXPRESSION__PROPERTY: return property != null; } return super.eIsSet(featureID); } } //DescendantAccessExpressionImpl