blob: 0a5124403f3bc8db181c7f10f091c7ba64a1a109 [file] [log] [blame]
/***********************************************************************************************************************
* Copyright (c) 2010 Attensity Europe GmbH. 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
**********************************************************************************************************************/
package org.eclipse.smila.processing.designer.model.processor.impl;
import org.eclipse.bpel.model.impl.ExtensionActivityImpl;
import org.eclipse.bpel.model.util.ReconciliationHelper;
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.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.smila.processing.designer.model.processor.*;
import org.eclipse.smila.processing.designer.model.processor.util.DOMUtils;
import org.eclipse.smila.processing.designer.model.processor.util.ProcessorConstants;
import org.eclipse.smila.processing.designer.model.record.ExtensionElement;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
/**
* <!-- begin-user-doc --> An implementation of the model object '<em><b>Invoke Pipelet</b></em>'. <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.smila.processing.designer.model.processor.impl.InvokePipeletImpl#getPipelet <em>Pipelet</em>}</li>
* <li>{@link org.eclipse.smila.processing.designer.model.processor.impl.InvokePipeletImpl#getVariables <em>Variables
* </em>}</li>
* <li>{@link org.eclipse.smila.processing.designer.model.processor.impl.InvokePipeletImpl#getConfiguration <em>
* Configuration</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class InvokePipeletImpl extends ExtensionActivityImpl implements InvokePipelet {
/**
* The cached value of the '{@link #getPipelet() <em>Pipelet</em>}' containment reference. <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getPipelet()
* @generated
* @ordered
*/
protected Pipelet pipelet;
/**
* The cached value of the '{@link #getVariables() <em>Variables</em>}' containment reference. <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getVariables()
* @generated
* @ordered
*/
protected Variables variables;
/**
* The cached value of the '{@link #getConfiguration() <em>Configuration</em>}' containment reference. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
* @see #getConfiguration()
* @generated
* @ordered
*/
protected Configuration configuration;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected InvokePipeletImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return ProcessorPackage.Literals.INVOKE_PIPELET;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public Pipelet getPipelet() {
return pipelet;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @customized
*/
public NotificationChain basicSetPipelet(Pipelet newPipelet, NotificationChain msgs) {
Pipelet oldPipelet = pipelet;
pipelet = newPipelet;
// Reconcile
replaceChild(oldPipelet, newPipelet);
if (eNotificationRequired()) {
ENotificationImpl notification =
new ENotificationImpl(this, Notification.SET, ProcessorPackage.INVOKE_PIPELET__PIPELET, oldPipelet,
newPipelet);
if (msgs == null) {
msgs = notification;
} else {
msgs.add(notification);
}
}
return msgs;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setPipelet(Pipelet newPipelet) {
if (newPipelet != pipelet) {
NotificationChain msgs = null;
if (pipelet != null) {
msgs =
((InternalEObject) pipelet).eInverseRemove(this, EOPPOSITE_FEATURE_BASE
- ProcessorPackage.INVOKE_PIPELET__PIPELET, null, msgs);
}
if (newPipelet != null) {
msgs =
((InternalEObject) newPipelet).eInverseAdd(this, EOPPOSITE_FEATURE_BASE
- ProcessorPackage.INVOKE_PIPELET__PIPELET, null, msgs);
}
msgs = basicSetPipelet(newPipelet, msgs);
if (msgs != null) {
msgs.dispatch();
}
} else if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, ProcessorPackage.INVOKE_PIPELET__PIPELET, newPipelet,
newPipelet));
}
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public Variables getVariables() {
return variables;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @customized
*/
public NotificationChain basicSetVariables(Variables newVariables, NotificationChain msgs) {
Variables oldVariables = variables;
variables = newVariables;
// Reconcile
replaceChild(oldVariables, newVariables);
if (eNotificationRequired()) {
ENotificationImpl notification =
new ENotificationImpl(this, Notification.SET, ProcessorPackage.INVOKE_PIPELET__VARIABLES, oldVariables,
newVariables);
if (msgs == null) {
msgs = notification;
} else {
msgs.add(notification);
}
}
return msgs;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setVariables(Variables newVariables) {
if (newVariables != variables) {
NotificationChain msgs = null;
if (variables != null) {
msgs =
((InternalEObject) variables).eInverseRemove(this, EOPPOSITE_FEATURE_BASE
- ProcessorPackage.INVOKE_PIPELET__VARIABLES, null, msgs);
}
if (newVariables != null) {
msgs =
((InternalEObject) newVariables).eInverseAdd(this, EOPPOSITE_FEATURE_BASE
- ProcessorPackage.INVOKE_PIPELET__VARIABLES, null, msgs);
}
msgs = basicSetVariables(newVariables, msgs);
if (msgs != null) {
msgs.dispatch();
}
} else if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, ProcessorPackage.INVOKE_PIPELET__VARIABLES,
newVariables, newVariables));
}
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public Configuration getConfiguration() {
return configuration;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @customized
*/
public NotificationChain basicSetConfiguration(Configuration newConfiguration, NotificationChain msgs) {
Configuration oldConfiguration = configuration;
configuration = newConfiguration;
// Reconcile
replaceChild(oldConfiguration, newConfiguration);
if (eNotificationRequired()) {
ENotificationImpl notification =
new ENotificationImpl(this, Notification.SET, ProcessorPackage.INVOKE_PIPELET__CONFIGURATION,
oldConfiguration, newConfiguration);
if (msgs == null) {
msgs = notification;
} else {
msgs.add(notification);
}
}
return msgs;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setConfiguration(Configuration newConfiguration) {
if (newConfiguration != configuration) {
NotificationChain msgs = null;
if (configuration != null) {
msgs =
((InternalEObject) configuration).eInverseRemove(this, EOPPOSITE_FEATURE_BASE
- ProcessorPackage.INVOKE_PIPELET__CONFIGURATION, null, msgs);
}
if (newConfiguration != null) {
msgs =
((InternalEObject) newConfiguration).eInverseAdd(this, EOPPOSITE_FEATURE_BASE
- ProcessorPackage.INVOKE_PIPELET__CONFIGURATION, null, msgs);
}
msgs = basicSetConfiguration(newConfiguration, msgs);
if (msgs != null) {
msgs.dispatch();
}
} else if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, ProcessorPackage.INVOKE_PIPELET__CONFIGURATION,
newConfiguration, newConfiguration));
}
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @customized
*/
@Override
public Element fixElement(Document document) {
if (getElement() == null && !isUpdatingDOM()) {
try {
setUpdatingDOM(true);
Element element =
document.createElementNS(ProcessorPackage.eNS_URI, ProcessorConstants.ELEMENT_INVOKE_PIPELET);
element.setPrefix(ProcessorPackage.eNS_PREFIX);
setElement(element);
if (getPipelet() != null) {
DOMUtils.appendIndented(element, getPipelet().fixElement(document));
}
if (getVariables() != null) {
DOMUtils.appendIndented(element, getVariables().fixElement(document));
}
if (getConfiguration() != null) {
DOMUtils.appendIndented(element, getConfiguration().fixElement(document));
}
} finally {
setUpdatingDOM(false);
}
}
return getElement();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ProcessorPackage.INVOKE_PIPELET__PIPELET:
return basicSetPipelet(null, msgs);
case ProcessorPackage.INVOKE_PIPELET__VARIABLES:
return basicSetVariables(null, msgs);
case ProcessorPackage.INVOKE_PIPELET__CONFIGURATION:
return basicSetConfiguration(null, 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 ProcessorPackage.INVOKE_PIPELET__PIPELET:
return getPipelet();
case ProcessorPackage.INVOKE_PIPELET__VARIABLES:
return getVariables();
case ProcessorPackage.INVOKE_PIPELET__CONFIGURATION:
return getConfiguration();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ProcessorPackage.INVOKE_PIPELET__PIPELET:
setPipelet((Pipelet) newValue);
return;
case ProcessorPackage.INVOKE_PIPELET__VARIABLES:
setVariables((Variables) newValue);
return;
case ProcessorPackage.INVOKE_PIPELET__CONFIGURATION:
setConfiguration((Configuration) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ProcessorPackage.INVOKE_PIPELET__PIPELET:
setPipelet((Pipelet) null);
return;
case ProcessorPackage.INVOKE_PIPELET__VARIABLES:
setVariables((Variables) null);
return;
case ProcessorPackage.INVOKE_PIPELET__CONFIGURATION:
setConfiguration((Configuration) null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ProcessorPackage.INVOKE_PIPELET__PIPELET:
return pipelet != null;
case ProcessorPackage.INVOKE_PIPELET__VARIABLES:
return variables != null;
case ProcessorPackage.INVOKE_PIPELET__CONFIGURATION:
return configuration != null;
}
return super.eIsSet(featureID);
}
protected <E extends ExtensionElement> void replaceChild(E oldElement, E newElement) {
if (!isReconciling() && !isUpdatingDOM() && getElement() != null && !ReconciliationHelper.isLoading(this)) {
if (newElement.fixElement(getElement().getOwnerDocument()) != null) {
ReconciliationHelper.replaceChild(this, oldElement, newElement);
}
}
}
} // InvokePipeletImpl