| /** |
| */ |
| package org.eclipse.rcptt.testing.commands.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.common.util.EList; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.emf.ecore.util.EDataTypeUniqueEList; |
| |
| import org.eclipse.rcptt.ecl.core.impl.CommandImpl; |
| |
| import org.eclipse.rcptt.testing.commands.CommandsPackage; |
| import org.eclipse.rcptt.testing.commands.SiteInjection; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Site Injection</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.rcptt.testing.commands.impl.SiteInjectionImpl#getUri <em>Uri</em>}</li> |
| * <li>{@link org.eclipse.rcptt.testing.commands.impl.SiteInjectionImpl#getUnit <em>Unit</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class SiteInjectionImpl extends CommandImpl implements SiteInjection { |
| /** |
| * The default value of the '{@link #getUri() <em>Uri</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getUri() |
| * @generated |
| * @ordered |
| */ |
| protected static final String URI_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getUri() <em>Uri</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getUri() |
| * @generated |
| * @ordered |
| */ |
| protected String uri = URI_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getUnit() <em>Unit</em>}' attribute list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getUnit() |
| * @generated |
| * @ordered |
| */ |
| protected EList<String> unit; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected SiteInjectionImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return CommandsPackage.Literals.SITE_INJECTION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getUri() { |
| return uri; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setUri(String newUri) { |
| String oldUri = uri; |
| uri = newUri; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CommandsPackage.SITE_INJECTION__URI, oldUri, uri)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<String> getUnit() { |
| if (unit == null) { |
| unit = new EDataTypeUniqueEList<String>(String.class, this, CommandsPackage.SITE_INJECTION__UNIT); |
| } |
| return unit; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case CommandsPackage.SITE_INJECTION__URI: |
| return getUri(); |
| case CommandsPackage.SITE_INJECTION__UNIT: |
| return getUnit(); |
| } |
| 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 CommandsPackage.SITE_INJECTION__URI: |
| setUri((String)newValue); |
| return; |
| case CommandsPackage.SITE_INJECTION__UNIT: |
| getUnit().clear(); |
| getUnit().addAll((Collection<? extends String>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case CommandsPackage.SITE_INJECTION__URI: |
| setUri(URI_EDEFAULT); |
| return; |
| case CommandsPackage.SITE_INJECTION__UNIT: |
| getUnit().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case CommandsPackage.SITE_INJECTION__URI: |
| return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri); |
| case CommandsPackage.SITE_INJECTION__UNIT: |
| return unit != null && !unit.isEmpty(); |
| } |
| 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(" (uri: "); |
| result.append(uri); |
| result.append(", unit: "); |
| result.append(unit); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //SiteInjectionImpl |