org.openxma.dsl.dom.model.impl.OperationImpl Maven / Gradle / Ivy
/**
*
*
*
* $Id$
*/
package org.openxma.dsl.dom.model.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.openxma.dsl.core.CorePackage;
import org.openxma.dsl.core.model.IDocumentable;
import org.openxma.dsl.dom.DomPackage;
import org.openxma.dsl.dom.model.DelegateOperation;
import org.openxma.dsl.dom.model.Operation;
import org.openxma.dsl.dom.model.Parameter;
/**
*
* An implementation of the model object 'Operation'.
*
*
* The following features are implemented:
*
* - {@link org.openxma.dsl.dom.model.impl.OperationImpl#getTxtDescription Txt Description}
* - {@link org.openxma.dsl.dom.model.impl.OperationImpl#getParameters Parameters}
* - {@link org.openxma.dsl.dom.model.impl.OperationImpl#getExpression Expression}
* - {@link org.openxma.dsl.dom.model.impl.OperationImpl#getDelegate Delegate}
*
*
*
* @generated
*/
public class OperationImpl extends DaoOperationImpl implements Operation {
/**
* The default value of the '{@link #getTxtDescription() Txt Description}' attribute.
*
*
* @see #getTxtDescription()
* @generated
* @ordered
*/
protected static final String TXT_DESCRIPTION_EDEFAULT = null;
/**
* The cached value of the '{@link #getTxtDescription() Txt Description}' attribute.
*
*
* @see #getTxtDescription()
* @generated
* @ordered
*/
protected String txtDescription = TXT_DESCRIPTION_EDEFAULT;
/**
* The cached value of the '{@link #getParameters() Parameters}' containment reference list.
*
*
* @see #getParameters()
* @generated
* @ordered
*/
protected EList parameters;
/**
* The default value of the '{@link #getExpression() Expression}' attribute.
*
*
* @see #getExpression()
* @generated
* @ordered
*/
protected static final String EXPRESSION_EDEFAULT = null;
/**
* The cached value of the '{@link #getExpression() Expression}' attribute.
*
*
* @see #getExpression()
* @generated
* @ordered
*/
protected String expression = EXPRESSION_EDEFAULT;
/**
* @generated NOT
*/
public DelegateOperation delegateOperation;
/**
*
*
* @generated
*/
protected OperationImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return DomPackage.Literals.OPERATION;
}
/**
*
*
* @generated
*/
public String getTxtDescription() {
return txtDescription;
}
/**
*
*
* @generated
*/
public void setTxtDescription(String newTxtDescription) {
String oldTxtDescription = txtDescription;
txtDescription = newTxtDescription;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.OPERATION__TXT_DESCRIPTION, oldTxtDescription, txtDescription));
}
/**
*
*
* @generated
*/
public EList getParameters() {
if (parameters == null) {
parameters = new EObjectContainmentEList(Parameter.class, this, DomPackage.OPERATION__PARAMETERS);
}
return parameters;
}
/**
*
*
* @generated
*/
public String getExpression() {
return expression;
}
/**
*
*
* @generated
*/
public void setExpression(String newExpression) {
String oldExpression = expression;
expression = newExpression;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.OPERATION__EXPRESSION, oldExpression, expression));
}
/**
*
*
* @generated NOT
*/
public DelegateOperation getDelegate() {
return this.delegateOperation;
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case DomPackage.OPERATION__PARAMETERS:
return ((InternalEList)getParameters()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated NOT
*/
public void setDelegate(DelegateOperation delegateOperation) {
this.delegateOperation = delegateOperation;
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case DomPackage.OPERATION__TXT_DESCRIPTION:
return getTxtDescription();
case DomPackage.OPERATION__PARAMETERS:
return getParameters();
case DomPackage.OPERATION__EXPRESSION:
return getExpression();
case DomPackage.OPERATION__DELEGATE:
return getDelegate();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case DomPackage.OPERATION__TXT_DESCRIPTION:
setTxtDescription((String)newValue);
return;
case DomPackage.OPERATION__PARAMETERS:
getParameters().clear();
getParameters().addAll((Collection)newValue);
return;
case DomPackage.OPERATION__EXPRESSION:
setExpression((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case DomPackage.OPERATION__TXT_DESCRIPTION:
setTxtDescription(TXT_DESCRIPTION_EDEFAULT);
return;
case DomPackage.OPERATION__PARAMETERS:
getParameters().clear();
return;
case DomPackage.OPERATION__EXPRESSION:
setExpression(EXPRESSION_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DomPackage.OPERATION__TXT_DESCRIPTION:
return TXT_DESCRIPTION_EDEFAULT == null ? txtDescription != null : !TXT_DESCRIPTION_EDEFAULT.equals(txtDescription);
case DomPackage.OPERATION__PARAMETERS:
return parameters != null && !parameters.isEmpty();
case DomPackage.OPERATION__EXPRESSION:
return EXPRESSION_EDEFAULT == null ? expression != null : !EXPRESSION_EDEFAULT.equals(expression);
case DomPackage.OPERATION__DELEGATE:
return getDelegate() != null;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) {
if (baseClass == IDocumentable.class) {
switch (derivedFeatureID) {
case DomPackage.OPERATION__TXT_DESCRIPTION: return CorePackage.IDOCUMENTABLE__TXT_DESCRIPTION;
default: return -1;
}
}
return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
}
/**
*
*
* @generated
*/
@Override
public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) {
if (baseClass == IDocumentable.class) {
switch (baseFeatureID) {
case CorePackage.IDOCUMENTABLE__TXT_DESCRIPTION: return DomPackage.OPERATION__TXT_DESCRIPTION;
default: return -1;
}
}
return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (txtDescription: ");
result.append(txtDescription);
result.append(", expression: ");
result.append(expression);
result.append(')');
return result.toString();
}
} //OperationImpl