/**
* <copyright>
* </copyright>
*
* $Id$
*/
package SmartGen.impl;
import SmartGen.FieldValue;
import SmartGen.SmartGenPackage;
import SmartGen.Value;
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.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Field Value</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link SmartGen.impl.FieldValueImpl#getValues <em>Values</em>}</li>
* <li>{@link SmartGen.impl.FieldValueImpl#getName <em>Name</em>}</li>
* <li>{@link SmartGen.impl.FieldValueImpl#getHeader <em>Header</em>}</li>
* <li>{@link SmartGen.impl.FieldValueImpl#getSeparator <em>Separator</em>}</li>
* <li>{@link SmartGen.impl.FieldValueImpl#getFooter <em>Footer</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class FieldValueImpl extends ConfigurableElementImpl implements FieldValue {
/**
* The cached value of the '{@link #getValues() <em>Values</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValues()
* @generated
* @ordered
*/
protected EList values;
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* The default value of the '{@link #getHeader() <em>Header</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getHeader()
* @generated
* @ordered
*/
protected static final String HEADER_EDEFAULT = null;
/**
* The cached value of the '{@link #getHeader() <em>Header</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getHeader()
* @generated
* @ordered
*/
protected String header = HEADER_EDEFAULT;
/**
* The default value of the '{@link #getSeparator() <em>Separator</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSeparator()
* @generated
* @ordered
*/
protected static final String SEPARATOR_EDEFAULT = null;
/**
* The cached value of the '{@link #getSeparator() <em>Separator</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSeparator()
* @generated
* @ordered
*/
protected String separator = SEPARATOR_EDEFAULT;
/**
* The default value of the '{@link #getFooter() <em>Footer</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFooter()
* @generated
* @ordered
*/
protected static final String FOOTER_EDEFAULT = null;
/**
* The cached value of the '{@link #getFooter() <em>Footer</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFooter()
* @generated
* @ordered
*/
protected String footer = FOOTER_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected FieldValueImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EClass eStaticClass() {
return SmartGenPackage.Literals.FIELD_VALUE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList getValues() {
if (values == null) {
values = new EObjectContainmentEList(Value.class, this, SmartGenPackage.FIELD_VALUE__VALUES);
}
return values;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getName() {
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(String newName) {
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SmartGenPackage.FIELD_VALUE__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getHeader() {
return header;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setHeader(String newHeader) {
String oldHeader = header;
header = newHeader;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SmartGenPackage.FIELD_VALUE__HEADER, oldHeader, header));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getSeparator() {
return separator;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSeparator(String newSeparator) {
String oldSeparator = separator;
separator = newSeparator;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SmartGenPackage.FIELD_VALUE__SEPARATOR, oldSeparator, separator));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getFooter() {
return footer;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setFooter(String newFooter) {
String oldFooter = footer;
footer = newFooter;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SmartGenPackage.FIELD_VALUE__FOOTER, oldFooter, footer));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case SmartGenPackage.FIELD_VALUE__VALUES:
return ((InternalEList)getValues()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case SmartGenPackage.FIELD_VALUE__VALUES:
return getValues();
case SmartGenPackage.FIELD_VALUE__NAME:
return getName();
case SmartGenPackage.FIELD_VALUE__HEADER:
return getHeader();
case SmartGenPackage.FIELD_VALUE__SEPARATOR:
return getSeparator();
case SmartGenPackage.FIELD_VALUE__FOOTER:
return getFooter();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case SmartGenPackage.FIELD_VALUE__VALUES:
getValues().clear();
getValues().addAll((Collection)newValue);
return;
case SmartGenPackage.FIELD_VALUE__NAME:
setName((String)newValue);
return;
case SmartGenPackage.FIELD_VALUE__HEADER:
setHeader((String)newValue);
return;
case SmartGenPackage.FIELD_VALUE__SEPARATOR:
setSeparator((String)newValue);
return;
case SmartGenPackage.FIELD_VALUE__FOOTER:
setFooter((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eUnset(int featureID) {
switch (featureID) {
case SmartGenPackage.FIELD_VALUE__VALUES:
getValues().clear();
return;
case SmartGenPackage.FIELD_VALUE__NAME:
setName(NAME_EDEFAULT);
return;
case SmartGenPackage.FIELD_VALUE__HEADER:
setHeader(HEADER_EDEFAULT);
return;
case SmartGenPackage.FIELD_VALUE__SEPARATOR:
setSeparator(SEPARATOR_EDEFAULT);
return;
case SmartGenPackage.FIELD_VALUE__FOOTER:
setFooter(FOOTER_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean eIsSet(int featureID) {
switch (featureID) {
case SmartGenPackage.FIELD_VALUE__VALUES:
return values != null && !values.isEmpty();
case SmartGenPackage.FIELD_VALUE__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case SmartGenPackage.FIELD_VALUE__HEADER:
return HEADER_EDEFAULT == null ? header != null : !HEADER_EDEFAULT.equals(header);
case SmartGenPackage.FIELD_VALUE__SEPARATOR:
return SEPARATOR_EDEFAULT == null ? separator != null : !SEPARATOR_EDEFAULT.equals(separator);
case SmartGenPackage.FIELD_VALUE__FOOTER:
return FOOTER_EDEFAULT == null ? footer != null : !FOOTER_EDEFAULT.equals(footer);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (name: ");
result.append(name);
result.append(", header: ");
result.append(header);
result.append(", separator: ");
result.append(separator);
result.append(", footer: ");
result.append(footer);
result.append(')');
return result.toString();
}
} //FieldValueImpl