/** * generated by Xtext 2.14.0 */ package com.minres.rdl.rdl.impl; import com.minres.rdl.rdl.PropertyDefault; import com.minres.rdl.rdl.PropertyDefinition; import com.minres.rdl.rdl.PropertyTypeName; import com.minres.rdl.rdl.PropertyUsage; import com.minres.rdl.rdl.RdlPackage; 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; /** * * An implementation of the model object 'Property Definition'. * *

* The following features are implemented: *

* * * @generated */ public class PropertyDefinitionImpl extends EntityImpl implements PropertyDefinition { /** * The default value of the '{@link #getType() Type}' attribute. * * * @see #getType() * @generated * @ordered */ protected static final PropertyTypeName TYPE_EDEFAULT = PropertyTypeName.STRING; /** * The cached value of the '{@link #getType() Type}' attribute. * * * @see #getType() * @generated * @ordered */ protected PropertyTypeName type = TYPE_EDEFAULT; /** * The cached value of the '{@link #getUsage() Usage}' containment reference. * * * @see #getUsage() * @generated * @ordered */ protected PropertyUsage usage; /** * The cached value of the '{@link #getDefault() Default}' containment reference. * * * @see #getDefault() * @generated * @ordered */ protected PropertyDefault default_; /** * * * @generated */ protected PropertyDefinitionImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return RdlPackage.Literals.PROPERTY_DEFINITION; } /** * * * @generated */ public PropertyTypeName getType() { return type; } /** * * * @generated */ public void setType(PropertyTypeName newType) { PropertyTypeName oldType = type; type = newType == null ? TYPE_EDEFAULT : newType; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, RdlPackage.PROPERTY_DEFINITION__TYPE, oldType, type)); } /** * * * @generated */ public PropertyUsage getUsage() { return usage; } /** * * * @generated */ public NotificationChain basicSetUsage(PropertyUsage newUsage, NotificationChain msgs) { PropertyUsage oldUsage = usage; usage = newUsage; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RdlPackage.PROPERTY_DEFINITION__USAGE, oldUsage, newUsage); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ public void setUsage(PropertyUsage newUsage) { if (newUsage != usage) { NotificationChain msgs = null; if (usage != null) msgs = ((InternalEObject)usage).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - RdlPackage.PROPERTY_DEFINITION__USAGE, null, msgs); if (newUsage != null) msgs = ((InternalEObject)newUsage).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - RdlPackage.PROPERTY_DEFINITION__USAGE, null, msgs); msgs = basicSetUsage(newUsage, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, RdlPackage.PROPERTY_DEFINITION__USAGE, newUsage, newUsage)); } /** * * * @generated */ public PropertyDefault getDefault() { return default_; } /** * * * @generated */ public NotificationChain basicSetDefault(PropertyDefault newDefault, NotificationChain msgs) { PropertyDefault oldDefault = default_; default_ = newDefault; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RdlPackage.PROPERTY_DEFINITION__DEFAULT, oldDefault, newDefault); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ public void setDefault(PropertyDefault newDefault) { if (newDefault != default_) { NotificationChain msgs = null; if (default_ != null) msgs = ((InternalEObject)default_).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - RdlPackage.PROPERTY_DEFINITION__DEFAULT, null, msgs); if (newDefault != null) msgs = ((InternalEObject)newDefault).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - RdlPackage.PROPERTY_DEFINITION__DEFAULT, null, msgs); msgs = basicSetDefault(newDefault, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, RdlPackage.PROPERTY_DEFINITION__DEFAULT, newDefault, newDefault)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case RdlPackage.PROPERTY_DEFINITION__USAGE: return basicSetUsage(null, msgs); case RdlPackage.PROPERTY_DEFINITION__DEFAULT: return basicSetDefault(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case RdlPackage.PROPERTY_DEFINITION__TYPE: return getType(); case RdlPackage.PROPERTY_DEFINITION__USAGE: return getUsage(); case RdlPackage.PROPERTY_DEFINITION__DEFAULT: return getDefault(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case RdlPackage.PROPERTY_DEFINITION__TYPE: setType((PropertyTypeName)newValue); return; case RdlPackage.PROPERTY_DEFINITION__USAGE: setUsage((PropertyUsage)newValue); return; case RdlPackage.PROPERTY_DEFINITION__DEFAULT: setDefault((PropertyDefault)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case RdlPackage.PROPERTY_DEFINITION__TYPE: setType(TYPE_EDEFAULT); return; case RdlPackage.PROPERTY_DEFINITION__USAGE: setUsage((PropertyUsage)null); return; case RdlPackage.PROPERTY_DEFINITION__DEFAULT: setDefault((PropertyDefault)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case RdlPackage.PROPERTY_DEFINITION__TYPE: return type != TYPE_EDEFAULT; case RdlPackage.PROPERTY_DEFINITION__USAGE: return usage != null; case RdlPackage.PROPERTY_DEFINITION__DEFAULT: return default_ != null; } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (type: "); result.append(type); result.append(')'); return result.toString(); } } //PropertyDefinitionImpl