| /** |
| * <copyright> |
| * </copyright> |
| * |
| * $Id$ |
| */ |
| package org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| |
| import org.eclipse.emf.common.util.EList; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.EObjectImpl; |
| |
| import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage; |
| import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Operation; |
| import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Parameter; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Operation</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.OperationImpl#getId <em>Id</em>}</li> |
| * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.OperationImpl#getParameters <em>Parameters</em>}</li> |
| * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.OperationImpl#getOperations <em>Operations</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class OperationImpl extends EObjectImpl implements Operation { |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static final String copyright = "Copyright (c) 2007 Oracle Corporation"; |
| |
| /** |
| * The default value of the '{@link #getId() <em>Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getId() |
| * @generated |
| * @ordered |
| */ |
| protected static final String ID_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getId() <em>Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getId() |
| * @generated |
| * @ordered |
| */ |
| protected String id = ID_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getParameters() <em>Parameters</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getParameters() |
| * @generated |
| * @ordered |
| */ |
| protected EList parameters; |
| |
| /** |
| * The cached value of the '{@link #getOperations() <em>Operations</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOperations() |
| * @generated |
| * @ordered |
| */ |
| protected EList operations; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected OperationImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected EClass eStaticClass() { |
| return DTInfoPackage.Literals.OPERATION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getId() { |
| return id; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setId(String newId) { |
| String oldId = id; |
| id = newId; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DTInfoPackage.OPERATION__ID, oldId, id)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList getParameters() { |
| if (parameters == null) { |
| parameters = new EObjectContainmentEList(Parameter.class, this, DTInfoPackage.OPERATION__PARAMETERS); |
| } |
| return parameters; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList getOperations() { |
| if (operations == null) { |
| operations = new EObjectContainmentEList(Operation.class, this, DTInfoPackage.OPERATION__OPERATIONS); |
| } |
| return operations; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case DTInfoPackage.OPERATION__PARAMETERS: |
| return ((InternalEList)getParameters()).basicRemove(otherEnd, msgs); |
| case DTInfoPackage.OPERATION__OPERATIONS: |
| return ((InternalEList)getOperations()).basicRemove(otherEnd, msgs); |
| } |
| return super.eInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case DTInfoPackage.OPERATION__ID: |
| return getId(); |
| case DTInfoPackage.OPERATION__PARAMETERS: |
| return getParameters(); |
| case DTInfoPackage.OPERATION__OPERATIONS: |
| return getOperations(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case DTInfoPackage.OPERATION__ID: |
| setId((String)newValue); |
| return; |
| case DTInfoPackage.OPERATION__PARAMETERS: |
| getParameters().clear(); |
| getParameters().addAll((Collection)newValue); |
| return; |
| case DTInfoPackage.OPERATION__OPERATIONS: |
| getOperations().clear(); |
| getOperations().addAll((Collection)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case DTInfoPackage.OPERATION__ID: |
| setId(ID_EDEFAULT); |
| return; |
| case DTInfoPackage.OPERATION__PARAMETERS: |
| getParameters().clear(); |
| return; |
| case DTInfoPackage.OPERATION__OPERATIONS: |
| getOperations().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case DTInfoPackage.OPERATION__ID: |
| return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); |
| case DTInfoPackage.OPERATION__PARAMETERS: |
| return parameters != null && !parameters.isEmpty(); |
| case DTInfoPackage.OPERATION__OPERATIONS: |
| return operations != null && !operations.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (id: "); |
| result.append(id); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //OperationImpl |