/**
*/
package com.github.lbroudoux.dsl.eip.impl;
import com.github.lbroudoux.dsl.eip.EipPackage;
import com.github.lbroudoux.dsl.eip.ServiceInvocation;
import com.github.lbroudoux.dsl.eip.ServiceRef;
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.emf.ecore.impl.MinimalEObjectImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Service Invocation</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link com.github.lbroudoux.dsl.eip.impl.ServiceInvocationImpl#getContext <em>Context</em>}</li>
* <li>{@link com.github.lbroudoux.dsl.eip.impl.ServiceInvocationImpl#getOperationName <em>Operation Name</em>}</li>
* <li>{@link com.github.lbroudoux.dsl.eip.impl.ServiceInvocationImpl#getServiceRef <em>Service Ref</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ServiceInvocationImpl extends MinimalEObjectImpl.Container implements ServiceInvocation {
/**
* The default value of the '{@link #getContext() <em>Context</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getContext()
* @generated
* @ordered
*/
protected static final String CONTEXT_EDEFAULT = null;
/**
* The cached value of the '{@link #getContext() <em>Context</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getContext()
* @generated
* @ordered
*/
protected String context = CONTEXT_EDEFAULT;
/**
* The default value of the '{@link #getOperationName() <em>Operation Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOperationName()
* @generated
* @ordered
*/
protected static final String OPERATION_NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getOperationName() <em>Operation Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOperationName()
* @generated
* @ordered
*/
protected String operationName = OPERATION_NAME_EDEFAULT;
/**
* The cached value of the '{@link #getServiceRef() <em>Service Ref</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getServiceRef()
* @generated
* @ordered
*/
protected ServiceRef serviceRef;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ServiceInvocationImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return EipPackage.Literals.SERVICE_INVOCATION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getContext() {
return context;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setContext(String newContext) {
String oldContext = context;
context = newContext;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EipPackage.SERVICE_INVOCATION__CONTEXT, oldContext, context));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getOperationName() {
return operationName;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOperationName(String newOperationName) {
String oldOperationName = operationName;
operationName = newOperationName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EipPackage.SERVICE_INVOCATION__OPERATION_NAME, oldOperationName, operationName));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ServiceRef getServiceRef() {
if (serviceRef != null && serviceRef.eIsProxy()) {
InternalEObject oldServiceRef = (InternalEObject)serviceRef;
serviceRef = (ServiceRef)eResolveProxy(oldServiceRef);
if (serviceRef != oldServiceRef) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, EipPackage.SERVICE_INVOCATION__SERVICE_REF, oldServiceRef, serviceRef));
}
}
return serviceRef;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ServiceRef basicGetServiceRef() {
return serviceRef;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setServiceRef(ServiceRef newServiceRef) {
ServiceRef oldServiceRef = serviceRef;
serviceRef = newServiceRef;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EipPackage.SERVICE_INVOCATION__SERVICE_REF, oldServiceRef, serviceRef));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case EipPackage.SERVICE_INVOCATION__CONTEXT:
return getContext();
case EipPackage.SERVICE_INVOCATION__OPERATION_NAME:
return getOperationName();
case EipPackage.SERVICE_INVOCATION__SERVICE_REF:
if (resolve) return getServiceRef();
return basicGetServiceRef();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case EipPackage.SERVICE_INVOCATION__CONTEXT:
setContext((String)newValue);
return;
case EipPackage.SERVICE_INVOCATION__OPERATION_NAME:
setOperationName((String)newValue);
return;
case EipPackage.SERVICE_INVOCATION__SERVICE_REF:
setServiceRef((ServiceRef)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case EipPackage.SERVICE_INVOCATION__CONTEXT:
setContext(CONTEXT_EDEFAULT);
return;
case EipPackage.SERVICE_INVOCATION__OPERATION_NAME:
setOperationName(OPERATION_NAME_EDEFAULT);
return;
case EipPackage.SERVICE_INVOCATION__SERVICE_REF:
setServiceRef((ServiceRef)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case EipPackage.SERVICE_INVOCATION__CONTEXT:
return CONTEXT_EDEFAULT == null ? context != null : !CONTEXT_EDEFAULT.equals(context);
case EipPackage.SERVICE_INVOCATION__OPERATION_NAME:
return OPERATION_NAME_EDEFAULT == null ? operationName != null : !OPERATION_NAME_EDEFAULT.equals(operationName);
case EipPackage.SERVICE_INVOCATION__SERVICE_REF:
return serviceRef != null;
}
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(" (context: ");
result.append(context);
result.append(", operationName: ");
result.append(operationName);
result.append(')');
return result.toString();
}
} //ServiceInvocationImpl