/* * JBoss, Home of Professional Open Source. * * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing. * * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors. */ package org.teiid.designer.metamodels.wsdl.soap.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EStructuralFeature; 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.EcoreUtil; import org.teiid.designer.metamodels.wsdl.Port; import org.teiid.designer.metamodels.wsdl.WsdlPackage; import org.teiid.designer.metamodels.wsdl.soap.SoapAddress; import org.teiid.designer.metamodels.wsdl.soap.SoapPackage; /** * <!-- begin-user-doc --> An implementation of the model object '<em><b>Address</b></em>'. <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.teiid.designer.metamodels.wsdl.soap.impl.SoapAddressImpl#getPort <em>Port</em>}</li> * <li>{@link org.teiid.designer.metamodels.wsdl.soap.impl.SoapAddressImpl#getLocation <em>Location</em>}</li> * </ul> * </p> * * @generated * * @since 8.0 */ public class SoapAddressImpl extends EObjectImpl implements SoapAddress { /** * The default value of the '{@link #getLocation() <em>Location</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc * --> * * @see #getLocation() * @generated * @ordered */ protected static final String LOCATION_EDEFAULT = null; /** * The cached value of the '{@link #getLocation() <em>Location</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc --> * * @see #getLocation() * @generated * @ordered */ protected String location = LOCATION_EDEFAULT; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ protected SoapAddressImpl() { super(); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override protected EClass eStaticClass() { return SoapPackage.eINSTANCE.getSoapAddress(); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public String getLocation() { return location; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public void setLocation( String newLocation ) { String oldLocation = location; location = newLocation; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SoapPackage.SOAP_ADDRESS__LOCATION, oldLocation, location)); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public Port getPort() { if (eContainerFeatureID != SoapPackage.SOAP_ADDRESS__PORT) return null; return (Port)eContainer; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public void setPort( Port newPort ) { if (newPort != eContainer || (eContainerFeatureID != SoapPackage.SOAP_ADDRESS__PORT && newPort != null)) { if (EcoreUtil.isAncestor(this, newPort)) throw new IllegalArgumentException( "Recursive containment not allowed for " + toString()); //$NON-NLS-1$ NotificationChain msgs = null; if (eContainer != null) msgs = eBasicRemoveFromContainer(msgs); if (newPort != null) msgs = ((InternalEObject)newPort).eInverseAdd(this, WsdlPackage.PORT__SOAP_ADDRESS, Port.class, msgs); msgs = eBasicSetContainer((InternalEObject)newPort, SoapPackage.SOAP_ADDRESS__PORT, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SoapPackage.SOAP_ADDRESS__PORT, newPort, newPort)); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public NotificationChain eInverseAdd( InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs ) { if (featureID >= 0) { switch (eDerivedStructuralFeatureID(featureID, baseClass)) { case SoapPackage.SOAP_ADDRESS__PORT: if (eContainer != null) msgs = eBasicRemoveFromContainer(msgs); return eBasicSetContainer(otherEnd, SoapPackage.SOAP_ADDRESS__PORT, msgs); default: return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); } } if (eContainer != null) msgs = eBasicRemoveFromContainer(msgs); return eBasicSetContainer(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public NotificationChain eInverseRemove( InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs ) { if (featureID >= 0) { switch (eDerivedStructuralFeatureID(featureID, baseClass)) { case SoapPackage.SOAP_ADDRESS__PORT: return eBasicSetContainer(null, SoapPackage.SOAP_ADDRESS__PORT, msgs); default: return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); } } return eBasicSetContainer(null, featureID, msgs); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public NotificationChain eBasicRemoveFromContainer( NotificationChain msgs ) { if (eContainerFeatureID >= 0) { switch (eContainerFeatureID) { case SoapPackage.SOAP_ADDRESS__PORT: return eContainer.eInverseRemove(this, WsdlPackage.PORT__SOAP_ADDRESS, Port.class, msgs); default: return eDynamicBasicRemoveFromContainer(msgs); } } return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public Object eGet( EStructuralFeature eFeature, boolean resolve ) { switch (eDerivedStructuralFeatureID(eFeature)) { case SoapPackage.SOAP_ADDRESS__PORT: return getPort(); case SoapPackage.SOAP_ADDRESS__LOCATION: return getLocation(); } return eDynamicGet(eFeature, resolve); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public void eSet( EStructuralFeature eFeature, Object newValue ) { switch (eDerivedStructuralFeatureID(eFeature)) { case SoapPackage.SOAP_ADDRESS__PORT: setPort((Port)newValue); return; case SoapPackage.SOAP_ADDRESS__LOCATION: setLocation((String)newValue); return; } eDynamicSet(eFeature, newValue); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public void eUnset( EStructuralFeature eFeature ) { switch (eDerivedStructuralFeatureID(eFeature)) { case SoapPackage.SOAP_ADDRESS__PORT: setPort((Port)null); return; case SoapPackage.SOAP_ADDRESS__LOCATION: setLocation(LOCATION_EDEFAULT); return; } eDynamicUnset(eFeature); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public boolean eIsSet( EStructuralFeature eFeature ) { switch (eDerivedStructuralFeatureID(eFeature)) { case SoapPackage.SOAP_ADDRESS__PORT: return getPort() != null; case SoapPackage.SOAP_ADDRESS__LOCATION: return LOCATION_EDEFAULT == null ? location != null : !LOCATION_EDEFAULT.equals(location); } return eDynamicIsSet(eFeature); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (location: "); //$NON-NLS-1$ result.append(location); result.append(')'); return result.toString(); } } // SoapAddressImpl