/**
* <copyright>
*
* Copyright (c) 2010 SAP AG.
* 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
*
* Contributors:
* Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation
*
* </copyright>
*/
package org.eclipse.bpmn2.impl;
import org.eclipse.bpmn2.Bpmn2Package;
import org.eclipse.bpmn2.FieldExtension;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Field Extension</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.bpmn2.impl.FieldExtensionImpl#getFieldname <em>Fieldname</em>}</li>
* <li>{@link org.eclipse.bpmn2.impl.FieldExtensionImpl#getExpression <em>Expression</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class FieldExtensionImpl extends BaseElementImpl implements
FieldExtension {
/**
* The default value of the '{@link #getFieldname() <em>Fieldname</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFieldname()
* @generated
* @ordered
*/
protected static final String FIELDNAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getFieldname() <em>Fieldname</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFieldname()
* @generated
* @ordered
*/
protected String fieldname = FIELDNAME_EDEFAULT;
/**
* The default value of the '{@link #getExpression() <em>Expression</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getExpression()
* @generated
* @ordered
*/
protected static final String EXPRESSION_EDEFAULT = null;
/**
* The cached value of the '{@link #getExpression() <em>Expression</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getExpression()
* @generated
* @ordered
*/
protected String expression = EXPRESSION_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected FieldExtensionImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return Bpmn2Package.Literals.FIELD_EXTENSION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getFieldname() {
return fieldname;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setFieldname(String newFieldname) {
String oldFieldname = fieldname;
fieldname = newFieldname;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
Bpmn2Package.FIELD_EXTENSION__FIELDNAME, oldFieldname,
fieldname));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getExpression() {
return expression;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setExpression(String newExpression) {
String oldExpression = expression;
expression = newExpression;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
Bpmn2Package.FIELD_EXTENSION__EXPRESSION, oldExpression,
expression));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Bpmn2Package.FIELD_EXTENSION__FIELDNAME:
return getFieldname();
case Bpmn2Package.FIELD_EXTENSION__EXPRESSION:
return getExpression();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Bpmn2Package.FIELD_EXTENSION__FIELDNAME:
setFieldname((String) newValue);
return;
case Bpmn2Package.FIELD_EXTENSION__EXPRESSION:
setExpression((String) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Bpmn2Package.FIELD_EXTENSION__FIELDNAME:
setFieldname(FIELDNAME_EDEFAULT);
return;
case Bpmn2Package.FIELD_EXTENSION__EXPRESSION:
setExpression(EXPRESSION_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Bpmn2Package.FIELD_EXTENSION__FIELDNAME:
return FIELDNAME_EDEFAULT == null ? fieldname != null
: !FIELDNAME_EDEFAULT.equals(fieldname);
case Bpmn2Package.FIELD_EXTENSION__EXPRESSION:
return EXPRESSION_EDEFAULT == null ? expression != null
: !EXPRESSION_EDEFAULT.equals(expression);
}
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(" (fieldname: ");
result.append(fieldname);
result.append(", expression: ");
result.append(expression);
result.append(')');
return result.toString();
}
} //FieldExtensionImpl