/** * <copyright> * </copyright> * * $Id$ */ package fr.inria.atlanmod.collaboro.notation.impl; import fr.inria.atlanmod.collaboro.notation.NotationPackage; import fr.inria.atlanmod.collaboro.notation.Value; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EAttribute; 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>Value</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link fr.inria.atlanmod.collaboro.notation.impl.ValueImpl#getSeparator <em>Separator</em>}</li> * <li>{@link fr.inria.atlanmod.collaboro.notation.impl.ValueImpl#getAttribute <em>Attribute</em>}</li> * </ul> * </p> * * @generated */ public abstract class ValueImpl extends TextualElementImpl implements Value { /** * The default value of the '{@link #getSeparator() <em>Separator</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getSeparator() * @generated * @ordered */ protected static final String SEPARATOR_EDEFAULT = null; /** * The cached value of the '{@link #getSeparator() <em>Separator</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getSeparator() * @generated * @ordered */ protected String separator = SEPARATOR_EDEFAULT; /** * The cached value of the '{@link #getAttribute() <em>Attribute</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getAttribute() * @generated * @ordered */ protected EAttribute attribute; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected ValueImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return NotationPackage.Literals.VALUE; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getSeparator() { return separator; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setSeparator(String newSeparator) { String oldSeparator = separator; separator = newSeparator; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, NotationPackage.VALUE__SEPARATOR, oldSeparator, separator)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getAttribute() { if (attribute != null && attribute.eIsProxy()) { InternalEObject oldAttribute = (InternalEObject)attribute; attribute = (EAttribute)eResolveProxy(oldAttribute); if (attribute != oldAttribute) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, NotationPackage.VALUE__ATTRIBUTE, oldAttribute, attribute)); } } return attribute; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute basicGetAttribute() { return attribute; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setAttribute(EAttribute newAttribute) { EAttribute oldAttribute = attribute; attribute = newAttribute; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, NotationPackage.VALUE__ATTRIBUTE, oldAttribute, attribute)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case NotationPackage.VALUE__SEPARATOR: return getSeparator(); case NotationPackage.VALUE__ATTRIBUTE: if (resolve) return getAttribute(); return basicGetAttribute(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case NotationPackage.VALUE__SEPARATOR: setSeparator((String)newValue); return; case NotationPackage.VALUE__ATTRIBUTE: setAttribute((EAttribute)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case NotationPackage.VALUE__SEPARATOR: setSeparator(SEPARATOR_EDEFAULT); return; case NotationPackage.VALUE__ATTRIBUTE: setAttribute((EAttribute)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case NotationPackage.VALUE__SEPARATOR: return SEPARATOR_EDEFAULT == null ? separator != null : !SEPARATOR_EDEFAULT.equals(separator); case NotationPackage.VALUE__ATTRIBUTE: return attribute != 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(" (separator: "); result.append(separator); result.append(')'); return result.toString(); } } //ValueImpl