blob: 98a9c46064259fbe713591c58300d20d395cef5e [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.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.Pipelet;
import org.eclipse.smila.processing.designer.model.processor.ProcessorPackage;
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>Pipelet</b></em>'. <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.smila.processing.designer.model.processor.impl.PipeletImpl#getClass_ <em>Class</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class PipeletImpl extends ExtensionElementImpl implements Pipelet {
/**
* The default value of the '{@link #getClass_() <em>Class</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
* -->
*
* @see #getClass_()
* @generated
* @ordered
*/
protected static final String CLASS_EDEFAULT = null;
/**
* The cached value of the '{@link #getClass_() <em>Class</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
* -->
*
* @see #getClass_()
* @generated
* @ordered
*/
protected String class_ = CLASS_EDEFAULT;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected PipeletImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return ProcessorPackage.Literals.PIPELET;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public String getClass_() {
return class_;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @customized
*/
@Override
public void setClass(String newClass) {
String oldClass = class_;
if (oldClass != newClass && (oldClass == null || !oldClass.equals(newClass))) {
class_ = newClass;
if (shouldReconcile()) {
ReconciliationHelper.replaceAttribute(this, ProcessorConstants.ATT_CLASS, newClass);
}
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, ProcessorPackage.PIPELET__CLASS, oldClass, class_));
}
}
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ProcessorPackage.PIPELET__CLASS:
return getClass_();
}
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.PIPELET__CLASS:
setClass((String) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ProcessorPackage.PIPELET__CLASS:
setClass(CLASS_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ProcessorPackage.PIPELET__CLASS:
return CLASS_EDEFAULT == null ? class_ != null : !CLASS_EDEFAULT.equals(class_);
}
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(" (class: ");
result.append(class_);
result.append(')');
return result.toString();
}
/**
* @see ExtensionElementImpl#createFixedElement(Document)
*/
@Override
protected Element createFixedElement(Document document) {
Element element = document.createElementNS(ProcessorPackage.eNS_URI, ProcessorConstants.ELEMENT_PIPELET);
element.setPrefix(ProcessorPackage.eNS_PREFIX);
if (class_ != null) {
element.setAttribute(ProcessorConstants.ATT_NAME, class_);
}
return element;
}
} // PipeletImpl