| /******************************************************************************* |
| * Copyright (c) 2001, 2006 IBM Corporation and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * IBM Corporation - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.jst.j2ee.webservice.wsclient.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.util.EObjectContainmentEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| import org.eclipse.jst.j2ee.common.internal.impl.J2EEEObjectImpl; |
| import org.eclipse.jst.j2ee.webservice.wsclient.ComponentScopedRefs; |
| import org.eclipse.jst.j2ee.webservice.wsclient.ServiceRef; |
| import org.eclipse.jst.j2ee.webservice.wsclient.Webservice_clientPackage; |
| |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Component Scoped Refs</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.jst.j2ee.webservice.wsclient.internal.impl.ComponentScopedRefsImpl#getComponentName <em>Component Name</em>}</li> |
| * <li>{@link org.eclipse.jst.j2ee.webservice.wsclient.internal.impl.ComponentScopedRefsImpl#getServiceRefs <em>Service Refs</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class ComponentScopedRefsImpl extends J2EEEObjectImpl implements ComponentScopedRefs { |
| /** |
| * The default value of the '{@link #getComponentName() <em>Component Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getComponentName() |
| * @generated |
| * @ordered |
| */ |
| protected static final String COMPONENT_NAME_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getComponentName() <em>Component Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getComponentName() |
| * @generated |
| * @ordered |
| */ |
| protected String componentName = COMPONENT_NAME_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getServiceRefs() <em>Service Refs</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getServiceRefs() |
| * @generated |
| * @ordered |
| */ |
| protected EList serviceRefs = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ComponentScopedRefsImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return Webservice_clientPackage.Literals.COMPONENT_SCOPED_REFS; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getComponentName() { |
| return componentName; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setComponentName(String newComponentName) { |
| String oldComponentName = componentName; |
| componentName = newComponentName; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, Webservice_clientPackage.COMPONENT_SCOPED_REFS__COMPONENT_NAME, oldComponentName, componentName)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList getServiceRefs() { |
| if (serviceRefs == null) { |
| serviceRefs = new EObjectContainmentEList(ServiceRef.class, this, Webservice_clientPackage.COMPONENT_SCOPED_REFS__SERVICE_REFS); |
| } |
| return serviceRefs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case Webservice_clientPackage.COMPONENT_SCOPED_REFS__SERVICE_REFS: |
| return ((InternalEList)getServiceRefs()).basicRemove(otherEnd, msgs); |
| } |
| return super.eInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case Webservice_clientPackage.COMPONENT_SCOPED_REFS__COMPONENT_NAME: |
| return getComponentName(); |
| case Webservice_clientPackage.COMPONENT_SCOPED_REFS__SERVICE_REFS: |
| return getServiceRefs(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case Webservice_clientPackage.COMPONENT_SCOPED_REFS__COMPONENT_NAME: |
| setComponentName((String)newValue); |
| return; |
| case Webservice_clientPackage.COMPONENT_SCOPED_REFS__SERVICE_REFS: |
| getServiceRefs().clear(); |
| getServiceRefs().addAll((Collection)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case Webservice_clientPackage.COMPONENT_SCOPED_REFS__COMPONENT_NAME: |
| setComponentName(COMPONENT_NAME_EDEFAULT); |
| return; |
| case Webservice_clientPackage.COMPONENT_SCOPED_REFS__SERVICE_REFS: |
| getServiceRefs().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case Webservice_clientPackage.COMPONENT_SCOPED_REFS__COMPONENT_NAME: |
| return COMPONENT_NAME_EDEFAULT == null ? componentName != null : !COMPONENT_NAME_EDEFAULT.equals(componentName); |
| case Webservice_clientPackage.COMPONENT_SCOPED_REFS__SERVICE_REFS: |
| return serviceRefs != null && !serviceRefs.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(" (componentName: "); //$NON-NLS-1$ |
| result.append(componentName); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //ComponentScopedRefsImpl |