/*********************************************************************************************************************** | |
* 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.util.ReconciliationHelper; | |
import org.eclipse.emf.common.notify.Notification; | |
import org.eclipse.emf.ecore.EClass; | |
import org.eclipse.emf.ecore.impl.ENotificationImpl; | |
import org.eclipse.smila.processing.designer.model.processor.ProcessorPackage; | |
import org.eclipse.smila.processing.designer.model.processor.Variables; | |
import org.eclipse.smila.processing.designer.model.processor.util.ProcessorConstants; | |
import org.eclipse.smila.processing.designer.model.record.impl.ExtensionElementImpl; | |
import org.w3c.dom.Document; | |
import org.w3c.dom.Element; | |
/** | |
* <!-- begin-user-doc --> An implementation of the model object '<em><b>Variables</b></em>'. <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* <ul> | |
* <li>{@link org.eclipse.smila.processing.designer.model.processor.impl.VariablesImpl#getInput <em>Input</em>}</li> | |
* <li>{@link org.eclipse.smila.processing.designer.model.processor.impl.VariablesImpl#getOutput <em>Output</em>}</li> | |
* </ul> | |
* </p> | |
* | |
* @generated | |
*/ | |
public class VariablesImpl extends ExtensionElementImpl implements Variables { | |
/** | |
* The default value of the '{@link #getInput() <em>Input</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc | |
* --> | |
* | |
* @see #getInput() | |
* @generated | |
* @ordered | |
*/ | |
protected static final String INPUT_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getInput() <em>Input</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc | |
* --> | |
* | |
* @see #getInput() | |
* @generated | |
* @ordered | |
*/ | |
protected String input = INPUT_EDEFAULT; | |
/** | |
* The default value of the '{@link #getOutput() <em>Output</em>}' attribute. <!-- begin-user-doc --> <!-- | |
* end-user-doc --> | |
* | |
* @see #getOutput() | |
* @generated | |
* @ordered | |
*/ | |
protected static final String OUTPUT_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getOutput() <em>Output</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc | |
* --> | |
* | |
* @see #getOutput() | |
* @generated | |
* @ordered | |
*/ | |
protected String output = OUTPUT_EDEFAULT; | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
protected VariablesImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return ProcessorPackage.Literals.VARIABLES; | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public String getInput() { | |
return input; | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @customized | |
*/ | |
@Override | |
public void setInput(String newInput) { | |
String oldInput = input; | |
if (oldInput != newInput && (oldInput == null || !oldInput.equals(newInput))) { | |
input = newInput; | |
if (shouldReconcile()) { | |
ReconciliationHelper.replaceAttribute(this, ProcessorConstants.ATT_INPUT, newInput); | |
} | |
if (eNotificationRequired()) { | |
eNotify(new ENotificationImpl(this, Notification.SET, ProcessorPackage.VARIABLES__INPUT, oldInput, input)); | |
} | |
} | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public String getOutput() { | |
return output; | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @customized | |
*/ | |
@Override | |
public void setOutput(String newOutput) { | |
String oldOutput = output; | |
if (oldOutput != newOutput && (oldOutput == null || !oldOutput.equals(newOutput))) { | |
output = newOutput; | |
if (shouldReconcile()) { | |
ReconciliationHelper.replaceAttribute(this, ProcessorConstants.ATT_OUTPUT, newOutput); | |
} | |
if (eNotificationRequired()) { | |
eNotify(new ENotificationImpl(this, Notification.SET, ProcessorPackage.VARIABLES__OUTPUT, oldOutput, output)); | |
} | |
} | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public Object eGet(int featureID, boolean resolve, boolean coreType) { | |
switch (featureID) { | |
case ProcessorPackage.VARIABLES__INPUT: | |
return getInput(); | |
case ProcessorPackage.VARIABLES__OUTPUT: | |
return getOutput(); | |
} | |
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.VARIABLES__INPUT: | |
setInput((String) newValue); | |
return; | |
case ProcessorPackage.VARIABLES__OUTPUT: | |
setOutput((String) newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case ProcessorPackage.VARIABLES__INPUT: | |
setInput(INPUT_EDEFAULT); | |
return; | |
case ProcessorPackage.VARIABLES__OUTPUT: | |
setOutput(OUTPUT_EDEFAULT); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case ProcessorPackage.VARIABLES__INPUT: | |
return INPUT_EDEFAULT == null ? input != null : !INPUT_EDEFAULT.equals(input); | |
case ProcessorPackage.VARIABLES__OUTPUT: | |
return OUTPUT_EDEFAULT == null ? output != null : !OUTPUT_EDEFAULT.equals(output); | |
} | |
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(" (input: "); | |
result.append(input); | |
result.append(", output: "); | |
result.append(output); | |
result.append(')'); | |
return result.toString(); | |
} | |
/** | |
* @see ExtensionElementImpl#createFixedElement(Document) | |
*/ | |
@Override | |
protected Element createFixedElement(Document document) { | |
Element element = document.createElementNS(ProcessorPackage.eNS_URI, ProcessorConstants.ELEMENT_VARIABLES); | |
element.setPrefix(ProcessorPackage.eNS_PREFIX); | |
if (input != null) { | |
element.setAttribute(ProcessorConstants.ATT_INPUT, input); | |
} | |
if (output != null) { | |
element.setAttribute(ProcessorConstants.ATT_OUTPUT, output); | |
} | |
return element; | |
} | |
} // VariablesImpl |