/**
* <copyright>
* </copyright>
*
* $Id$
*/
package com.founder.fix.bpmn2extensions.fixflow.impl;
import com.founder.fix.bpmn2extensions.fixflow.DataVariable;
import com.founder.fix.bpmn2extensions.fixflow.Documentation;
import com.founder.fix.bpmn2extensions.fixflow.Expression;
import com.founder.fix.bpmn2extensions.fixflow.FixFlowPackage;
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;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Data Variable</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link com.founder.fix.bpmn2extensions.fixflow.impl.DataVariableImpl#getId <em>Id</em>}</li>
* <li>{@link com.founder.fix.bpmn2extensions.fixflow.impl.DataVariableImpl#getDataType <em>Data Type</em>}</li>
* <li>{@link com.founder.fix.bpmn2extensions.fixflow.impl.DataVariableImpl#isIsList <em>Is List</em>}</li>
* <li>{@link com.founder.fix.bpmn2extensions.fixflow.impl.DataVariableImpl#isIsPersistence <em>Is Persistence</em>}</li>
* <li>{@link com.founder.fix.bpmn2extensions.fixflow.impl.DataVariableImpl#getExpression <em>Expression</em>}</li>
* <li>{@link com.founder.fix.bpmn2extensions.fixflow.impl.DataVariableImpl#getDocumentation <em>Documentation</em>}</li>
* <li>{@link com.founder.fix.bpmn2extensions.fixflow.impl.DataVariableImpl#getBizType <em>Biz Type</em>}</li>
* <li>{@link com.founder.fix.bpmn2extensions.fixflow.impl.DataVariableImpl#getFileName <em>File Name</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class DataVariableImpl extends EObjectImpl implements DataVariable {
/**
* 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 default value of the '{@link #getDataType() <em>Data Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDataType()
* @generated
* @ordered
*/
protected static final String DATA_TYPE_EDEFAULT = null;
/**
* The cached value of the '{@link #getDataType() <em>Data Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDataType()
* @generated
* @ordered
*/
protected String dataType = DATA_TYPE_EDEFAULT;
/**
* The default value of the '{@link #isIsList() <em>Is List</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isIsList()
* @generated
* @ordered
*/
protected static final boolean IS_LIST_EDEFAULT = false;
/**
* The cached value of the '{@link #isIsList() <em>Is List</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isIsList()
* @generated
* @ordered
*/
protected boolean isList = IS_LIST_EDEFAULT;
/**
* The default value of the '{@link #isIsPersistence() <em>Is Persistence</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isIsPersistence()
* @generated
* @ordered
*/
protected static final boolean IS_PERSISTENCE_EDEFAULT = false;
/**
* The cached value of the '{@link #isIsPersistence() <em>Is Persistence</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isIsPersistence()
* @generated
* @ordered
*/
protected boolean isPersistence = IS_PERSISTENCE_EDEFAULT;
/**
* The cached value of the '{@link #getExpression() <em>Expression</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getExpression()
* @generated
* @ordered
*/
protected Expression expression;
/**
* The cached value of the '{@link #getDocumentation() <em>Documentation</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDocumentation()
* @generated
* @ordered
*/
protected EList<Documentation> documentation;
/**
* The default value of the '{@link #getBizType() <em>Biz Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBizType()
* @generated
* @ordered
*/
protected static final String BIZ_TYPE_EDEFAULT = null;
/**
* The cached value of the '{@link #getBizType() <em>Biz Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBizType()
* @generated
* @ordered
*/
protected String bizType = BIZ_TYPE_EDEFAULT;
/**
* The default value of the '{@link #getFileName() <em>File Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFileName()
* @generated
* @ordered
*/
protected static final String FILE_NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getFileName() <em>File Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFileName()
* @generated
* @ordered
*/
protected String fileName = FILE_NAME_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DataVariableImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FixFlowPackage.Literals.DATA_VARIABLE;
}
/**
* <!-- 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, FixFlowPackage.DATA_VARIABLE__ID, oldId, id));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getDataType() {
return dataType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDataType(String newDataType) {
String oldDataType = dataType;
dataType = newDataType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FixFlowPackage.DATA_VARIABLE__DATA_TYPE, oldDataType, dataType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isIsList() {
return isList;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setIsList(boolean newIsList) {
boolean oldIsList = isList;
isList = newIsList;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FixFlowPackage.DATA_VARIABLE__IS_LIST, oldIsList, isList));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isIsPersistence() {
return isPersistence;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setIsPersistence(boolean newIsPersistence) {
boolean oldIsPersistence = isPersistence;
isPersistence = newIsPersistence;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FixFlowPackage.DATA_VARIABLE__IS_PERSISTENCE, oldIsPersistence, isPersistence));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Expression getExpression() {
return expression;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetExpression(Expression newExpression, NotificationChain msgs) {
Expression oldExpression = expression;
expression = newExpression;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FixFlowPackage.DATA_VARIABLE__EXPRESSION, oldExpression, newExpression);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setExpression(Expression newExpression) {
if (newExpression != expression) {
NotificationChain msgs = null;
if (expression != null)
msgs = ((InternalEObject)expression).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FixFlowPackage.DATA_VARIABLE__EXPRESSION, null, msgs);
if (newExpression != null)
msgs = ((InternalEObject)newExpression).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FixFlowPackage.DATA_VARIABLE__EXPRESSION, null, msgs);
msgs = basicSetExpression(newExpression, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FixFlowPackage.DATA_VARIABLE__EXPRESSION, newExpression, newExpression));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<Documentation> getDocumentation() {
if (documentation == null) {
documentation = new EObjectContainmentEList<Documentation>(Documentation.class, this, FixFlowPackage.DATA_VARIABLE__DOCUMENTATION);
}
return documentation;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getBizType() {
return bizType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBizType(String newBizType) {
String oldBizType = bizType;
bizType = newBizType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FixFlowPackage.DATA_VARIABLE__BIZ_TYPE, oldBizType, bizType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getFileName() {
return fileName;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setFileName(String newFileName) {
String oldFileName = fileName;
fileName = newFileName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FixFlowPackage.DATA_VARIABLE__FILE_NAME, oldFileName, fileName));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FixFlowPackage.DATA_VARIABLE__EXPRESSION:
return basicSetExpression(null, msgs);
case FixFlowPackage.DATA_VARIABLE__DOCUMENTATION:
return ((InternalEList<?>)getDocumentation()).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 FixFlowPackage.DATA_VARIABLE__ID:
return getId();
case FixFlowPackage.DATA_VARIABLE__DATA_TYPE:
return getDataType();
case FixFlowPackage.DATA_VARIABLE__IS_LIST:
return isIsList();
case FixFlowPackage.DATA_VARIABLE__IS_PERSISTENCE:
return isIsPersistence();
case FixFlowPackage.DATA_VARIABLE__EXPRESSION:
return getExpression();
case FixFlowPackage.DATA_VARIABLE__DOCUMENTATION:
return getDocumentation();
case FixFlowPackage.DATA_VARIABLE__BIZ_TYPE:
return getBizType();
case FixFlowPackage.DATA_VARIABLE__FILE_NAME:
return getFileName();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FixFlowPackage.DATA_VARIABLE__ID:
setId((String)newValue);
return;
case FixFlowPackage.DATA_VARIABLE__DATA_TYPE:
setDataType((String)newValue);
return;
case FixFlowPackage.DATA_VARIABLE__IS_LIST:
setIsList((Boolean)newValue);
return;
case FixFlowPackage.DATA_VARIABLE__IS_PERSISTENCE:
setIsPersistence((Boolean)newValue);
return;
case FixFlowPackage.DATA_VARIABLE__EXPRESSION:
setExpression((Expression)newValue);
return;
case FixFlowPackage.DATA_VARIABLE__DOCUMENTATION:
getDocumentation().clear();
getDocumentation().addAll((Collection<? extends Documentation>)newValue);
return;
case FixFlowPackage.DATA_VARIABLE__BIZ_TYPE:
setBizType((String)newValue);
return;
case FixFlowPackage.DATA_VARIABLE__FILE_NAME:
setFileName((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FixFlowPackage.DATA_VARIABLE__ID:
setId(ID_EDEFAULT);
return;
case FixFlowPackage.DATA_VARIABLE__DATA_TYPE:
setDataType(DATA_TYPE_EDEFAULT);
return;
case FixFlowPackage.DATA_VARIABLE__IS_LIST:
setIsList(IS_LIST_EDEFAULT);
return;
case FixFlowPackage.DATA_VARIABLE__IS_PERSISTENCE:
setIsPersistence(IS_PERSISTENCE_EDEFAULT);
return;
case FixFlowPackage.DATA_VARIABLE__EXPRESSION:
setExpression((Expression)null);
return;
case FixFlowPackage.DATA_VARIABLE__DOCUMENTATION:
getDocumentation().clear();
return;
case FixFlowPackage.DATA_VARIABLE__BIZ_TYPE:
setBizType(BIZ_TYPE_EDEFAULT);
return;
case FixFlowPackage.DATA_VARIABLE__FILE_NAME:
setFileName(FILE_NAME_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FixFlowPackage.DATA_VARIABLE__ID:
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
case FixFlowPackage.DATA_VARIABLE__DATA_TYPE:
return DATA_TYPE_EDEFAULT == null ? dataType != null : !DATA_TYPE_EDEFAULT.equals(dataType);
case FixFlowPackage.DATA_VARIABLE__IS_LIST:
return isList != IS_LIST_EDEFAULT;
case FixFlowPackage.DATA_VARIABLE__IS_PERSISTENCE:
return isPersistence != IS_PERSISTENCE_EDEFAULT;
case FixFlowPackage.DATA_VARIABLE__EXPRESSION:
return expression != null;
case FixFlowPackage.DATA_VARIABLE__DOCUMENTATION:
return documentation != null && !documentation.isEmpty();
case FixFlowPackage.DATA_VARIABLE__BIZ_TYPE:
return BIZ_TYPE_EDEFAULT == null ? bizType != null : !BIZ_TYPE_EDEFAULT.equals(bizType);
case FixFlowPackage.DATA_VARIABLE__FILE_NAME:
return FILE_NAME_EDEFAULT == null ? fileName != null : !FILE_NAME_EDEFAULT.equals(fileName);
}
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(" (id: ");
result.append(id);
result.append(", dataType: ");
result.append(dataType);
result.append(", isList: ");
result.append(isList);
result.append(", isPersistence: ");
result.append(isPersistence);
result.append(", bizType: ");
result.append(bizType);
result.append(", fileName: ");
result.append(fileName);
result.append(')');
return result.toString();
}
} //DataVariableImpl