/** */ package at.bestsolution.efxclipse.tooling.css.cssDsl.impl; import at.bestsolution.efxclipse.tooling.css.cssDsl.CssDslPackage; import at.bestsolution.efxclipse.tooling.css.cssDsl.css_generic_declaration; import at.bestsolution.efxclipse.tooling.css.cssDsl.expr; 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>css generic declaration</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link at.bestsolution.efxclipse.tooling.css.cssDsl.impl.css_generic_declarationImpl#getProperty <em>Property</em>}</li> * <li>{@link at.bestsolution.efxclipse.tooling.css.cssDsl.impl.css_generic_declarationImpl#getExpression <em>Expression</em>}</li> * <li>{@link at.bestsolution.efxclipse.tooling.css.cssDsl.impl.css_generic_declarationImpl#getPrio <em>Prio</em>}</li> * </ul> * </p> * * @generated */ public class css_generic_declarationImpl extends css_declarationImpl implements css_generic_declaration { /** * The default value of the '{@link #getProperty() <em>Property</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getProperty() * @generated * @ordered */ protected static final String PROPERTY_EDEFAULT = null; /** * The cached value of the '{@link #getProperty() <em>Property</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getProperty() * @generated * @ordered */ protected String property = PROPERTY_EDEFAULT; /** * The cached value of the '{@link #getExpression() <em>Expression</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getExpression() * @generated * @ordered */ protected expr expression; /** * The default value of the '{@link #getPrio() <em>Prio</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getPrio() * @generated * @ordered */ protected static final String PRIO_EDEFAULT = null; /** * The cached value of the '{@link #getPrio() <em>Prio</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getPrio() * @generated * @ordered */ protected String prio = PRIO_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected css_generic_declarationImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return CssDslPackage.Literals.CSS_GENERIC_DECLARATION; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getProperty() { return property; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setProperty(String newProperty) { String oldProperty = property; property = newProperty; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CssDslPackage.CSS_GENERIC_DECLARATION__PROPERTY, oldProperty, property)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public expr getExpression() { return expression; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetExpression(expr newExpression, NotificationChain msgs) { expr oldExpression = expression; expression = newExpression; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CssDslPackage.CSS_GENERIC_DECLARATION__EXPRESSION, oldExpression, newExpression); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setExpression(expr newExpression) { if (newExpression != expression) { NotificationChain msgs = null; if (expression != null) msgs = ((InternalEObject)expression).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CssDslPackage.CSS_GENERIC_DECLARATION__EXPRESSION, null, msgs); if (newExpression != null) msgs = ((InternalEObject)newExpression).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CssDslPackage.CSS_GENERIC_DECLARATION__EXPRESSION, null, msgs); msgs = basicSetExpression(newExpression, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CssDslPackage.CSS_GENERIC_DECLARATION__EXPRESSION, newExpression, newExpression)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getPrio() { return prio; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setPrio(String newPrio) { String oldPrio = prio; prio = newPrio; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CssDslPackage.CSS_GENERIC_DECLARATION__PRIO, oldPrio, prio)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case CssDslPackage.CSS_GENERIC_DECLARATION__EXPRESSION: return basicSetExpression(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 CssDslPackage.CSS_GENERIC_DECLARATION__PROPERTY: return getProperty(); case CssDslPackage.CSS_GENERIC_DECLARATION__EXPRESSION: return getExpression(); case CssDslPackage.CSS_GENERIC_DECLARATION__PRIO: return getPrio(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case CssDslPackage.CSS_GENERIC_DECLARATION__PROPERTY: setProperty((String)newValue); return; case CssDslPackage.CSS_GENERIC_DECLARATION__EXPRESSION: setExpression((expr)newValue); return; case CssDslPackage.CSS_GENERIC_DECLARATION__PRIO: setPrio((String)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case CssDslPackage.CSS_GENERIC_DECLARATION__PROPERTY: setProperty(PROPERTY_EDEFAULT); return; case CssDslPackage.CSS_GENERIC_DECLARATION__EXPRESSION: setExpression((expr)null); return; case CssDslPackage.CSS_GENERIC_DECLARATION__PRIO: setPrio(PRIO_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case CssDslPackage.CSS_GENERIC_DECLARATION__PROPERTY: return PROPERTY_EDEFAULT == null ? property != null : !PROPERTY_EDEFAULT.equals(property); case CssDslPackage.CSS_GENERIC_DECLARATION__EXPRESSION: return expression != null; case CssDslPackage.CSS_GENERIC_DECLARATION__PRIO: return PRIO_EDEFAULT == null ? prio != null : !PRIO_EDEFAULT.equals(prio); } 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(" (property: "); result.append(property); result.append(", prio: "); result.append(prio); result.append(')'); return result.toString(); } } //css_generic_declarationImpl