/** */ package IFML.Core.impl; import IFML.Core.CorePackage; import IFML.Core.Expression; import IFML.Core.IFMLParameter; import IFML.Core.NamedElement; import IFML.DataTypes.Direction; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.uml2.uml.Type; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>IFML Parameter</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link IFML.Core.impl.IFMLParameterImpl#getName <em>Name</em>}</li> * <li>{@link IFML.Core.impl.IFMLParameterImpl#getDirection <em>Direction</em>}</li> * <li>{@link IFML.Core.impl.IFMLParameterImpl#getDefaultValue <em>Default Value</em>}</li> * <li>{@link IFML.Core.impl.IFMLParameterImpl#getType <em>Type</em>}</li> * </ul> * </p> * * @generated */ public class IFMLParameterImpl extends InteractionFlowModelElementImpl implements IFMLParameter { /** * The default value of the '{@link #getName() <em>Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getName() * @generated * @ordered */ protected static final String NAME_EDEFAULT = null; /** * The cached value of the '{@link #getName() <em>Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getName() * @generated * @ordered */ protected String name = NAME_EDEFAULT; /** * The default value of the '{@link #getDirection() <em>Direction</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getDirection() * @generated * @ordered */ protected static final Direction DIRECTION_EDEFAULT = Direction.IN; /** * The cached value of the '{@link #getDirection() <em>Direction</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getDirection() * @generated * @ordered */ protected Direction direction = DIRECTION_EDEFAULT; /** * The cached value of the '{@link #getDefaultValue() <em>Default Value</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getDefaultValue() * @generated * @ordered */ protected Expression defaultValue; /** * The cached value of the '{@link #getType() <em>Type</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getType() * @generated * @ordered */ protected Type type; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected IFMLParameterImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return CorePackage.Literals.IFML_PARAMETER; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getName() { return name; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setName(String newName) { String oldName = name; name = newName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CorePackage.IFML_PARAMETER__NAME, oldName, name)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Direction getDirection() { return direction; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setDirection(Direction newDirection) { Direction oldDirection = direction; direction = newDirection == null ? DIRECTION_EDEFAULT : newDirection; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CorePackage.IFML_PARAMETER__DIRECTION, oldDirection, direction)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Expression getDefaultValue() { if (defaultValue != null && defaultValue.eIsProxy()) { InternalEObject oldDefaultValue = (InternalEObject)defaultValue; defaultValue = (Expression)eResolveProxy(oldDefaultValue); if (defaultValue != oldDefaultValue) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, CorePackage.IFML_PARAMETER__DEFAULT_VALUE, oldDefaultValue, defaultValue)); } } return defaultValue; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Expression basicGetDefaultValue() { return defaultValue; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setDefaultValue(Expression newDefaultValue) { Expression oldDefaultValue = defaultValue; defaultValue = newDefaultValue; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CorePackage.IFML_PARAMETER__DEFAULT_VALUE, oldDefaultValue, defaultValue)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Type getType() { if (type != null && type.eIsProxy()) { InternalEObject oldType = (InternalEObject)type; type = (Type)eResolveProxy(oldType); if (type != oldType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, CorePackage.IFML_PARAMETER__TYPE, oldType, type)); } } return type; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Type basicGetType() { return type; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setType(Type newType) { Type oldType = type; type = newType; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CorePackage.IFML_PARAMETER__TYPE, oldType, type)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case CorePackage.IFML_PARAMETER__NAME: return getName(); case CorePackage.IFML_PARAMETER__DIRECTION: return getDirection(); case CorePackage.IFML_PARAMETER__DEFAULT_VALUE: if (resolve) return getDefaultValue(); return basicGetDefaultValue(); case CorePackage.IFML_PARAMETER__TYPE: if (resolve) return getType(); return basicGetType(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case CorePackage.IFML_PARAMETER__NAME: setName((String)newValue); return; case CorePackage.IFML_PARAMETER__DIRECTION: setDirection((Direction)newValue); return; case CorePackage.IFML_PARAMETER__DEFAULT_VALUE: setDefaultValue((Expression)newValue); return; case CorePackage.IFML_PARAMETER__TYPE: setType((Type)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case CorePackage.IFML_PARAMETER__NAME: setName(NAME_EDEFAULT); return; case CorePackage.IFML_PARAMETER__DIRECTION: setDirection(DIRECTION_EDEFAULT); return; case CorePackage.IFML_PARAMETER__DEFAULT_VALUE: setDefaultValue((Expression)null); return; case CorePackage.IFML_PARAMETER__TYPE: setType((Type)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case CorePackage.IFML_PARAMETER__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case CorePackage.IFML_PARAMETER__DIRECTION: return direction != DIRECTION_EDEFAULT; case CorePackage.IFML_PARAMETER__DEFAULT_VALUE: return defaultValue != null; case CorePackage.IFML_PARAMETER__TYPE: return type != null; } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { if (baseClass == NamedElement.class) { switch (derivedFeatureID) { case CorePackage.IFML_PARAMETER__NAME: return CorePackage.NAMED_ELEMENT__NAME; default: return -1; } } return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { if (baseClass == NamedElement.class) { switch (baseFeatureID) { case CorePackage.NAMED_ELEMENT__NAME: return CorePackage.IFML_PARAMETER__NAME; default: return -1; } } return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (name: "); result.append(name); result.append(", direction: "); result.append(direction); result.append(')'); return result.toString(); } } //IFMLParameterImpl